الدليل ← Skill
SkillbundledHermes Bundled Skills

Llama Cpp

Llama Cpp: مهارة ينشرها Orchestra Research. مجالها الخوادم والبنية التحتية. الرخصة MIT. الإصدار الموثّق 2.1.2. مثبّتة افتراضيًا مع Hermes، فلا تحتاج خطوة تثبيت. تعتمد على: llama-cpp-python>=0.2.0. تدعم: linux، macos، windows.

llama.cppGGUFQuantizationHugging Face HubCPU InferenceApple SiliconEdge DeploymentAMD GPUs
آخر تحقق من السجل2026-08-18v2.1.2Orchestra Research
افتح المصدر الأصلي ↗Read in English
المعنى ببساطة

ماذا يضيف إلى Hermes؟

Llama Cpp: مهارة ينشرها Orchestra Research. مجالها الخوادم والبنية التحتية. الرخصة MIT. الإصدار الموثّق 2.1.2. مثبّتة افتراضيًا مع Hermes، فلا تحتاج خطوة تثبيت. تعتمد على: llama-cpp-python>=0.2.0. تدعم: linux، macos، windows.

Llama Cpp هي مهارة مرتبطة بمجال الخوادم والبنية التحتية. يساعد الوكيل على فهم أو تشغيل موارد تقنية قد تؤثر في التكلفة والتوافر والأمان.

هذا تفسير مبسّط مبني على وصف الناشر. أبقينا الوصف الإنجليزي بجانبه حتى تستطيع مقارنة المعنى بالمصدر.

استخدمه عندما

استخدمه عندما يكون هدفك واضحًا في الخوادم والبنية التحتية وتستطيع تحديد البيانات والأفعال التي يحتاجها فقط.

لا تحتاجه عندما

لا تضفه لمجرد التجربة إذا كان لديك طريق أبسط داخل Hermes، أو إذا لم تستطع مراجعة المصدر والصلاحيات.

لمن يناسب؟

مناسب لمن يريد طريقة عمل قابلة للتكرار داخل Hermes.

أول اختبار آمن

ابدأ ببيئة تجريبية وحساب محدود، واطلب فحص الحالة فقط قبل أي إنشاء أو حذف.

الوصف الأصلي من الناشر، من دون ترجمة تغيّر المعنى

llama.cpp local GGUF inference + HF Hub model discovery

✓
مصدر البيانات

فُهرس هذا الإدخال من Hermes Bundled Skills. الشرح العربي يفسّر النوع والمجال ولا يضيف وظيفة غير مذكورة في المصدر.

!
مراجعة الأمان

المصدر رسمي أو خضع لمراجعة تحريرية، لكن ذلك لا يغني عن مراجعة الصلاحيات والإصدار.

مسار تثبيت آمن

افحص، ثبّت، ثم اختبر.

  1. 01
    افتح المصدر

    طابق اسم الناشر والرخصة والوصف مع حاجتك، وراجع آخر تحديث فعلي.

  2. 02
    راجع الصلاحيات والأسرار

    لا تلصق قيمة سر داخل الموقع. استخدم أسماء متغيرات البيئة وامنح أقل نطاق ممكن.

  3. 03
    انسخ الإعداد فقط بعد المراجعة

    الأزرار أدناه تنسخ نصًا إلى الحافظة ولا تشغّل أمرًا على جهازك.

  4. 04
    اختبر بمهمة غير حساسة

    تحقق من الأدوات الظاهرة، ثم استبعد أدوات الكتابة أو الحذف التي لا تحتاجها.

طريقة الإعداد

مثبّتة مسبقًا مع Hermes.

تأتي هذه المهارة مع Hermes وتُحمَّل عندما يرى الوكيل أنها مناسبة. لا شيء لتثبيته؛ اقرأ التعريف أدناه لتعرف ما ستفعله.

افتح الصفحة الرسمية ↗
تعريف المهارة كاملًا

ما الذي يحمّله Hermes بالضبط عند تشغيل هذه المهارة.

منقول من التوثيق الرسمي. اقرأه قبل تفعيل المهارة، فهذا النص يصبح تعليمات الوكيل نفسه.

llama.cpp local GGUF inference + HF Hub model discovery.

Skill metadata

