LLM Notes¶
This guide is a work in progress.
The models and commands below reflect my personal setup.
A collection of notes and configuration snippets for running large language models locally, covering installation, model serving, and integration with coding agents and editors.
llama.cpp¶
Install via Homebrew:
Pre-built binaries are also available from the GitHub releases page.
Install via WinGet:
Pre-built binaries are also available from the GitHub releases page.
See the official build instructions.
Pre-built binaries are also available from the GitHub releases page.
Router Mode¶
Router Mode allows you to serve multiple models with on-demand loading and unloading, with speculative decoding to improve inference speed. See the llama.cpp Router Mode documentation for more details.
Models must be available first.
Models must be downloaded before they can be served by the router. See Models for the commands which will download the models.
models.ini
[*]
ctx-size = 65536
flash-attn = on
load-mode = none
no-mmproj = true
[ggml-org/gemma-4-26B-A4B-it-GGUF:Q4_0]
alias = gemma4-26b-a4b-it-qat
no-reasoning-preserve = true
[ornith-ai/Ornith-1.5-35B-A3B-GGUF:Q4_K_M]
alias = ornith-1.5-35b-a3b
spec-type = draft-mtp
[ggml-org/Qwen3.6-35B-A3B-GGUF:Q4_K_M]
alias = qwen3.6-35b-a3b
spec-type = draft-mtp
[unsloth/Qwen3-Coder-30B-A3B-Instruct-GGUF:Q4_K_M]
alias = qwen3-coder-30b-a3b-instruct
llama serve --cors-origins localhost \
--sleep-idle-seconds 300 \
--models-max 1 \
--models-preset models.ini
| Argument | Explanation |
|---|---|
--cors-origins |
comma-separated list of allowed origins for CORS (default: *) |
--sleep-idle-seconds |
number of seconds of idleness after which the server will sleep |
--models-max |
for router server, maximum number of models to load simultaneously |
--models-preset |
path to INI file containing model presets for the router server |
For the full server options and flags reference, see the llama.cpp server documentation.
Ollama¶
To install Ollama, run the following command:
Or download the installer from https://ollama.com/download/mac.
To install Ollama, run the following command in PowerShell:
Or download the installer from https://ollama.com/download/windows.
Models¶
Gemma-4-26B-A4B-IT¶
https://blog.google/innovation-and-ai/technology/developers-tools/gemma-4/
Download model:
Download and serve model:
Ornith-1.5-35B-A3B¶
https://ornith.ai/ornith_1_5.html
Download model:
Download and serve model:
Qwen3.6-35B-A3B¶
https://qwen.ai/blog?id=qwen3.6-35b-a3b
Download model:
Download and serve model:
Qwen3-Coder-30B-A3B-Instruct¶
https://qwen.ai/blog?id=qwen3-coder
Download model:
Download and serve model:
Coding Agents¶
Tip
You can change the model name for both Copilot and Claude by updating the value passed to --model in the commands below.
Copilot CLI¶
https://github.com/features/copilot/cli
Claude Code¶
https://code.claude.com/docs/en/overview
Pi¶
The llama.cpp extension auto-discovers models from a running llama.cpp server and registers them as the llama-cpp provider in pi.
Pi also supports the llama.cpp router server. The router discovers multiple GGUF models and loads or unloads them on demand. See the llama.cpp documentation for more details.
OpenCode¶
~/.config/opencode/opencode.json
{
"$schema": "https://opencode.ai/config.json",
"provider": {
"llama.cpp": {
"npm": "@ai-sdk/openai-compatible",
"name": "llama-server (local)",
"options": {
"baseURL": "http://127.0.0.1:8080/v1"
},
"models": {
"gemma4-26b-a4b-it-qat": {
"name": "gemma4-26b-a4b-it-qat",
"limit": {
"context": 65536,
"output": 8192
}
}
}
}
}
}
Adding more models.
Add model objects to the models section with the model ID as key and update the name and limit properties as needed.
OpenCode probes http://127.0.0.1:11434, discovers completion models, and adds them to /models without an account connection.
See the Ollama provider documentation for more details.
IDEs & Editors¶
VSCode¶
The Custom Endpoint provider lets you connect any compatible API endpoint to chat in VS Code. See the language models documentation for more details.
Model configuration file location:
~/Library/Application Support/Code/User/chatLanguageModels.json
%appdata%\Code\User\chatLanguageModels.json
~/.config/Code/User/chatLanguageModels.json
[
{
"name": "llama.cpp",
"vendor": "customendpoint",
"models": [
{
"id": "gemma4-26b-a4b-it-qat",
"name": "gemma4-26b-a4b-it-qat",
"url": "http://localhost:8080/v1",
"toolCalling": true,
"vision": false,
"thinking": true,
"contextWindow": 65536,
"maxOutputTokens": 8192
}
]
}
]
Adding more models.
Copy the model object and update the id and name.
The Ollama extension adds models from your running Ollama server to the VS Code model picker.