llama-cpp
Was er macht
Hier werden quantisierte Sprachmodelle auf deiner eigenen Hardware mit llama.cpp betrieben, von CPUs über Apple Silicon bis zu GPUs. Der Skill ist für Menschen gedacht, die lokale KI-Modelle wollen und Hilfe bei der richtigen Dateigröße brauchen.
Wann du ihn nutzt
- ✓Wenn du ein Sprachmodell auf deinem eigenen Rechner ohne Cloud-Dienst laufen lassen willst.
- ✓Wenn du eine GGUF-Datei wählen musst, die in deinen Arbeitsspeicher oder Grafikspeicher passt.
- ✓Wenn du einen Befehl llama-server oder llama-cli aus einem Hugging-Face-Repo erstellen willst.
Link zum Skill
https://github.com/NousResearch/hermes-agent/blob/main/optional-skills/mlops/inference/llama-cpp/SKILL.mdKopiere ihn und füge ihn in deine KI ein (Claude, ChatGPT oder Cursor) mit der Bitte, den Anweisungen zu folgen.
So nutzt du ihn
Am einfachsten: Kopiere die Nachricht und füge sie in deine KI ein. Sie liest den Skill und folgt den Anweisungen.
Fertige Nachricht zum Einfügen
Für Claude Code, Codex oder Cursor: Führe den Befehl in deinem Projektordner aus, dann wird der Skill installiert.
Lade die SKILL.md herunter und lege sie in den Skills-Ordner deines Agenten.
Beispielanfrage an deine KI
“Finde eine GGUF-Version eines kleinen Chat-Modells, die auf meinen Laptop mit 16 GB RAM passt, und gib mir den Befehl zum Starten.”
5 neue Skills pro Woche. 1 Minute Lesezeit.
So funktioniert es
Der Agent sucht auf Hugging Face nach llama.cpp-kompatiblen Repos, liest die lokale App-Seite des Repos und wählt eine Quantisierung, die zu deinem Speicher passt. Danach gibt er dir den genauen Befehl llama-server oder llama-cli.
Technischer Inhalt (originale SKILL.md)
Originaltext des Autors, auf Englisch, direkt von GitHub.
llama.cpp + GGUF
Use this skill for local GGUF inference, quant selection, or Hugging Face repo discovery for llama.cpp.
When to use
- Run local models on CPU, Apple Silicon, CUDA, ROCm, or Intel GPUs
- Find the right GGUF for a specific Hugging Face repo
- Build a
llama-serverorllama-clicommand from the Hub - Search the Hub for models that already support llama.cpp
- Enumerate available
.gguffiles and sizes for a repo - Decide between Q4/Q5/Q6/IQ variants for the user's RAM or VRAM
Model Discovery workflow
Prefer URL workflows before asking for hf, Python, or custom scripts.
- Search for candidate repos on the Hub:
- Base:
https://huggingface.co/models?apps=llama.cpp&sort=trending - Add
search=<term>for a model family - Add
num_parameters=min:0,max:24Bor similar when the user has size constraints
- Base:
- Open the repo with the llama.cpp local-app view:
https://huggingface.co/<repo>?local-app=llama.cpp
- Treat the local-app snippet as the source of truth when it is visible:
- copy the exact
llama-serverorllama-clicommand - report the recommended quant exactly as HF shows it
- copy the exact
- Read the same
?local-app=llama.cppURL as page text or HTML and extract the section underHardware compatibility:- prefer its exact quant labels and sizes over generic tables
- keep repo-specific labels such as
UD-Q4_K_MorIQ4_NL_XL - if that section is not visible in the fetched page source, say so and fall back to the tree API plus generic quant guidance
- Query the tree API to confirm what actually exists:
https://huggingface.co/api/models/<repo>/tree/main?recursive=true- keep entries where
typeisfileandpathends with.gguf - use
pathandsizeas the source of truth for filenames and byte sizes - separate quantized checkpoints from
mmproj-*.ggufprojector files andBF16/shard files - use
https://huggingface.co/<repo>/tree/mainonly as a human fallback
- If the local-app snippet is not text-visible, reconstruct the command from the repo plus the chosen quant:
- shorthand quant selection:
llama-server -hf <repo>:<QUANT> - exact-file fallback:
llama-server --hf-repo <repo> --hf-file <filename.gguf>
- shorthand quant selection:
- Only suggest conversion from Transformers weights if the repo does not already expose GGUF files.
Quick start
Install llama.cpp
# macOS / Linux (simplest)
brew install llama.cpp
winget install llama.cpp
git clone https://github.com/ggml-org/llama.cpp
cd llama.cpp
cmake -B build
cmake --build build --config Release
Run directly from the Hugging Face Hub
llama-cli -hf bartowski/Llama-3.2-3B-Instruct-GGUF:Q8_0
llama-server -hf bartowski/Llama-3.2-3B-Instruct-GGUF:Q8_0
Run an exact GGUF file from the Hub
Use this when the tree API shows custom file naming or the exact HF snippet is missing.
llama-server \
--hf-repo microsoft/Phi-3-mini-4k-instruct-gguf \
--hf-file Phi-3-mini-4k-instruct-q4.gguf \
-c 4096
OpenAI-compatible server check
curl http://localhost:8080/v1/chat/completions \
-H "Content-Type: application/json" \
-d '{
"messages": [
{"role": "user", "content": "Write a limerick about Python exceptions"}
]
}'
Python bindings (llama-cpp-python)
pip install llama-cpp-python (CUDA: CMAKE_ARGS="-DGGML_CUDA=on" pip install llama-cpp-python --force-reinstall --no-cache-dir; Metal: CMAKE_ARGS="-DGGML_METAL=on" ...).
Basic generation
from llama_cpp import Llama
llm = Llama(
model_path="./model-q4_k_m.gguf",
n_ctx=4096,
n_gpu_layers=35, # 0 for CPU, 99 to offload everything
n_threads=8,
)
out = llm("What is machine learning?", max_tokens=256, temperature=0.7)
print(out["choices"][0]["text"])
Chat + streaming
llm = Llama(
model_path="./model-q4_k_m.gguf",
n_ctx=4096,
n_gpu_layers=35,
chat_format="llama-3", # or "chatml", "mistral", etc.
)
resp = llm.create_chat_completion(
messages=[
{"role": "system", "content": "You are a helpful assistant."},
{"role": "user", "content": "What is Python?"},
],
max_tokens=256,
)
print(resp["choices"][0]["message"]["content"])
# Streaming
for chunk in llm("Explain quantum computing:", max_tokens=256, stream=True):
print(chunk["choices"][0]["text"], end="", flush=True)
Embeddings
llm = Llama(model_path="./mo
Häufige Fragen
Was sind Quantisierungen?
Komprimierte Versionen eines Modells, etwa Q4 oder Q5, die weniger Speicher brauchen, dafür mit etwas Qualitätsverlust.
Welche Hardware wird unterstützt?
Der Skill nennt CPU, Apple Silicon, CUDA, ROCm und Intel-GPUs.
Kann es nach Modellen suchen?
Ja. Es durchsucht den Hugging-Face-Hub nach Modellen, die bereits mit llama.cpp funktionieren.
Details
Originalbeschreibung des Autors
llama.cpp local GGUF inference + HF Hub model discovery.
Beliebtheit
- GitHub-Sterne
- 260k
- Platz im Ranking
- #513
- Lizenz
- MIT
- Aktualisiert
- 2.11.2026
Kommentare
- …
Weitere Skills aus diesem Repository
agent-merge-conflict-arbiter
260kLöst einen Git-Merge-Konflikt zwischen den Branches zweier Agenten als neutrale dritte Partei und erzeugt ein zusammengeführtes Ergebnis für das Repo.
antigravity-cli
260kFührt dich durch Installation, Aktualisierung und Fehlersuche des Antigravity-Kommandozeilenwerkzeugs, einschließlich Plugins, Anmeldung und Sandbox.
blackbox
260kLässt deinen Agenten eine Coding-Aufgabe an das Blackbox-KI-Kommandozeilenwerkzeug übergeben, das mehrere KI-Modelle nutzt und das beste Ergebnis auswählt.
dynamic-workflow
260kBringt deinem Agenten bei, große Stapel gleichartiger Arbeit als gespeichertes Skript auszuführen, sodass nur geprüfte Ergebnisse in die Hauptunterhaltung zurückkehren.
Ähnliche Skills
pytorch-patterns
280kHilft deinem Agenten, PyTorch für Machine-Learning-Modelle einzusetzen. Er wendet Best Practices für effizientes Training und reproduzierbare Ergebnisse an.
evm-token-decimals
280kHilft deinem Agenten, Fehler bei Dezimalzahlen in verschiedenen Blockchain-Netzwerken zu vermeiden. Sorgt dafür, dass Token-Werte stimmen.
ito-inference
280kHilft deinem Agenten, die Verfügbarkeit von KI-Modellen zu prüfen. Er verbindet Rechenanfragen mit einem bereiten Modellservice.