جدول مرجعي. لا تقرأه كله، ابحث عن السطر الذي يخصّك فقط.

SourceBundled (installed by default)
Pathskills/mlops/inference/llama-cpp
Version2.1.2
AuthorOrchestra Research
LicenseMIT
Dependenciesllama-cpp-python>=0.2.0
Platformslinux, macos, windows
Tagsllama.cpp, GGUF, Quantization, Hugging Face Hub, CPU Inference, Apple Silicon, Edge Deployment, AMD GPUs, Intel GPUs, NVIDIA, URL-first

Reference: full SKILL.md

شرح للفكرة نفسها. اقرأه ببطء، فبقية الأقسام تبني عليه.

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-server or llama-cli command from the Hub
  • Search the Hub for models that already support llama.cpp
  • Enumerate available .gguf files and sizes for a repo
  • Decide between Q4/Q5/Q6/IQ variants for the user's RAM or VRAM

Model Discovery workflow

إعدادات تضبطها مرة وتنساها. غيّر واحدًا في كل مرة حتى تعرف أثر كل تغيير. تضبط IQ4_NL_XL خارج المحادثة، في بيئة التشغيل.

Prefer URL workflows before asking for hf, Python, or custom scripts.

  1. Search for candidate repos on the Hub:
  2. Base: https://huggingface.co/models?apps=llama.cpp&sort=trending
  3. Add search=<term> for a model family
  4. Add num_parameters=min:0,max:24B or similar when the user has size constraints
  5. Open the repo with the llama.cpp local-app view:
  6. https://huggingface.co/<repo>?local-app=llama.cpp
  7. Treat the local-app snippet as the source of truth when it is visible:
  8. copy the exact llama-server or llama-cli command
  9. report the recommended quant exactly as HF shows it
  10. Read the same ?local-app=llama.cpp URL as page text or HTML and extract the section under Hardware compatibility:
  11. prefer its exact quant labels and sizes over generic tables
  12. keep repo-specific labels such as UD-Q4_K_M or IQ4_NL_XL
  13. if that section is not visible in the fetched page source, say so and fall back to the tree API plus generic quant guidance
  14. Query the tree API to confirm what actually exists:
  15. https://huggingface.co/api/models/<repo>/tree/main?recursive=true
  16. keep entries where type is file and path ends with .gguf
  17. use path and size as the source of truth for filenames and byte sizes
  18. separate quantized checkpoints from mmproj-*.gguf projector files and BF16/ shard files
  19. use https://huggingface.co/<repo>/tree/main only as a human fallback
  20. If the local-app snippet is not text-visible, reconstruct the command from the repo plus the chosen quant:
  21. shorthand quant selection: llama-server -hf <repo>:<QUANT>
  22. exact-file fallback: llama-server --hf-repo <repo> --hf-file <filename.gguf>
  23. Only suggest conversion from Transformers weights if the repo does not already expose GGUF files.

Quick start

خطوات عملية بالترتيب. نفّذ خطوة وتأكد أنها نجحت قبل الانتقال للتالية.

Install llama.cpp

Shellسطران
# macOS / Linux (simplest)
brew install llama.cpp
Shellسطر واحد
winget install llama.cpp
Shell4 أسطر
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

Shellسطر واحد
llama-cli -hf bartowski/Llama-3.2-3B-Instruct-GGUF:Q8_0
Shellسطر واحد
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.

Shell4 أسطر
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

Shell7 أسطر
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

Python11 سطرًا
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

Python19 سطرًا
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

Python3 أسطر
llm = Llama(model_path="./model-q4_k_m.gguf", embedding=True, n_gpu_layers=35)
vec = llm.embed("This is a test sentence.")
print(f"Embedding dimension: {len(vec)}")

You can also load a GGUF straight from the Hub:

Python5 أسطر
llm = Llama.from_pretrained(
    repo_id="bartowski/Llama-3.2-3B-Instruct-GGUF",
    filename="*Q4_K_M.gguf",
    n_gpu_layers=35,
)

Choosing a quant

شرح للفكرة نفسها. اقرأه ببطء، فبقية الأقسام تبني عليه.

