Table des matières

AI Coding

Coder avec une IA LLM.

Explications:

Autres pages:

Sur les Modèles

Classification de modèles ouverts: Foundation models by Ibm

Comment faire pour qu'un appel à un LLM ait un résultat reproductible d'une fois sur l'autre ?

Sur les Agents

Sur les perfs

Estimations

Devstral avec llama.cpp sur RTX 3060 12 Go.

by ChatGPT :

Modèle Contexte (seq_len) Batch_size recommandé Remarques
—————– —————— ——————— —————————————-
Devstral Small 7B 1024 4 Très sûr, VRAM ample
Devstral Small 7B 2048 2‑3 Bon compromis vitesse/VRAM
Devstral Small 7B 4096 1‑2 VRAM presque saturée
Devstral 13B 1024 2 VRAM limitée
Devstral 13B 2048 1‑2 Optimal, attention VRAM
Devstral 13B 4096 1 VRAM saturée, offload CPU conseillé
Devstral 13B 8192 1 Possible mais contexte long → risque OOM

by LeChat:

contexte (tokens) modèle (paramètres) VRAM estimée (Go) Batch size optimal Latence estimée (tok/s) Notes
512 7B ~5.5 8 15-25 Idéal pour des tâches courtes et rapides.
1024 7B ~6.0 4 10-20 Bon compromis pour des prompts moyens.
2048 7B ~7.0 2 5-15 Nécessite une gestion fine de la VRAM.
4096 7B ~8.5 1 3-10 Proche de la limite VRAM, risque de ralentissement.
512 13B ~9.0 4 8-15 Modèle plus gros, latence accrue.
1024 13B ~10.0 2 4-10 VRAM presque saturée, batch_size réduit.
2048 13B ~11.5 1 2-8 Risque élevé de dépassement VRAM, latence importante.

Online services

launch a opencode server :

opencode serve --port=30781 --print-logs --log-level DEBUG

Then prompt : “Explain async/await in JavaScript”

with:

time opencode run -m <ProviderId/ModelId> --attach=http://127.0.0.1:30781 --agent=plan "Explain async/await in JavaScript"

👾 Attention, les résultats peuvent être très différents:

Cartes IA

Hailo

Axelera

seeedstudio

Ollama & Nvidia Jetpack

Nvidia

A 10 A 30 A 40 A 100 SXM4 A 800 H 100 SMX5
Prix eBay $2,330 $3,999 $9,950 $4,000 $20,000 $20,000
Architecture Ampere Ampere Ampere Ampere Ampere Hopper
Code name GA102 GA100 GA102 GA100 GA100 GH100
Launch date 2021-04 2021-04 2020-10 2020-05 2022-11 2022-03
Maximum RAM 24 GB 24 GB 48 GB 40 GB 40 GB 96 GB
Memory type GDDR6 HBM2e GDDR6 HBM2e HBM2e HBM3
Memory bandwidth 600.2 GB/s 933.1 GB/s 695.8 GB/s 1555 GB/s 1.56 TB/s 1,681 GB/s
Memory bus width 384 bit 3072 bit 384 bit 5120 bit 5120 bit 5120 bit
Memory clock speed 1563 MHz 1215 MHz 1812 MHz 1215 MHz 1215 MHz 1313 MHz
Core clock speed 885 MHz 930 MHz 1305 MHz 1095 MHz 765 MHz 1837 MHz
Boost clock speed 1695 MHz 1440 MHz 1740 MHz 1410 MHz 1410 MHz 1665 MHz
Peak Half Precision (FP16) 31.24 TFLOPS (1:1) 10.32 TFLOPS (1:1) 37.42 TFLOPS (1:1) 77.97 TFLOPS (4:1)
Pipelines 9216 3584 10752 6912 6912 16896
Thermal Design Power 150 Watt 165 Watt 300 Watt 400 Watt 250 Watt 700 Watt
OpenCL 3.0 3.0 3.0 3.0

Cartes graphiques

Nvidia

gpu_bench

Tips: Reset nvidia et CUDA:

# éteindre la carte
# débrancher THB
$ sudo rmmod nvidia_uvm nvidia

Adaptateur GPU externe

En anglais “GPU enclosures”. Nécessite un port Thunderbolt 3, 4 ou à venir 5.

egpu docks

Accelerating Machine Learning on a Linux Laptop with an External GPU by NVidia (Setting up Ubuntu to use NVIDIA eGPU)

eGPU

Models

Il en faut des tokens pour un petit programme

Pour de l'assistance au code

