llama-cpp
БесплатноБез исполняемых скриптовНе проверенllama.cpp runs large language and vision models locally from GGUF files on CPUs, Apple Silicon and GPUs, and serves them over an OpenAI-compatible HTTP API…
от TerminalSkills★ 221 звезда на GitHubОб этом скилле
llama.cpp — Local LLM inference from GGUF files
Overview
llama.cpp is a C/C++ inference engine for models stored in the GGUF format. Current builds ship one llama binary with subcommands: llama serve (HTTP server with OpenAI- and Anthropic-compatible routes plus a web UI), llama cli (terminal chat) and llama download. Docker images and older installs expose the same programs as llama-server and llama-cli; the flags are identical, so every llama serve ... line below also works as llama-server ....
Instructions
Installation
# Package managers
brew install llama.cpp # macOS and Linux
winget install llama.cpp # Windows
conda install -c conda-forge llama.cpp # CUDA, Vulkan and Metal builds
# Official installer from llama.app: probes CUDA, ROCm, Vulkan, Metal or CPU
# features and copies a matching prebuilt binary to ~/.local/bin/llama.
# Download it, read it, then run it — never pipe it straight into a shell.
curl -LsSf https://llama.app/install.sh -o llama-install.sh
sh llama-install.sh
llama version
llama help all # also lists quantize, bench, perplexity, completion
Build from source when no prebuilt binary matches the machine:
git clone https://github.com/ggml-org/llama.cpp
cd llama.cpp
cmake -B build -DGGML_CUDA=ON # drop the flag for CPU; Vulkan: -DGGML_VULKAN=ON
cmake --build build --config Release -j 8
ls build/bin/ # llama, llama-server, llama-cli, llama-quantize, llama-bench
Metal is enabled by default on macOS. Docker images are published as ghcr.io/ggml-org/llama.cpp:server, :light and :full, each with -cuda, -rocm, -vulkan and -intel variants.
Get a model
# Download into the local cache and print the file path
llama download -hf bartowski/Qwen2.5-7B-Instruct-GGUF:Q4_K_M
# Pick an exact file instead of a quantization tag
llama download -hf ggml-org/Qwen3.5-0.8B-GGUF -hff Qwen3.5-0.8B-Q8_0.gguf
llama cli --cache-list
-hf user/repo[:quant] defaults to Q4_K_M and falls back to the first file in the repository. Gated repositories read the token from HF_TOKEN. LLAMA_CACHE moves the cache directory, and --offline forbids network access.
Run a prompt from the terminal
# Interactive chat
llama cli -hf bartowski/Qwen2.5-7B-Instruct-GGUF:Q4_K_M
# One answer, then exit: the form to use from scripts and agents
llama cli -hf bartowski/Qwen2.5-7B-Instruct-GGUF:Q4_K_M \
-sys "You are a release-notes writer." \
-p "Summarize: fixed login timeout, added CSV export, removed legacy v1 API." \
-st -n 200 --temp 0.2 --no-display-prompt
# Vision model: the multimodal projector is downloaded together with the model
llama cli -hf ggml-org/gemma-3-4b-it-GGUF --image receipt-2026-09-14.jpg \
-p "List the merchant, date and total." -st
Serve an OpenAI-compatible API
export LLAMA_API_KEY="$(openssl rand -hex 24)" # read by the server, same as --api-key
llama serve -hf bartowski/Qwen2.5-7B-Instruct-GGUF:Q4_K_M \
--alias qwen2.5-7b-instruct \
-c 16384 -ngl all -np 4 \
--host 127.0.0.1 --port 8080 --metrics
| Flag | Meaning |
|---|---|
-m FILE / -hf REPO |
Local GGUF file, or Hugging Face repository to fetch |
--alias NAME |
Model id returned by /v1/models; default is the file path |
-c N |
Context size in tokens; 0 takes the value stored in the model |
-ngl N |
Layers kept in VRAM: a number, auto (default) or all |
-np N |
Parallel request slots; -1 (default) selects automatically |
--host, --port |
Defaults are 127.0.0.1 and 8080 |
--api-key KEY |
Require Authorization: Bearer KEY; also --api-key-file |
--metrics |
Enable the Prometheus endpoint /metrics |
--sleep-idle-seconds N |
Unload the model after N idle seconds, reload on demand |
Every flag has an environment equivalent such as LLAMA_ARG_CTX_SIZE or LLAMA_ARG_N_GPU_LAYERS; a command-line flag overrides the variable. Wait for readiness before sending work:
curl -s http://127.0.0.1:8080/health
# {"status":"ok"} (HTTP 503 with "Loading model" until the weights are loaded)
curl -s http://127.0.0.1:8080/v1/models -H "Authorization: Bearer $LLAMA_API_KEY"
Call the server
curl -s http://127.0.0.1:8080/v1/chat/completions \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $LLAMA_API_KEY" \
-d '{
"model": "qwen2.5-7b-instruct",
"messages": [
{"role": "system", "content": "Answer in one sentence."},
{"role": "user", "content": "What does HTTP status 429 mean?"}
],
"temperature": 0.2,
"max_tokens": 120
}'
import os
from openai import OpenAI
client = OpenAI(
base_url="http://127.0.0.1:8080/v1",
api_key=os.environ.get("LLAMA_API_KEY", "sk-no-key-required"),
)
# Schema-constrained output: the sampler can only emit JSON matching the schema
reply = client.chat.completions.create(
Установить llama-cpp в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
Вложенные файлы
FAQ
Что делает скилл llama-cpp?
llama.cpp runs large language and vision models locally from GGUF files on CPUs, Apple Silicon and GPUs, and serves them over an OpenAI-compatible HTTP API. Use when a user asks to run a model locally with llama.cpp, start llama-server or "llama serve", download a GGUF model from Hugging Face, host a local OpenAI-compatible endpoint, offload layers to the GPU, get embeddings or schema-constrained JSON from a local model, quantize a model to Q4_K_M, or benchmark tokens per second.
Как установить скилл llama-cpp?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл llama-cpp запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
mcp-builder
Guide for creating high-quality MCP (Model Context Protocol) servers that enable LLMs to interact with external services through well-designed tools. Use when…
от Anthropicclaude-api
Reference for the Claude API / Anthropic SDK — model ids, pricing, params, streaming, tool use, MCP, agents, caching, token counting, model migration. TRIGGER…
от Anthropicalgorithmic-art
Creating algorithmic art using p5.js with seeded randomness and interactive parameter exploration. Use this when users request creating art using code…
от Anthropicmcp-integration
This skill should be used when the user asks to "add MCP server", "integrate MCP", "configure MCP in plugin", "use .mcp.json", "set up Model Context…
от Anthropic