Agent skill

Llama Cpp

by AlexAI-MCP in AlexAI-MCP/hermes-CCC

Run quantized LLMs locally with llama.cpp — CPU+GPU inference, GGUF format, OpenAI-compatible server, and Python bindings.

MITAuto-check passedAI & LLM Engineering

Install Llama Cpp

skills CLI
$ npx skills add AlexAI-MCP/hermes-CCC --skill llama-cpp -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install AlexAI-MCP/hermes-CCC llama-cpp --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/AlexAI-MCP/hermes-CCC.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills/llama-cpp .claude/skills/llama-cpp && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
llama-cpp
GitHub stars
135
Token cost
~2.3k tokens
SKILL.md length
867 words
Files
1
Skills in repo
44
Repo updated
First seen
Licence
MIT

At a glance

Run quantized LLMs locally with llama.cpp — CPU+GPU inference, GGUF format, OpenAI-compatible server, and Python bindings.

  • Tasks that involve LLM inference and serving
  • SKILL.md covers Purpose, Install, Model Format and Download GGUF Models, plus 19 more sections
  • Calls python and pip

What it does

Llama Cpp is an agent skill from AlexAI-MCP/hermes-CCC. Run quantized LLMs locally with llama.cpp — CPU+GPU inference, GGUF format, OpenAI-compatible server, and Python bindings.

Its SKILL.md is about 2.3k tokens, which your agent loads only when the skill is triggered. It is a single SKILL.md file with no bundled scripts.

It sits in AI & LLM Engineering, covering LLM inference and serving. It works with llama.cpp, Python and OpenAI. The repository describes itself as: Hermes Agent ported to Claude Code Channel — 46 native skills, no OAuth, no external process. The licence is MIT.

When your agent uses it

  • Tasks that involve LLM inference and serving

Example prompts

  • “/llama-cpp”

Requirements

  • Python 3

What it can do on your machine

Read from SKILL.md and the folder at commit 8107e89. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Shell commands in SKILL.md call:

    • python
    • pip

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md. Its commands use pip, which can reach the network depending on how they are called.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Llama Cpp loads about 2.3k tokens when it runs. Until then it costs about 33 tokens; SKILL.md has 867 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~33
When it runs · the whole SKILL.md, loaded when a task matches
~2.3k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from AlexAI-MCP/hermes-CCC at commit 8107e89, republished under its MIT licence (© AlexAI-MCP). 867 words, ~2,334 tokens.

