llama-cpp
Skill40 starsChanged 8 months agoMITView on GitHub
Run GGUF models directly, load LoRA adapters, benchmark inference speed, and serve models via llama-server using llama.cpp. Includes Qwen 3.5 serve scripts (9B dense + F16, 35B MoE) with asymmetric KV cache and thinking mode. Secondary to Ollama; use when needing direct model control or LoRA hot-loading. Triggers on 'llama.cpp', 'GGUF', 'LoRA adapter', 'benchmark inference', 'llama-server'.
- Installs packages
9 other projects use a version of this.
Adopted by
Most recently taken up by
- rakaarwaky/agents-arwakytheir own version, first seen Oct 6, 2026
- delorenj/skillstheir own version, first seen Oct 2, 2026
- Samin12/skillstheir own version, first seen Aug 14, 2026
- magnus919/agent-skillstheir own version, first seen Jul 21, 2026
- wm2313/my-skillstheir own version, first seen Jul 2, 2026
- maystudios/claude-skillstheir own version, first seen Apr 28, 2026
Other versions9 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 9
- AlexAI-MCP/hermes-CCC★ 135same name
- magnus919/agent-skills★ 109same name
- maystudios/claude-skills★ 24same name
- delorenj/skills★ 15same name
- Samin12/skills★ 9same name
- Kubementat/ai_agent_skills★ 2same name
- Clay-HHK/claude-skills★ 1same name
- rakaarwaky/agents-arwaky★ 0same name
- wm2313/my-skills★ 0same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository99 other files it gives its agents.
- CLAUDE.mdCLAUDE.md
- agents-md-managerSkill
- architecture-md-builderSkill
- autoresearchSkill
- claude-agent-sdkSkill
- claude-md-managerSkill
- claude-usageSkill
- dag-typesafeSkill
- fableSkill
- glossarySkill
- openrouter-usageSkill
- react-best-practicesSkill
- skill-optimizerSkill
- stop-slopSkill
- tamarruSkill
- test-harness-auditorSkill
- user-model-builderSkill
- atmosphere-shaderSkill
- component-gallerySkill
- conductor-motionSkill
- design-auditSkill
- design-critiqueSkill
- design-mdSkill
- design-polishSkill
- gemini-claude-resonanceSkill
- gemini-forgeSkill
- gpt-atelierSkill
- grainientSkill
- image-forgeSkill
- image-wellSkill
- meshySkill
- mindnode-uiSkill
- minoan-frontend-designSkill
- nano-banana-proSkill
- overwatch-slidedeckSkill
- paper-designSkill
- particle-swarm-simSkill
- pellicolaSkill
- photo-to-slack-emojiSkill
- pretextSkill
- recordlySkill
- rocaille-shaderSkill
- scroll-cinemaSkill
- shadcnSkill
- shapeSkill
- smolvlmSkill
- speak-responseSkill
- sprite-forgeSkill
- threejs-particle-canvasSkill
- vellum-editorialSkill
- webgpu-threejs-tslSkill
- agent-browserSkill
- beautiful-mermaidSkill
- classical-887Skill
- claude-peersSkill
- cloudflareSkill
- codex-ctoSkill
- codex-orchestratorSkill
- disc-forgeSkill
- figma-mcpSkill
- The first 60 shown.
The file
We split this skill into the rules it gives an agent
2 rules. 0 are common, 1 is distinctive, and 1 is very specific to this project.
0
Common
Most of the 7 edited versions we read keep these.
1
Distinctive
This author's own choices. Worth a look.
1
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 157
When calling llama-cli from scripts or subprocesses:
- Very specific: line 161
Use
--n-gpu-layers all: instead of legacy -ngl 999
“Common” is measured: kept by at least 6 in 10 of the 7 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
llama.cpp - Secondary Inference Engine
Direct access to llama.cpp for faster inference, LoRA adapter loading, and benchmarking on Apple Silicon. Ollama remains primary for RLAMA and general use; llama.cpp is the power tool.
Prerequisites
brew install llama.cppBinaries: llama-cli, llama-server, llama-embedding, llama-quantize
Quick Reference
Resolve Ollama Model to GGUF Path
To avoid duplicating model files, resolve an Ollama model name to its GGUF blob path:
~/.claude/skills/llama-cpp/scripts/ollama_model_path.sh qwen2.5:7bRun Inference
GGUF=$(~/.claude/skills/llama-cpp/scripts/ollama_model_path.sh qwen2.5:7b)
llama-cli -m "$GGUF" -p "Your prompt here" -n 128 --n-gpu-layers all --single-turn --simple-io --no-display-promptStart API Server
To start an OpenAI-compatible server (port 8081, avoids Ollama's 11434):
~/.claude/skills/llama-cpp/scripts/llama_serve.sh <model.gguf>
# Or with options:
PORT=8082 CTX=8192 ~/.claude/skills/llama-cpp/scripts/llama_serve.sh <model.gguf>Test the server:
curl http://localhost:8081/v1/chat/completions \
-H "Content-Type: application/json" \
-d '{"model":"default","messages":[{"role":"user","content":"Hello"}]}'Serve Qwen3.5
Dedicated servers for Qwen3.5 models with asymmetric KV cache, jinja templates, and thinking mode.
9B Dense (recommended for 24-36GB systems):
# Default: Qwen3.5-9B, thinking mode, 32K context
~/.claude/skills/llama-cpp/scripts/llama_serve_qwen35_9b.sh
# Full precision F16 (~17.9 GB, zero quantization loss)
~/.claude/skills/llama-cpp/scripts/llama_serve_qwen35_9b.sh ~/models/Qwen3.5-9B-BF16.gguf
# Non-thinking mode, shorter context
THINK=0 CTX=8192 ~/.claude/skills/llama-cpp/scripts/llama_serve_qwen35_9b.sh35B MoE (for 64+ GB systems):
~/.claude/skills/llama-cpp/scripts/llama_serve_qwen35.sh # defaults to qwen3.5:35b-a3b9B Q4 uses ~6.6 GB (ample headroom); F16 uses ~17.9 GB (fits with 32K context on 36GB). Asymmetric KV cache (q8_0 keys + q4_0 values) saves ~60% KV memory vs FP16 cache.
F16 (Full Precision) Mode
For maximum quality (zero quantization loss), download and serve the BF16 GGUF:
# Download once (~17.9 GB)
huggingface-cli download unsloth/Qwen3.5-9B-GGUF "Qwen3.5-9B-BF16.gguf" --local-dir ~/models
# Serve F16
~/.claude/skills/llama-cpp/scripts/llama_serve_qwen35_9b.sh ~/models/Qwen3.5-9B-BF16.ggufF16 vs Q4 on M4 Max 36GB:
| Q4_K_M (default) | BF16 (F16) | |
| Size | 6.6 GB | 17.9 GB |
| Speed | ~38 tok/s | ~8-12 tok/s |
| Quality | ~99.5% | 100% (reference) |
| Max context | 262K | ~32K comfortable |
Benchmark (llama.cpp vs Ollama)
~/.claude/skills/llama-cpp/scripts/llama_bench.sh qwen2.5:7bReports prompt processing and generation tok/s for both engines side by side.
LoRA Adapter Inference
Load a LoRA adapter dynamically on top of a base GGUF model (no merge required):
~/.claude/skills/llama-cpp/scripts/llama_lora.sh <base.gguf> <lora.gguf> "Your prompt"This is the key advantage over Ollama: hot-swap LoRA adapters without rebuilding models.
Convert Kothar LoRA to GGUF
Convert HuggingFace LoRA adapters from the Kothar training pipeline into a merged GGUF model:
python3 ~/.claude/skills/llama-cpp/scripts/convert_lora_to_gguf.py \
--base NousResearch/Hermes-2-Mistral-7B-DPO \
--lora <path-or-hf-id> \
--output kothar-q4_k_m.gguf \
--quantize q4_k_mWhen to Use llama.cpp vs Ollama
| Task | Use |
| RLAMA queries | Ollama (native integration) |
| Quick model chat | Ollama (ollama run) |
| LoRA adapter testing | llama.cpp (llama_lora.sh) |
| Benchmarking tok/s | llama.cpp (llama_bench.sh) |
| Maximum inference speed | llama.cpp (10-20% faster) |
| Custom server config | llama.cpp (llama_serve.sh) |
| Embedding generation | Either (Ollama simpler, llama-embedding more control) |
| Kothar GGUF conversion | llama.cpp (convert_lora_to_gguf.py) |
Architecture
Ollama (primary, port 11434) llama.cpp (secondary, port 8081)
├── RLAMA RAG queries ├── LoRA adapter hot-loading
├── Model management (pull/list) ├── Benchmarking
├── General chat ├── Custom server configs
└── Embeddings (nomic-embed-text) └── Kothar GGUF conversion
Both share the same GGUF model files (~/.ollama/models/blobs/)Subprocess Best Practices (Build 8180+)
When calling llama-cli from scripts or subprocesses:
- Always use
--single-turn— generates one response then exits (prevents interactive chat mode hang) - Always use
--simple-io— suppresses ANSI spinner that floods redirected output - Always use
--no-display-prompt— suppresses prompt echo - Use
--n-gpu-layers allinstead of legacy-ngl 999 - Use
--flash-attn on(not bare--flash-attn) — now takes argument - Timing stats appear in stdout as
[ Prompt: X t/s | Generation: Y t/s ](via--show-timings, default: on) - Redirect stderr to file, not variable — spinner output can overflow bash variables
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

