Table des matières

AI Coding

Coder avec une IA LLM.

Explications:

Autres pages:

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

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

Pour de l'assistance au code avec un GPU 16Go

Plan de test de comparaison :

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 ?

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

Avec 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/ /

et aussi

export PATH=$PATH:/usr/local/cuda-13.0/bin/

Ensuite une très très longue compilation :

DCMAKE_CUDA_ARCHITECTURES: 86 pour RTX 3060 et 120 pour RTX 5060.

# CUDA GPU Compute Capability https://developer.nvidia.com/cuda-gpus
# RTX 3060 : 86
# RTX 5060 : 120
$ cmake -B build -DGGML_CUDA=ON -DCMAKE_CUDA_ARCHITECTURES="86;120" \
 -DCMAKE_CUDA_COMPILER=/usr/local/cuda-12.9/bin/nvcc -DCMAKE_INSTALL_RPATH="/usr/local/cuda-12.9/lib64;\$ORIGIN" -DCMAKE_BUILD_WITH_INSTALL_RPATH=ON

-- 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

$ cmake --build build --config Release

...
real	44m35,149s
user	42m38,100s
sys	1m51,594s

ollama

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

Chat & build with open models

koboldcpp

https://github.com/LostRuins/koboldcpp

vllm

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/

Coding assistant

Agentic Capabilities LLMs.

continue

https://docs.continue.dev/

Claude code

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

opencode

Les prompts system:

😩 Attention au contenu du fichier configuration opencode.json, la moindre erreur n'est pas signalée, mais pose des problèmes.

Essais de models

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

Modèles essayés avec opencode.

cline

codex-cli

Par OpenAi

Tabby

Contient le serveur de model qu'il faut installer.

Gemini CLI

LLxprt Code

Windsurf

Amp Free

MCP server

Articles:

Serena

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

system message

Exemple de system message pour un chatbot: