| domain | archive |
|---|---|
| title | Llama Cpp |
| verification | metadata-normalized |
| source | skill-pipeline |
| status | draft |
| created | 2026-05-09 |
(此 lesson 从 skill llama-cpp 自动提取,待补全)
(待补充)
Use this skill for local GGUF inference, quant selection, or Hugging Face repo discovery for llama.cpp.
- 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
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.
# macOS / Linux (simplest)
brew install llama.cppwinget install llama.cppgit clone https://github.com/ggml-org/llama.cpp
cd llama.cpp
cmake -B build
cmake --build build --config Releasellama-cli -hf bartowski/Llama-3.2-3B-Instruct-GGUF:Q8_0llama-server -hf bartowski/Llama-3.2-3B-Instruct-GGUF:Q8_0Use 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
## 验证
(待补充)