llama-cpp
यह क्या करती है
यह llama.cpp से अपने हार्डवेयर पर quantized भाषा मॉडल चलाने में मदद करती है, CPU से Apple Silicon और GPUs तक। यह उन लोगों के लिए है जो लोकल AI मॉडल चाहते हैं और सही फ़ाइल आकार चुनने में मदद चाहते हैं।
कब इस्तेमाल करें
- ✓जब आप बिना क्लाउड सेवा के अपने कंप्यूटर पर भाषा मॉडल चलाना चाहें।
- ✓जब आपको अपनी RAM या video memory में फ़िट होने वाली GGUF फ़ाइल चुननी हो।
- ✓जब आप Hugging Face repo से llama-server या llama-cli कमांड बनवाना चाहें।
Skill का लिंक
https://github.com/NousResearch/hermes-agent/blob/main/optional-skills/mlops/inference/llama-cpp/SKILL.mdइसे कॉपी करके अपने AI (Claude, ChatGPT या Cursor) में पेस्ट करें और निर्देशों का पालन करने को कहें।
कैसे इस्तेमाल करें
सबसे आसान तरीका: मैसेज कॉपी करके अपने AI में पेस्ट करें। वह skill पढ़कर निर्देशों का पालन करेगा।
पेस्ट करने के लिए तैयार मैसेज
Claude Code, Codex या Cursor के लिए: प्रोजेक्ट फ़ोल्डर में चलाएँ और skill इंस्टॉल हो जाएगी।
SKILL.md डाउनलोड करें और अपने एजेंट के skills फ़ोल्डर में रखें।
AI से क्या माँगें: उदाहरण
“एक छोटा चैट मॉडल खोजिए जो मेरे लैपटॉप की 16 GB RAM में चल जाए, और उसे चलाने की कमांड दीजिए।”
हर हफ़्ते 5 नई skills, 1 मिनट में पढ़ें।
यह कैसे काम करती है
एजेंट llama.cpp के साथ काम करने वाले repos के लिए Hugging Face पर खोजता है, repo का लोकल ऐप पेज पढ़ता है, और आपकी मेमोरी से मेल खाने वाली quantization चुनता है। फिर वह सटीक llama-server या llama-cli कमांड देता है।
तकनीकी सामग्री (मूल SKILL.md)
लेखक का मूल टेक्स्ट, अंग्रेज़ी में, सीधे 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
अक्सर पूछे जाने वाले सवाल
quantization क्या है?
मॉडल के संपीड़ित संस्करण, जैसे Q4 या Q5, जो कम मेमोरी लेते हैं पर गुणवत्ता में कुछ कमी के साथ।
यह कौन से हार्डवेयर सपोर्ट करता है?
स्किल CPU, Apple Silicon, CUDA, ROCm और Intel GPUs सूचीबद्ध करती है।
क्या यह मॉडल खोज सकता है?
हाँ। यह Hugging Face Hub पर ऐसे मॉडल खोजता है जो पहले से llama.cpp के साथ चलते हैं।
जानकारी
लेखक का मूल विवरण
llama.cpp local GGUF inference + HF Hub model discovery.
लोकप्रियता
- GitHub स्टार
- 260k
- रैंकिंग में स्थान
- #513
- लाइसेंस
- MIT
- अपडेट की गई
- 2/11/2026
कमेंट
- …
इस repository की और skills
agent-merge-conflict-arbiter
260kदो एजेंट्स की branches के बीच git merge conflict को एक निष्पक्ष तीसरे पक्ष के रूप में सुलझाती है और रिपॉज़िटरी के लिए एक merged नतीजा बनाती है।
antigravity-cli
260kAntigravity कमांड-लाइन टूल को इंस्टॉल करने, अपडेट करने और उसकी दिक्कतें सुलझाने में मार्गदर्शन देती है, जिसमें प्लगइन, साइन-इन और sandbox शामिल हैं।
blackbox
260kआपके एजेंट को कोडिंग काम Blackbox AI कमांड-लाइन टूल को सौंपने देती है, जो कई AI मॉडल चलाकर सबसे अच्छा नतीजा चुनता है।
dynamic-workflow
260kआपके एजेंट को बड़े बैच के एक जैसे कामों को सेव की गई स्क्रिप्ट के रूप में चलाना सिखाती है, ताकि मुख्य बातचीत में केवल जांचे गए नतीजे लौटें।
मिलती-जुलती skills
pytorch-patterns
280kआपके एजेंट को machine learning models के लिए PyTorch इस्तेमाल करने में मदद करता है। कुशल model training के best practices लागू करता है और नतीजों को दोहराने लायक रखता है।
evm-token-decimals
280kयह आपके एजेंट को अलग-अलग blockchain networks पर decimal numbers की गलतियों से बचने में मदद करता है। यह transactions और calculations में token values सही रखने का ध्यान रखता है।
ito-inference
280kआपके एजेंट को AI models की उपलब्धता जाँचने देता है। यह compute request को तैयार model service से जोड़ता है।