alexai-mcp/hermes-ccc/llama-cpp
Claude Code and agent skill by alexai-mcp/hermes-ccc
Trust tier 2
- community
Source check pending
Checking that the SKILL.md file is still in the repository.
Run quantized LLMs locally with llama.cpp — CPU+GPU inference, GGUF format, OpenAI-compatible server, and Python bindings.
Install
npx vskill@latest install alexai-mcp/hermes-ccc/llama-cppSKILL.md
llama.cpp
Purpose
- Use this skill to run quantized GGUF models on laptops, workstations, and edge systems.
- Prefer it when you need portable local inference without a heavyweight serving stack.
llama.cppis especially useful for CPU-first deployments, low-cost GPU offload, and offline workflows.- Python users typically access it through
llama-cpp-python.
Install
- Fastest path for Python users:
- Build from source when you need custom acceleration backends or tighter platform control.
- Source builds are common for CUDA, Metal, ROCm, Vulkan, and CPU-tuned environments.
- Confirm the package imports successfully:
Model Format
llama.cppprimarily uses theGGUFmodel format.- GGUF packages tokenizer metadata, architecture settings, and quantized weights in one artifact.
- Choose a GGUF variant that matches your hardware budget and quality target.
Download GGUF Models
- Hugging Face is the standard source for GGUF checkpoints.
- Common repos include:
bartowski/*TheBloke/*
- Typical examples:
bartowski/Llama-3.1-8B-Instruct-GGUFTheBloke/Mistral-7B-Instruct-v0.2-GGUFbartowski/Qwen2.5-7B-Instruct-GGUF
- Store the downloaded file locally, for example:
models/llama-3.1-8b-instruct-q4_k_m.gguf
Quantization Levels
Q4_K_M: best balance for many local deploymentsQ5_K_M: more quality, more RAM or VRAMQ8_0: highest quality among common quantized optionsQ2_K: very small, but quality drops sharply
- Start with
Q4_K_Munless you already know the task is quality-sensitive. - Move to
Q5_K_MorQ8_0for coding, reasoning, or long-form generation where quality matters more. - Use
Q2_Konly for extreme memory constraints or experiments.
Basic Python Usage
Important Init Parameters
model_path: path to the.gguffile on diskn_gpu_layers: number of transformer layers to offload to GPUn_ctx: context size, constrained by the model and available memoryn_threads: CPU worker threads for prompt processing and generation
- These four parameters are the first tuning knobs to adjust for almost every deployment.
Initialization Guidance
- Keep
model_pathon a local SSD when possible. - Set
n_threadsclose to the number of performant CPU cores, not necessarily total logical threads. - Increase
n_ctxonly after checking memory pressure. - Increase
n_gpu_layersgradually if the model fails to load or performance is unstable.
Generation Call
- Basic call shape:
- Access the text with:
- Keep
max_tokensbounded for interactive usage. - Use lower temperatures for summarization, extraction, and tool-style tasks.
Chat Format
- For instruction-tuned models, prefer the chat API:
- Use the chat API when the model card says the checkpoint is chat-tuned or instruct-tuned.
- Keep prompt templates aligned with the model family if outputs seem malformed.
Streaming Output
- Stream tokens for responsive CLI or web applications:
- Streaming is useful for chat UIs, terminals, and server-sent event bridges.
GPU Offload
n_gpu_layers=-1means full GPU offload when supported by the backend and hardware.- You can also offload only the first
Nlayers:
- If full offload fails, try a partial value like
20,30, or40. - Partial offload is common on consumer GPUs with limited VRAM.
CPU-Only Example
- CPU-only mode is viable for smaller models and latency-tolerant tasks.
- It is a good fit for offline assistants, batch summarization, and test environments.
Context Size
n_ctxcontrols the context window in tokens.- Larger values increase RAM or VRAM usage.
- The effective maximum depends on the model architecture, quantization, and rope scaling setup.
- Do not assume every GGUF file supports the same long context as the original FP16 checkpoint.
Context Sizing Rule of Thumb
- Start with
4096or8192. - Increase only after verifying memory headroom and prompt quality.
- Very large
n_ctxvalues can degrade throughput significantly.
OpenAI-Compatible Server
llama-cpp-pythonincludes a server mode:
- More realistic example:
- This is useful for local OpenAI-style integrations, prototypes, and thin service wrappers.
- It is not as throughput-optimized as vLLM, but it is easy to run and distribute.
OpenAI Client Compatibility
- Many local clients can target the server with an OpenAI-compatible base URL:
Build From Source
- Build from source when:
- you need CUDA acceleration not available in your wheel
- you want Metal on macOS
- you need a specific compiler or backend flag
- you are packaging for a controlled deployment target
- Source builds take more effort but often deliver better hardware utilization.
Model Families Commonly Used With GGUF
- Llama
- Qwen
- Mistral
- Phi
- Gemma
- Check the prompt format and tokenizer notes for each family before deploying.
Operational Tips
- Keep a naming convention that encodes model, size, and quantization.
- Store models outside the repo if they are large.
- Benchmark both prompt evaluation speed and generation speed.
- Use the smallest model that meets quality targets.
- Prefer chat-tuned checkpoints for agentic or assistant workloads.
Common Errors
- Model will not load:
- verify
model_path - verify the file is a GGUF checkpoint
- verify the quantization is supported by your build
- Very slow generation:
- increase
n_threads - enable GPU offload
- reduce
n_ctx - use a smaller model
- Out-of-memory:
- reduce
n_ctx - choose
Q4_K_Minstead ofQ8_0 - reduce
n_gpu_layersor use CPU-only mode
- Bad chat formatting:
- use
create_chat_completion - verify the checkpoint is instruct-tuned
- check whether the model expects a specific chat template
When To Use This Skill
- You need fully local inference with minimal infrastructure.
- You want a portable inference path for laptops or edge devices.
- You are testing GGUF quantizations before wider deployment.
- You need CPU inference or partial GPU offload instead of a GPU-only server.
Quick Reference
- Install:
pip install llama-cpp-python - Source build: use when you need custom acceleration
- Load model:
from llama_cpp import Llama - Key params:
model_path,n_gpu_layers,n_ctx,n_threads - Generate:
llm("prompt", max_tokens=256, temperature=0.7) - Chat:
llm.create_chat_completion(messages=[...]) - Server:
python -m llama_cpp.server --model model.gguf - Best balance quant:
Q4_K_M - Full GPU offload:
n_gpu_layers=-1
Security
- Security scanPassed, 100 of 100Pattern checks on the skill's files.
- Model reviewNot runA model review is scheduled for the next rescan.
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingskills/llama-cpp/SKILL.md
Popularity
- 7-day trend score
- 0
Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/alexai-mcp/hermes-ccc/llama-cpp)