GGUF Models Metadata Viewer : Un viewer des meta-données des modèles que j'essaye en local réalisé sans coder, juste assistant IA et “OpenCode Zen Big Pickle” et “Mistral Devstral 2”.

Plan de test de comparaison par LeChat de Mistral:

API service

Mistral

Autres usages

Models servers

llama.cpp

https://github.com/ggml-org/llama.cpp

Lancer le serveur avec un modèle en local:

./bin/llama-server -m devstralQ5_K_M.gguf --port 8012 --jinja --ctx-size 20000
 
~/Code/bronx/AI_Coding/llama.cpp/build/bin/llama-server --port 8012 --chatml -m ~/Data/AI_Models/Qwen2.5-coder-7b-instruct-q8_0.gguf --ctx-size 48000

Quid des chat formats ? Est-ce lié au modèle ?

$ llama-server --help
...
--chat-template JINJA_TEMPLATE          set custom jinja chat template (default: template taken from model's
                                        metadata)
                                        if suffix/prefix are specified, template will be disabled
                                        only commonly used templates are accepted (unless --jinja is set
                                        before this flag):
                                        list of built-in templates:
                                        bailing, bailing-think, bailing2, chatglm3, chatglm4, chatml,
                                        command-r, deepseek, deepseek2, deepseek3, exaone3, exaone4, falcon3,
                                        gemma, gigachat, glmedge, gpt-oss, granite, grok-2, hunyuan-dense,
                                        hunyuan-moe, kimi-k2, llama2, llama2-sys, llama2-sys-bos,
                                        llama2-sys-strip, llama3, llama4, megrez, minicpm, mistral-v1,
                                        mistral-v3, mistral-v3-tekken, mistral-v7, mistral-v7-tekken, monarch,
                                        openchat, orion, pangu-embedded, phi3, phi4, rwkv-world, seed_oss,
                                        smolvlm, vicuna, vicuna-orca, yandex, zephyr
                                        (env: LLAMA_ARG_CHAT_TEMPLATE)

...

Modèles:

$ ./bin/llama-server --jinja -m ./Qwen3-Coder-30B-A3B-Instruct-Q5_K_S.gguf
llama_context: n_ctx_seq (4096) < n_ctx_train (262144) -- the full capacity of the model will not be utilized

Élargir la “context window” :

Compilation pour GPU

Il faut le compiler avec CUDA. Avec une version >= 11.7 pour compatibilité syntaxe.

J'ai installé CUDA le dépot Nvidia Cuda et cuda toolkit 13

$ sudo cat /etc/apt/sources.list.d/cuda-ubuntu2404-x86_64.list
deb [signed-by=/usr/share/keyrings/cuda-archive-keyring.gpg]
 https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2404/x86_64/ /

en option ou @ spécifier pour le cmake build :

export PATH=$PATH:/usr/local/cuda-<version>/bin/

Ensuite une longue compilation :

# DCMAKE_CUDA_ARCHITECTURES :
# CUDA GPU Compute Capability https://developer.nvidia.com/cuda-gpus
# RTX 3060 : 86
# RTX 5060 : 120

$ export CUDA_VERSION=12.9 && cmake -B build -DGGML_CUDA=ON \
 -DCMAKE_CUDA_ARCHITECTURES="86;120" \
 -DCMAKE_BUILD_WITH_INSTALL_RPATH=ON \
 -DCMAKE_CUDA_COMPILER=/usr/local/cuda-${CUDA_VERSION}/bin/nvcc \
 -DCMAKE_INSTALL_RPATH="/usr/local/cuda-${CUDA_VERSION}/lib64;\$ORIGIN"

-- ccache found, compilation results will be cached. Disable with GGML_CCACHE=OFF.
-- CMAKE_SYSTEM_PROCESSOR: x86_64
-- GGML_SYSTEM_ARCH: x86
-- Including CPU backend
-- x86 detected
-- Adding CPU backend variant ggml-cpu: -march=native 
-- CUDA Toolkit found
-- Using CUDA architectures: 86;120
-- CUDA host compiler is GNU 13.3.0
-- Including CUDA backend
-- ggml version: 0.9.4
-- ggml commit:  6016d0bd4
-- Configuring done (0.5s)
-- Generating done (0.2s)
-- Build files have been written to: /home/cyrille/Code/bronx/AI_Coding/llama.cpp/build

$ time cmake --build build --config Release -j 10

# host: i7-1360P + SSD
...
real	44m35,149s
user	42m38,100s
sys	1m51,594s
...
# Avec `-j 10` (concurent tasks)
real	11m6,449s
user	104m56,615s
sys	3m45,431s