Download SKILL.mdSave it as .claude/skills/llama-cpp/SKILL.md (or your agent's skills folder).
name
llama-cpp
description
Run quantized LLMs locally with llama.cpp — CPU+GPU inference, GGUF format, OpenAI-compatible server, and Python bindings.
version
1.0.0
author
hermes-CCC (ported from Hermes Agent by NousResearch)
license
MIT

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.cpp is 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:
bash
pip install llama-cpp-python
  • 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:
bash
python -c "from llama_cpp import Llama; print('ok')"

Model Format

  • llama.cpp primarily uses the GGUF model 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-GGUF

  • TheBloke/Mistral-7B-Instruct-v0.2-GGUF

  • bartowski/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 deployments

  • Q5_K_M: more quality, more RAM or VRAM

  • Q8_0: highest quality among common quantized options

  • Q2_K: very small, but quality drops sharply

  • Start with Q4_K_M unless you already know the task is quality-sensitive.

  • Move to Q5_K_M or Q8_0 for coding, reasoning, or long-form generation where quality matters more.

  • Use Q2_K only for extreme memory constraints or experiments.

Basic Python Usage

python
from llama_cpp import Llama

llm = Llama(
    model_path="models/llama-3.1-8b-instruct-q4_k_m.gguf",
    n_ctx=8192,
    n_threads=8,
    n_gpu_layers=0,
)

output = llm(
    "Explain why GGUF is useful for local inference.",
    max_tokens=256,
    temperature=0.7,
)

print(output["choices"][0]["text"])

Important Init Parameters

  • model_path: path to the .gguf file on disk

  • n_gpu_layers: number of transformer layers to offload to GPU

  • n_ctx: context size, constrained by the model and available memory

  • n_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_path on a local SSD when possible.
  • Set n_threads close to the number of performant CPU cores, not necessarily total logical threads.
  • Increase n_ctx only after checking memory pressure.
  • Increase n_gpu_layers gradually if the model fails to load or performance is unstable.

Generation Call

  • Basic call shape:
python
result = llm(
    "Write a short checklist for running a local LLM service.",
    max_tokens=256,
    temperature=0.7,
)
  • Access the text with:
python
print(result["choices"][0]["text"])
  • Keep max_tokens bounded for interactive usage.
  • Use lower temperatures for summarization, extraction, and tool-style tasks.

Chat Format

  • For instruction-tuned models, prefer the chat API:
python
from llama_cpp import Llama

llm = Llama(
    model_path="models/qwen2.5-7b-instruct-q4_k_m.gguf",
    n_ctx=8192,
    n_gpu_layers=20,
    n_threads=8,
)

response = llm.create_chat_completion(
    messages=[
        {"role": "system", "content": "You are concise and technical."},
        {"role": "user", "content": "List three tradeoffs of 4-bit quantization."},
    ],
    max_tokens=256,
    temperature=0.4,
)

print(response["choices"][0]["message"]["content"])
  • 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:
python
stream = llm.create_chat_completion(
    messages=[
        {"role": "system", "content": "You are concise."},
        {"role": "user", "content": "Describe GPU offload in llama.cpp."},
    ],
    max_tokens=128,
    temperature=0.3,
    stream=True,
)

for chunk in stream:
    delta = chunk["choices"][0].get("delta", {})
    text = delta.get("content")
    if text:
        print(text, end="", flush=True)
  • Streaming is useful for chat UIs, terminals, and server-sent event bridges.

GPU Offload

  • n_gpu_layers=-1 means full GPU offload when supported by the backend and hardware.
  • You can also offload only the first N layers:
python
llm = Llama(
    model_path="models/mistral-7b-instruct-q5_k_m.gguf",
    n_ctx=8192,
    n_threads=8,
    n_gpu_layers=-1,
)
  • If full offload fails, try a partial value like 20, 30, or 40.
  • Partial offload is common on consumer GPUs with limited VRAM.

CPU-Only Example

python
from llama_cpp import Llama

llm = Llama(
    model_path="models/phi-3-mini-q4_k_m.gguf",
    n_ctx=4096,
    n_threads=12,
    n_gpu_layers=0,
)
  • 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_ctx controls 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.
Show full SKILL.md (356 more words)Show less

Context Sizing Rule of Thumb

  • Start with 4096 or 8192.
  • Increase only after verifying memory headroom and prompt quality.
  • Very large n_ctx values can degrade throughput significantly.

OpenAI-Compatible Server

  • llama-cpp-python includes a server mode:
bash
python -m llama_cpp.server --model model.gguf
  • More realistic example:
bash
python -m llama_cpp.server \
  --model models/llama-3.1-8b-instruct-q4_k_m.gguf \
  --host 0.0.0.0 \
  --port 8000 \
  --n_ctx 8192
  • 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:
python
from openai import OpenAI

client = OpenAI(
    api_key="dummy",
    base_url="http://localhost:8000/v1",
)

resp = client.chat.completions.create(
    model="local-model",
    messages=[
        {"role": "system", "content": "You are concise."},
        {"role": "user", "content": "Summarize Q4_K_M vs Q8_0."},
    ],
    max_tokens=128,
)

print(resp.choices[0].message.content)

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_M instead of Q8_0

  • reduce n_gpu_layers or 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

© AlexAI-MCP, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

Just SKILL.md in skills/llama-cpp of AlexAI-MCP/hermes-CCC.

Open the folder on GitHubat commit 8107e89

Compare with similar skills

Llama Cpp next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Llama Cpp compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Llama Cpp this skillAlexAI-MCP/hermes-CCC135—~2.3kAutomated safety check: PassMIT
Litellmmagnus919/agent-skills113—~4.2kAutomated safety check: NotesMIT
Llama Cppmagnus919/agent-skills113—~2.3kAutomated safety check: PassMIT
Aider DelegateamElnagdy/delegate-skills2.3k3 repos~3kAutomated safety check: PassMIT
Qwen Mtp GgufR6410418/Jackrong-llm-finetuning-guide1.7k—~1.7kAutomated safety check: PassMIT
Model Serving MinefieldBlackwellboy/model-serving-minefield135—~2.1kAutomated safety check: PassMIT

Similar skills

  • Litellm

    magnus919/agent-skills

    Operate, configure, secure, and troubleshoot the LiteLLM AI gateway (proxy) and Python SDK: run the proxy (litellm --config), route to 100+ providers through one OpenAI-compatible API, configure…

    113 GitHub stars~4.2k tokensUpdated yesterday
    AI & LLM EngineeringAuto-check: notes
  • Llama Cpp

    magnus919/agent-skills

    Operate, configure, benchmark, and troubleshoot llama.cpp across CPU, Metal, CUDA, HIP/ROCm, Vulkan, SYCL, and hybrid or multi-GPU systems.

    113 GitHub stars~2.3k tokensUpdated yesterday
    AI & LLM EngineeringAuto-check passed
  • Aider Delegate

    amElnagdy/delegate-skills

    Delegate a coding task to Aider (aider) as a background implementer, then review its diff and land it yourself.

    2.3k GitHub starsUsed in 3 repos~3k tokens
    AI & LLM EngineeringAuto-check passed
  • Qwen Mtp Gguf

    R6410418/Jackrong-llm-finetuning-guide

    Complete agent-ready workflow for Qwen-family MTP or nextn GGUF conversion and release.

    1.7k GitHub stars~1.7k tokensUpdated 2 mo ago
    AI & LLM EngineeringAuto-check passed
  • Model Serving Minefield

    Blackwellboy/model-serving-minefield

    Diagnose OpenAI-compatible model-serving failures from symptoms, endpoint reports, explicit configuration files, or logs while preserving evidence status and requiring confirm/refute checks.

    135 GitHub stars~2.1k tokensUpdated today
    AI & LLM EngineeringAuto-check passed
  • Outlines Structured Generation

    Orchestra-Research/AI-Research-SKILLs

    Uses the Outlines library to constrain model output to a JSON schema, Pydantic model, regex or fixed set of choices when running local models.

    13k GitHub starsUsed in 10 repos~4k tokens
    AI & LLM EngineeringAuto-check passed

More from AlexAI-MCP/hermes-CCC

All 44 skills in this repo
  • GitHub Code Review

    AlexAI-MCP/hermes-CCC

    Review GitHub pull requests with a findings-first engineering mindset.

    135 GitHub stars~1.3k tokensUpdated 6 mo ago
    Auto-check passed
  • GitHub PR Workflow

    AlexAI-MCP/hermes-CCC

    Run a disciplined GitHub pull request workflow from branch creation through merge.

    135 GitHub stars~1.4k tokensUpdated 6 mo ago
    Auto-check passed
  • Hermes Memory

    AlexAI-MCP/hermes-CCC

    Manage durable project memory for Claude Code. An agent skill from AlexAI-MCP/hermes-CCC.

    135 GitHub stars~1.7k tokensUpdated 6 mo ago
    Auto-check passed
  • Hermes Route

    AlexAI-MCP/hermes-CCC

    Route Claude Code work by complexity, risk, and tool needs. An agent skill from AlexAI-MCP/hermes-CCC.

    135 GitHub stars~1.9k tokensUpdated 6 mo ago
    Auto-check passed
  • Hermes Skill

    AlexAI-MCP/hermes-CCC

    Create, improve, inventory, and audit Claude Code skills. An agent skill from AlexAI-MCP/hermes-CCC.

    135 GitHub stars~1.7k tokensUpdated 6 mo ago
    Auto-check passed
  • Hermes Traj

    AlexAI-MCP/hermes-CCC

    Capture Claude Code interaction trajectories in training-friendly formats.

    135 GitHub stars~1.6k tokensUpdated 6 mo ago
    Auto-check passed

Questions about Llama Cpp

What does Llama Cpp do?

Run quantized LLMs locally with llama.cpp — CPU+GPU inference, GGUF format, OpenAI-compatible server, and Python bindings. Llama Cpp is an agent skill from AlexAI-MCP/hermes-CCC.cpp — CPU+GPU inference, GGUF format, OpenAI-compatible server, and Python bindings.

When should I use Llama Cpp?

Llama Cpp fits situations like: tasks that involve LLM inference and serving.

How do I install Llama Cpp in Claude Code?

Run `npx skills add AlexAI-MCP/hermes-CCC --skill llama-cpp -a claude-code`. Or copy the skill folder (skills/llama-cpp in AlexAI-MCP/hermes-CCC) into .claude/skills/llama-cpp in your project. Claude Code loads it when a task matches its description.

How do I install Llama Cpp in Codex?

Run `npx skills add AlexAI-MCP/hermes-CCC --skill llama-cpp -a codex`. Or copy the skill folder (skills/llama-cpp in AlexAI-MCP/hermes-CCC) into .agents/skills/llama-cpp in your project. Codex loads it when a task matches its description.

Can I use Llama Cpp in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add AlexAI-MCP/hermes-CCC --skill llama-cpp -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/llama-cpp, .gemini/skills/llama-cpp, .github/skills/llama-cpp and .opencode/skills/llama-cpp in your project.

What does Llama Cpp need to run?

Going by SKILL.md and its folder, Llama Cpp needs the command-line tools its instructions call (python and pip). Our summary lists: Python 3.

Does Llama Cpp access the network?

SKILL.md contains no URLs. Its commands use pip, which can reach the network depending on how they are called. This is read from the text; nothing was executed.

Is Llama Cpp safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Llama Cpp use?

Llama Cpp is published under the MIT licence (declared in SKILL.md). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Llama Cpp use?

About 2.3k tokens (SKILL.md is roughly 9.3k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Llama Cpp?

Skills that share tags, products or a category with Llama Cpp: Litellm (magnus919/agent-skills, 113 stars), Llama Cpp (magnus919/agent-skills, 113 stars), Aider Delegate (amElnagdy/delegate-skills, 2.3k stars) and Qwen Mtp Gguf (R6410418/Jackrong-llm-finetuning-guide, 1.7k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Llama Cpp?

AlexAI-MCP (a GitHub user) maintains it in AlexAI-MCP/hermes-CCC, which has 135 GitHub stars. The repository holds 44 skills in this directory. The repository was last updated on April 8, 2026.

Source: AlexAI-MCP/hermes-CCC on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.