Use the Hub page first, generic heuristics second.

  • Prefer the exact quant that HF marks as compatible for the user's hardware profile.
  • For general chat, start with Q4_K_M.
  • For code or technical work, prefer Q5_K_M or Q6_K if memory allows.
  • For very tight RAM budgets, consider Q3_K_M, IQ variants, or Q2 variants only if the user explicitly prioritizes fit over quality.
  • For multimodal repos, mention mmproj-*.gguf separately. The projector is not the main model file.
  • Do not normalize repo-native labels. If the page says UD-Q4_K_M, report UD-Q4_K_M.

Extracting available GGUFs from a repo

شرح للفكرة نفسها. اقرأه ببطء، فبقية الأقسام تبني عليه.

When the user asks what GGUFs exist, return:

  • filename
  • file size
  • quant label
  • whether it is a main model or an auxiliary projector

Ignore unless requested:

  • README
  • BF16 shard files
  • imatrix blobs or calibration artifacts

Use the tree API for this step:

  • https://huggingface.co/api/models/<repo>/tree/main?recursive=true

For a repo like unsloth/Qwen3.6-35B-A3B-GGUF, the local-app page can show quant chips such as UD-Q4_K_M, UD-Q5_K_M, UD-Q6_K, and Q8_0, while the tree API exposes exact file paths such as Qwen3.6-35B-A3B-UD-Q4_K_M.gguf and Qwen3.6-35B-A3B-Q8_0.gguf with byte sizes. Use the tree API to turn a quant label into an exact filename.

Search patterns

شرح للفكرة نفسها. اقرأه ببطء، فبقية الأقسام تبني عليه.

Use these URL shapes directly:

Text6 أسطر
https://huggingface.co/models?apps=llama.cpp&sort=trending
https://huggingface.co/models?search=<term>&apps=llama.cpp&sort=trending
https://huggingface.co/models?search=<term>&apps=llama.cpp&num_parameters=min:0,max:24B&sort=trending
https://huggingface.co/<repo>?local-app=llama.cpp
https://huggingface.co/api/models/<repo>/tree/main?recursive=true
https://huggingface.co/<repo>/tree/main

Output format

شرح للفكرة نفسها. اقرأه ببطء، فبقية الأقسام تبني عليه.

When answering discovery requests, prefer a compact structured result like:

Text9 أسطر
Repo: <repo>
Recommended quant from HF: <label> (<size>)
llama-server: <command>
Other GGUFs:
- <filename> - <size>
- <filename> - <size>
Source URLs:
- <local-app URL>
- <tree API URL>

References

شرح للفكرة نفسها. اقرأه ببطء، فبقية الأقسام تبني عليه.

  • hub-discovery.md ↗ - URL-only Hugging Face workflows, search patterns, GGUF extraction, and command reconstruction
  • advanced-usage.md ↗ — speculative decoding, batched inference, grammar-constrained generation, LoRA, multi-GPU, custom builds, benchmark scripts
  • quantization.md ↗ — quant quality tradeoffs, when to use Q4/Q5/Q6/IQ, model size scaling, imatrix
  • server.md ↗ — direct-from-Hub server launch, OpenAI API endpoints, Docker deployment, NGINX load balancing, monitoring
  • optimization.md ↗ — CPU threading, BLAS, GPU offload heuristics, batch tuning, benchmarks
  • troubleshooting.md ↗ — install/convert/quantize/inference/server issues, Apple Silicon, debugging

Resources

شرح للفكرة نفسها. اقرأه ببطء، فبقية الأقسام تبني عليه.

  • GitHub: https://github.com/ggml-org/llama.cpp
  • Hugging Face GGUF + llama.cpp docs: https://huggingface.co/docs/hub/gguf-llamacpp
  • Hugging Face Local Apps docs: https://huggingface.co/docs/hub/main/local-apps
  • Hugging Face Local Agents docs: https://huggingface.co/docs/hub/agents-local
  • Example local-app page: https://huggingface.co/unsloth/Qwen3.6-35B-A3B-GGUF?local-app=llama.cpp
  • Example tree API: https://huggingface.co/api/models/unsloth/Qwen3.6-35B-A3B-GGUF/tree/main?recursive=true
  • Example llama.cpp search: https://huggingface.co/models?num_parameters=min:0,max:24B&apps=llama.cpp&sort=trending
  • License: MIT