ollama

- https://ollama.com - https://github.com/ollama/ollama

Chat & build with open models.

Interface utilisateur pour gérer et exécuter des modèles localement, utilise Llama.cpp sous le capot.

Sur linux install un service systemd

koboldcpp

https://github.com/LostRuins/koboldcpp

vLLM

vLLM est une bibliothèque open-source optimisée pour servir efficacement des LLMs en production, à la différence de llama.cpp qui est pour le développement ou usage solo sur du matériel standard (RTX ou CPU).

NanoLLM

https://github.com/dusty-nv/NanoLLM

From nvidia ingenier “Dustin Franklin” @dustynv .

Todo

LiteLLM

https://github.com/BerriAI/litellm

Tabby ML

Est à la fois le serveur de model et l'assistant de code.

https://tabby.tabbyml.com/docs/quick-start/installation/linux/

Fourni llama.cpp.

Coding assistant

Agentic Capabilities LLMs.

Listes d'agents

La concurrence est rude entre les entreprises et startups de l’IA. Dernier terrain de bataille, les agents dédiés au développement web et à la programmation. Google, avec Jules ; OpenAI, avec Codex ; GitHub, avec Copilot ; Anthropic, avec Claude Code, sans oublier les outils comme Lovable. Au tour maintenant du Français Mistral de proposer un « assistant de programmation propulsé par l’IA ». Mais de quoi s’agit-il exactement ?
Mistral Code, un nouvel agent IA pour automatiser le développement logiciel

continue

https://docs.continue.dev/

Claude code

https://claude.com/product/claude-code

Synoptia THÉRÈSE Cli

THÉRÈSE (Terminal Helper for Engineering, Research, Editing, Software & Execution) est un assistant de code en ligne de commande, 100% français, inspiré de Claude Code mais propulsé par Mistral AI.

https://github.com/ludovicsanchez38-creator/Synoptia-THERESE-CLI

Shai

shai is a coding agent, your pair programming buddy that lives in the terminal. Written in rust with love <3 at OVH.

https://github.com/ovh/shai

opencode

Les prompts system:

Modèles conseillés :

Plus de choses OpenCode

Essais de models

opencode models liste les modèles disponibles sur les providers configurés. Bien pratique pour trouver le nom à mettre dans la config.

Modèles on-line essayés avec opencode.

cline

codex-cli

Par OpenAi

Cursor

Par Anysphere Inc

https://cursor.com/pricing

Tabby

Contient le serveur de model qu'il faut installer.

Gemini CLI

LLxprt Code

fork de Google's Gemini CLI

Windsurf / Codeium

https://windsurf.com/editor

Amp Free

Tabnine

https://www.tabnine.com/

Mistral Vibe

Apache 2.0 license

MCP server

Articles:

Curated lists:

Demo MCP Server

A collection of reference implementations for the Model Context Protocol (MCP), as well as references to community-built servers and additional resources.

Serena

goose

A local, extensible, open source AI agent that automates engineering tasks.

Apify MCP

Apify Actors scrape up-to-date web data from any website for AI apps and agents, social media monitoring, competitive intelligence, lead generation, and product research. Crawl website to feed AI

arabold/docs-mcp-server

https://grounded.tools/ https://github.com/arabold/docs-mcp-server

context7

https://context7.com/

laravel boost

Dédié Php Laravel: https://laravel.com/ai/boost

Chrome DevTools MCP

https://github.com/ChromeDevTools/chrome-devtools-mcp/

chrome-devtools-mcp permet à votre agent de codage (tel que Gemini, Claude, Cursor ou Copilot) de contrôler et d'inspecter un navigateur Chrome en direct. Il agit comme un serveur MCP (Model-Context-Protocol), donnant à votre assistant de codage IA accès à toute la puissance de Chrome DevTools pour une automatisation fiable, un débogage approfondi et une analyse des performances.

LSP Server

Intelephense (php) https://intelephense.com/docs

Php Actor

Vector database

Solutions plus évoluées en SaaS

LLM Gateway

{
  "fallbacks": {
    "enabled": true,
    "order": [
      "openai/gpt-4o-mini",
      "anthropic/claude-sonnet-4",
      "mistral/mistral-large-latest"
    ]
  }
}

system message

Le “prompt système” est un élément essentiel : c'est la feuille de route pour le modèle, en définissant son comportement, ses limites, et même sa “personnalité”. Son efficacité dépend de sa formulation et des spécificités du modèle.