[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M6ADWC4YXGBS4N7JY15XVV6K":3,"skill-same:01M6ADWC4YXGBS4N7JY15XVV6K":242},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":8,"repositoryFullName":9,"ownerLogin":10,"ownerAvatarUrl":11,"ownerAccountNo":12,"ownerDisplayName":13,"repositoryNo":14,"starsCount":15,"licenseSpdxId":16,"licenseFileUrl":17,"sourceHtmlUrl":18,"categories":19,"keywords":30,"publishedAt":55,"linkOnly":56,"markdownContent":57,"markdownBody":58,"frontMatter":59,"refName":68,"commitSha":69,"skillDirectory":70,"forksCount":71,"repositoryHtmlUrl":72,"repositoryHomepageUrl":73,"ownerHtmlUrl":74,"ownerBlogUrl":75,"ownerDescription":76,"updatedAt":77,"install":78,"resources":91},"01M6ADWC4YXGBS4N7JY15XVV6K","optimization-gguf","GGUF 量化与 llama.cpp 推理","GGUF format and llama.cpp quantization for efficient CPU\u002FGPU inference. Use when deploying models on consumer hardware, Apple Silicon, or when needing flexible quantization from 2-8 bit without GPU requirements.","GGUF 格式与 llama.cpp 量化，用于高效的 CPU\u002FGPU 推理。适用于在消费级硬件、Apple Silicon 上部署模型，或需要 2-8 位灵活量化且无需 GPU 的场景。","davila7\u002Fclaude-code-templates","davila7","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F6216945?v=4","01M6ADEWWFPS191NFM0Y1EX1JH","Daniel Avila","01M6ADJHGM78PHQRD3XZTFDVKK",33602,"MIT",null,"https:\u002F\u002Fgithub.com\u002Fdavila7\u002Fclaude-code-templates\u002Fblob\u002Fmain\u002Fcli-tool\u002Fcomponents\u002Fskills\u002Fai-research\u002Foptimization-gguf\u002FSKILL.md",[20,25],{"categoryNo":21,"categoryName":22,"taxonomyType":23,"taxonomyTypeDesc":24},"01M8BRZZF9D7PVFN5MXSPWWD61","AI 工程师","PROFESSION","适用职业",{"categoryNo":26,"categoryName":27,"taxonomyType":28,"taxonomyTypeDesc":29},"01M8C7RZZQT16HYSRGF5KGZPXV","前沿模型改造技术","SCENARIO","使用场景",[31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54],"Optimization","optimization gguf","GGUF","requirements","when","for","orchestra","Model Compression","CPU Inference","llama.cpp","CPU","silicon","bit","apple","python","use","model","apple silicon","Llama","compression","gpu","cpp","research","inference","2026-11-10 10:12:30",false,"---\nname: optimization-gguf\ndescription: GGUF format and llama.cpp quantization for efficient CPU\u002FGPU inference. Use when deploying models on consumer hardware, Apple Silicon, or when needing flexible quantization from 2-8 bit without GPU requirements.\nlicense: MIT\nmetadata:\n  version: 1.0.0\n  author: Orchestra Research\n  tags: [GGUF, Quantization, llama.cpp, CPU Inference, Apple Silicon, Model Compression, Optimization]\n  dependencies: [llama-cpp-python>=0.2.0]\n---\n\n# GGUF - Quantization Format for llama.cpp\n\nThe GGUF (GPT-Generated Unified Format) is the standard file format for llama.cpp, enabling efficient inference on CPUs, Apple Silicon, and GPUs with flexible quantization options.\n\n## When to use GGUF\n\n**Use GGUF when:**\n- Deploying on consumer hardware (laptops, desktops)\n- Running on Apple Silicon (M1\u002FM2\u002FM3) with Metal acceleration\n- Need CPU inference without GPU requirements\n- Want flexible quantization (Q2_K to Q8_0)\n- Using local AI tools (LM Studio, Ollama, text-generation-webui)\n\n**Key advantages:**\n- **Universal hardware**: CPU, Apple Silicon, NVIDIA, AMD support\n- **No Python runtime**: Pure C\u002FC++ inference\n- **Flexible quantization**: 2-8 bit with various methods (K-quants)\n- **Ecosystem support**: LM Studio, Ollama, koboldcpp, and more\n- **imatrix**: Importance matrix for better low-bit quality\n\n**Use alternatives instead:**\n- **AWQ\u002FGPTQ**: Maximum accuracy with calibration on NVIDIA GPUs\n- **HQQ**: Fast calibration-free quantization for HuggingFace\n- **bitsandbytes**: Simple integration with transformers library\n- **TensorRT-LLM**: Production NVIDIA deployment with maximum speed\n\n## Quick start\n\n### Installation\n\n```bash\n# Clone llama.cpp\ngit clone https:\u002F\u002Fgithub.com\u002Fggml-org\u002Fllama.cpp\ncd llama.cpp\n\n# Build (CPU)\nmake\n\n# Build with CUDA (NVIDIA)\nmake GGML_CUDA=1\n\n# Build with Metal (Apple Silicon)\nmake GGML_METAL=1\n\n# Install Python bindings (optional)\npip install llama-cpp-python\n```\n\n### Convert model to GGUF\n\n```bash\n# Install requirements\npip install -r requirements.txt\n\n# Convert HuggingFace model to GGUF (FP16)\npython convert_hf_to_gguf.py .\u002Fpath\u002Fto\u002Fmodel --outfile model-f16.gguf\n\n# Or specify output type\npython convert_hf_to_gguf.py .\u002Fpath\u002Fto\u002Fmodel \\\n    --outfile model-f16.gguf \\\n    --outtype f16\n```\n\n### Quantize model\n\n```bash\n# Basic quantization to Q4_K_M\n.\u002Fllama-quantize model-f16.gguf model-q4_k_m.gguf Q4_K_M\n\n# Quantize with importance matrix (better quality)\n.\u002Fllama-imatrix -m model-f16.gguf -f calibration.txt -o model.imatrix\n.\u002Fllama-quantize --imatrix model.imatrix model-f16.gguf model-q4_k_m.gguf Q4_K_M\n```\n\n### Run inference\n\n```bash\n# CLI inference\n.\u002Fllama-cli -m model-q4_k_m.gguf -p \"Hello, how are you?\"\n\n# Interactive mode\n.\u002Fllama-cli -m model-q4_k_m.gguf --interactive\n\n# With GPU offload\n.\u002Fllama-cli -m model-q4_k_m.gguf -ngl 35 -p \"Hello!\"\n```\n\n## Quantization types\n\n### K-quant methods (recommended)\n\n| Type | Bits | Size (7B) | Quality | Use Case |\n|------|------|-----------|---------|----------|\n| Q2_K | 2.5 | ~2.8 GB | Low | Extreme compression |\n| Q3_K_S | 3.0 | ~3.0 GB | Low-Med | Memory constrained |\n| Q3_K_M | 3.3 | ~3.3 GB | Medium | Balance |\n| Q4_K_S | 4.0 | ~3.8 GB | Med-High | Good balance |\n| Q4_K_M | 4.5 | ~4.1 GB | High | **Recommended default** |\n| Q5_K_S | 5.0 | ~4.6 GB | High | Quality focused |\n| Q5_K_M | 5.5 | ~4.8 GB | Very High | High quality |\n| Q6_K | 6.0 | ~5.5 GB | Excellent | Near-original |\n| Q8_0 | 8.0 | ~7.2 GB | Best | Maximum quality |\n\n### Legacy methods\n\n| Type | Description |\n|------|-------------|\n| Q4_0 | 4-bit, basic |\n| Q4_1 | 4-bit with delta |\n| Q5_0 | 5-bit, basic |\n| Q5_1 | 5-bit with delta |\n\n**Recommendation**: Use K-quant methods (Q4_K_M, Q5_K_M) for best quality\u002Fsize ratio.\n\n## Conversion workflows\n\n### Workflow 1: HuggingFace to GGUF\n\n```bash\n# 1. Download model\nhuggingface-cli download meta-llama\u002FLlama-3.1-8B --local-dir .\u002Fllama-3.1-8b\n\n# 2. Convert to GGUF (FP16)\npython convert_hf_to_gguf.py .\u002Fllama-3.1-8b \\\n    --outfile llama-3.1-8b-f16.gguf \\\n    --outtype f16\n\n# 3. Quantize\n.\u002Fllama-quantize llama-3.1-8b-f16.gguf llama-3.1-8b-q4_k_m.gguf Q4_K_M\n\n# 4. Test\n.\u002Fllama-cli -m llama-3.1-8b-q4_k_m.gguf -p \"Hello!\" -n 50\n```\n\n### Workflow 2: With importance matrix (better quality)\n\n```bash\n# 1. Convert to GGUF\npython convert_hf_to_gguf.py .\u002Fmodel --outfile model-f16.gguf\n\n# 2. Create calibration text (diverse samples)\ncat > calibration.txt \u003C\u003C 'EOF'\nThe quick brown fox jumps over the lazy dog.\nMachine learning is a subset of artificial intelligence.\nPython is a popular programming language.\n# Add more diverse text samples...\nEOF\n\n# 3. Generate importance matrix\n.\u002Fllama-imatrix -m model-f16.gguf \\\n    -f calibration.txt \\\n    --chunk 512 \\\n    -o model.imatrix \\\n    -ngl 35  # GPU layers if available\n\n# 4. Quantize with imatrix\n.\u002Fllama-quantize --imatrix model.imatrix \\\n    model-f16.gguf \\\n    model-q4_k_m.gguf \\\n    Q4_K_M\n```\n\n### Workflow 3: Multiple quantizations\n\n```bash\n#!\u002Fbin\u002Fbash\nMODEL=\"llama-3.1-8b-f16.gguf\"\nIMATRIX=\"llama-3.1-8b.imatrix\"\n\n# Generate imatrix once\n.\u002Fllama-imatrix -m $MODEL -f wiki.txt -o $IMATRIX -ngl 35\n\n# Create multiple quantizations\nfor QUANT in Q4_K_M Q5_K_M Q6_K Q8_0; do\n    OUTPUT=\"llama-3.1-8b-${QUANT,,}.gguf\"\n    .\u002Fllama-quantize --imatrix $IMATRIX $MODEL $OUTPUT $QUANT\n    echo \"Created: $OUTPUT ($(du -h $OUTPUT | cut -f1))\"\ndone\n```\n\n## Python usage\n\n### llama-cpp-python\n\n```python\nfrom llama_cpp import Llama\n\n# Load model\nllm = Llama(\n    model_path=\".\u002Fmodel-q4_k_m.gguf\",\n    n_ctx=4096,          # Context window\n    n_gpu_layers=35,     # GPU offload (0 for CPU only)\n    n_threads=8          # CPU threads\n)\n\n# Generate\noutput = llm(\n    \"What is machine learning?\",\n    max_tokens=256,\n    temperature=0.7,\n    stop=[\"\u003C\u002Fs>\", \"\\n\\n\"]\n)\nprint(output[\"choices\"][0][\"text\"])\n```\n\n### Chat completion\n\n```python\nfrom llama_cpp import Llama\n\nllm = Llama(\n    model_path=\".\u002Fmodel-q4_k_m.gguf\",\n    n_ctx=4096,\n    n_gpu_layers=35,\n    chat_format=\"llama-3\"  # Or \"chatml\", \"mistral\", etc.\n)\n\nmessages = [\n    {\"role\": \"system\", \"content\": \"You are a helpful assistant.\"},\n    {\"role\": \"user\", \"content\": \"What is Python?\"}\n]\n\nresponse = llm.create_chat_completion(\n    messages=messages,\n    max_tokens=256,\n    temperature=0.7\n)\nprint(response[\"choices\"][0][\"message\"][\"content\"])\n```\n\n### Streaming\n\n```python\nfrom llama_cpp import Llama\n\nllm = Llama(model_path=\".\u002Fmodel-q4_k_m.gguf\", n_gpu_layers=35)\n\n# Stream tokens\nfor chunk in llm(\n    \"Explain quantum computing:\",\n    max_tokens=256,\n    stream=True\n):\n    print(chunk[\"choices\"][0][\"text\"], end=\"\", flush=True)\n```\n\n## Server mode\n\n### Start OpenAI-compatible server\n\n```bash\n# Start server\n.\u002Fllama-server -m model-q4_k_m.gguf \\\n    --host 0.0.0.0 \\\n    --port 8080 \\\n    -ngl 35 \\\n    -c 4096\n\n# Or with Python bindings\npython -m llama_cpp.server \\\n    --model model-q4_k_m.gguf \\\n    --n_gpu_layers 35 \\\n    --host 0.0.0.0 \\\n    --port 8080\n```\n\n### Use with OpenAI client\n\n```python\nfrom openai import OpenAI\n\nclient = OpenAI(\n    base_url=\"http:\u002F\u002Flocalhost:8080\u002Fv1\",\n    api_key=\"not-needed\"\n)\n\nresponse = client.chat.completions.create(\n    model=\"local-model\",\n    messages=[{\"role\": \"user\", \"content\": \"Hello!\"}],\n    max_tokens=256\n)\nprint(response.choices[0].message.content)\n```\n\n## Hardware optimization\n\n### Apple Silicon (Metal)\n\n```bash\n# Build with Metal\nmake clean && make GGML_METAL=1\n\n# Run with Metal acceleration\n.\u002Fllama-cli -m model.gguf -ngl 99 -p \"Hello\"\n\n# Python with Metal\nllm = Llama(\n    model_path=\"model.gguf\",\n    n_gpu_layers=99,     # Offload all layers\n    n_threads=1          # Metal handles parallelism\n)\n```\n\n### NVIDIA CUDA\n\n```bash\n# Build with CUDA\nmake clean && make GGML_CUDA=1\n\n# Run with CUDA\n.\u002Fllama-cli -m model.gguf -ngl 35 -p \"Hello\"\n\n# Specify GPU\nCUDA_VISIBLE_DEVICES=0 .\u002Fllama-cli -m model.gguf -ngl 35\n```\n\n### CPU optimization\n\n```bash\n# Build with AVX2\u002FAVX512\nmake clean && make\n\n# Run with optimal threads\n.\u002Fllama-cli -m model.gguf -t 8 -p \"Hello\"\n\n# Python CPU config\nllm = Llama(\n    model_path=\"model.gguf\",\n    n_gpu_layers=0,      # CPU only\n    n_threads=8,         # Match physical cores\n    n_batch=512          # Batch size for prompt processing\n)\n```\n\n## Integration with tools\n\n### Ollama\n\n```bash\n# Create Modelfile\ncat > Modelfile \u003C\u003C 'EOF'\nFROM .\u002Fmodel-q4_k_m.gguf\nTEMPLATE \"\"\"{{ .System }}\n{{ .Prompt }}\"\"\"\nPARAMETER temperature 0.7\nPARAMETER num_ctx 4096\nEOF\n\n# Create Ollama model\nollama create mymodel -f Modelfile\n\n# Run\nollama run mymodel \"Hello!\"\n```\n\n### LM Studio\n\n1. Place GGUF file in `~\u002F.cache\u002Flm-studio\u002Fmodels\u002F`\n2. Open LM Studio and select the model\n3. Configure context length and GPU offload\n4. Start inference\n\n### text-generation-webui\n\n```bash\n# Place in models folder\ncp model-q4_k_m.gguf text-generation-webui\u002Fmodels\u002F\n\n# Start with llama.cpp loader\npython server.py --model model-q4_k_m.gguf --loader llama.cpp --n-gpu-layers 35\n```\n\n## Best practices\n\n1. **Use K-quants**: Q4_K_M offers best quality\u002Fsize balance\n2. **Use imatrix**: Always use importance matrix for Q4 and below\n3. **GPU offload**: Offload as many layers as VRAM allows\n4. **Context length**: Start with 4096, increase if needed\n5. **Thread count**: Match physical CPU cores, not logical\n6. **Batch size**: Increase n_batch for faster prompt processing\n\n## Common issues\n\n**Model loads slowly:**\n```bash\n# Use mmap for faster loading\n.\u002Fllama-cli -m model.gguf --mmap\n```\n\n**Out of memory:**\n```bash\n# Reduce GPU layers\n.\u002Fllama-cli -m model.gguf -ngl 20  # Reduce from 35\n\n# Or use smaller quantization\n.\u002Fllama-quantize model-f16.gguf model-q3_k_m.gguf Q3_K_M\n```\n\n**Poor quality at low bits:**\n```bash\n# Always use imatrix for Q4 and below\n.\u002Fllama-imatrix -m model-f16.gguf -f calibration.txt -o model.imatrix\n.\u002Fllama-quantize --imatrix model.imatrix model-f16.gguf model-q4_k_m.gguf Q4_K_M\n```\n\n## References\n\n- **[Advanced Usage](references\u002Fadvanced-usage.md)** - Batching, speculative decoding, custom builds\n- **[Troubleshooting](references\u002Ftroubleshooting.md)** - Common issues, debugging, benchmarks\n\n## Resources\n\n- **Repository**: https:\u002F\u002Fgithub.com\u002Fggml-org\u002Fllama.cpp\n- **Python Bindings**: https:\u002F\u002Fgithub.com\u002Fabetlen\u002Fllama-cpp-python\n- **Pre-quantized Models**: https:\u002F\u002Fhuggingface.co\u002FTheBloke\n- **GGUF Converter**: https:\u002F\u002Fhuggingface.co\u002Fspaces\u002Fggml-org\u002Fgguf-my-repo\n- **License**: MIT\n","# GGUF - Quantization Format for llama.cpp\n\nThe GGUF (GPT-Generated Unified Format) is the standard file format for llama.cpp, enabling efficient inference on CPUs, Apple Silicon, and GPUs with flexible quantization options.\n\n## When to use GGUF\n\n**Use GGUF when:**\n- Deploying on consumer hardware (laptops, desktops)\n- Running on Apple Silicon (M1\u002FM2\u002FM3) with Metal acceleration\n- Need CPU inference without GPU requirements\n- Want flexible quantization (Q2_K to Q8_0)\n- Using local AI tools (LM Studio, Ollama, text-generation-webui)\n\n**Key advantages:**\n- **Universal hardware**: CPU, Apple Silicon, NVIDIA, AMD support\n- **No Python runtime**: Pure C\u002FC++ inference\n- **Flexible quantization**: 2-8 bit with various methods (K-quants)\n- **Ecosystem support**: LM Studio, Ollama, koboldcpp, and more\n- **imatrix**: Importance matrix for better low-bit quality\n\n**Use alternatives instead:**\n- **AWQ\u002FGPTQ**: Maximum accuracy with calibration on NVIDIA GPUs\n- **HQQ**: Fast calibration-free quantization for HuggingFace\n- **bitsandbytes**: Simple integration with transformers library\n- **TensorRT-LLM**: Production NVIDIA deployment with maximum speed\n\n## Quick start\n\n### Installation\n\n```bash\n# Clone llama.cpp\ngit clone https:\u002F\u002Fgithub.com\u002Fggml-org\u002Fllama.cpp\ncd llama.cpp\n\n# Build (CPU)\nmake\n\n# Build with CUDA (NVIDIA)\nmake GGML_CUDA=1\n\n# Build with Metal (Apple Silicon)\nmake GGML_METAL=1\n\n# Install Python bindings (optional)\npip install llama-cpp-python\n```\n\n### Convert model to GGUF\n\n```bash\n# Install requirements\npip install -r requirements.txt\n\n# Convert HuggingFace model to GGUF (FP16)\npython convert_hf_to_gguf.py .\u002Fpath\u002Fto\u002Fmodel --outfile model-f16.gguf\n\n# Or specify output type\npython convert_hf_to_gguf.py .\u002Fpath\u002Fto\u002Fmodel \\\n    --outfile model-f16.gguf \\\n    --outtype f16\n```\n\n### Quantize model\n\n```bash\n# Basic quantization to Q4_K_M\n.\u002Fllama-quantize model-f16.gguf model-q4_k_m.gguf Q4_K_M\n\n# Quantize with importance matrix (better quality)\n.\u002Fllama-imatrix -m model-f16.gguf -f calibration.txt -o model.imatrix\n.\u002Fllama-quantize --imatrix model.imatrix model-f16.gguf model-q4_k_m.gguf Q4_K_M\n```\n\n### Run inference\n\n```bash\n# CLI inference\n.\u002Fllama-cli -m model-q4_k_m.gguf -p \"Hello, how are you?\"\n\n# Interactive mode\n.\u002Fllama-cli -m model-q4_k_m.gguf --interactive\n\n# With GPU offload\n.\u002Fllama-cli -m model-q4_k_m.gguf -ngl 35 -p \"Hello!\"\n```\n\n## Quantization types\n\n### K-quant methods (recommended)\n\n| Type | Bits | Size (7B) | Quality | Use Case |\n|------|------|-----------|---------|----------|\n| Q2_K | 2.5 | ~2.8 GB | Low | Extreme compression |\n| Q3_K_S | 3.0 | ~3.0 GB | Low-Med | Memory constrained |\n| Q3_K_M | 3.3 | ~3.3 GB | Medium | Balance |\n| Q4_K_S | 4.0 | ~3.8 GB | Med-High | Good balance |\n| Q4_K_M | 4.5 | ~4.1 GB | High | **Recommended default** |\n| Q5_K_S | 5.0 | ~4.6 GB | High | Quality focused |\n| Q5_K_M | 5.5 | ~4.8 GB | Very High | High quality |\n| Q6_K | 6.0 | ~5.5 GB | Excellent | Near-original |\n| Q8_0 | 8.0 | ~7.2 GB | Best | Maximum quality |\n\n### Legacy methods\n\n| Type | Description |\n|------|-------------|\n| Q4_0 | 4-bit, basic |\n| Q4_1 | 4-bit with delta |\n| Q5_0 | 5-bit, basic |\n| Q5_1 | 5-bit with delta |\n\n**Recommendation**: Use K-quant methods (Q4_K_M, Q5_K_M) for best quality\u002Fsize ratio.\n\n## Conversion workflows\n\n### Workflow 1: HuggingFace to GGUF\n\n```bash\n# 1. Download model\nhuggingface-cli download meta-llama\u002FLlama-3.1-8B --local-dir .\u002Fllama-3.1-8b\n\n# 2. Convert to GGUF (FP16)\npython convert_hf_to_gguf.py .\u002Fllama-3.1-8b \\\n    --outfile llama-3.1-8b-f16.gguf \\\n    --outtype f16\n\n# 3. Quantize\n.\u002Fllama-quantize llama-3.1-8b-f16.gguf llama-3.1-8b-q4_k_m.gguf Q4_K_M\n\n# 4. Test\n.\u002Fllama-cli -m llama-3.1-8b-q4_k_m.gguf -p \"Hello!\" -n 50\n```\n\n### Workflow 2: With importance matrix (better quality)\n\n```bash\n# 1. Convert to GGUF\npython convert_hf_to_gguf.py .\u002Fmodel --outfile model-f16.gguf\n\n# 2. Create calibration text (diverse samples)\ncat > calibration.txt \u003C\u003C 'EOF'\nThe quick brown fox jumps over the lazy dog.\nMachine learning is a subset of artificial intelligence.\nPython is a popular programming language.\n# Add more diverse text samples...\nEOF\n\n# 3. Generate importance matrix\n.\u002Fllama-imatrix -m model-f16.gguf \\\n    -f calibration.txt \\\n    --chunk 512 \\\n    -o model.imatrix \\\n    -ngl 35  # GPU layers if available\n\n# 4. Quantize with imatrix\n.\u002Fllama-quantize --imatrix model.imatrix \\\n    model-f16.gguf \\\n    model-q4_k_m.gguf \\\n    Q4_K_M\n```\n\n### Workflow 3: Multiple quantizations\n\n```bash\n#!\u002Fbin\u002Fbash\nMODEL=\"llama-3.1-8b-f16.gguf\"\nIMATRIX=\"llama-3.1-8b.imatrix\"\n\n# Generate imatrix once\n.\u002Fllama-imatrix -m $MODEL -f wiki.txt -o $IMATRIX -ngl 35\n\n# Create multiple quantizations\nfor QUANT in Q4_K_M Q5_K_M Q6_K Q8_0; do\n    OUTPUT=\"llama-3.1-8b-${QUANT,,}.gguf\"\n    .\u002Fllama-quantize --imatrix $IMATRIX $MODEL $OUTPUT $QUANT\n    echo \"Created: $OUTPUT ($(du -h $OUTPUT | cut -f1))\"\ndone\n```\n\n## Python usage\n\n### llama-cpp-python\n\n```python\nfrom llama_cpp import Llama\n\n# Load model\nllm = Llama(\n    model_path=\".\u002Fmodel-q4_k_m.gguf\",\n    n_ctx=4096,          # Context window\n    n_gpu_layers=35,     # GPU offload (0 for CPU only)\n    n_threads=8          # CPU threads\n)\n\n# Generate\noutput = llm(\n    \"What is machine learning?\",\n    max_tokens=256,\n    temperature=0.7,\n    stop=[\"\u003C\u002Fs>\", \"\\n\\n\"]\n)\nprint(output[\"choices\"][0][\"text\"])\n```\n\n### Chat completion\n\n```python\nfrom llama_cpp import Llama\n\nllm = Llama(\n    model_path=\".\u002Fmodel-q4_k_m.gguf\",\n    n_ctx=4096,\n    n_gpu_layers=35,\n    chat_format=\"llama-3\"  # Or \"chatml\", \"mistral\", etc.\n)\n\nmessages = [\n    {\"role\": \"system\", \"content\": \"You are a helpful assistant.\"},\n    {\"role\": \"user\", \"content\": \"What is Python?\"}\n]\n\nresponse = llm.create_chat_completion(\n    messages=messages,\n    max_tokens=256,\n    temperature=0.7\n)\nprint(response[\"choices\"][0][\"message\"][\"content\"])\n```\n\n### Streaming\n\n```python\nfrom llama_cpp import Llama\n\nllm = Llama(model_path=\".\u002Fmodel-q4_k_m.gguf\", n_gpu_layers=35)\n\n# Stream tokens\nfor chunk in llm(\n    \"Explain quantum computing:\",\n    max_tokens=256,\n    stream=True\n):\n    print(chunk[\"choices\"][0][\"text\"], end=\"\", flush=True)\n```\n\n## Server mode\n\n### Start OpenAI-compatible server\n\n```bash\n# Start server\n.\u002Fllama-server -m model-q4_k_m.gguf \\\n    --host 0.0.0.0 \\\n    --port 8080 \\\n    -ngl 35 \\\n    -c 4096\n\n# Or with Python bindings\npython -m llama_cpp.server \\\n    --model model-q4_k_m.gguf \\\n    --n_gpu_layers 35 \\\n    --host 0.0.0.0 \\\n    --port 8080\n```\n\n### Use with OpenAI client\n\n```python\nfrom openai import OpenAI\n\nclient = OpenAI(\n    base_url=\"http:\u002F\u002Flocalhost:8080\u002Fv1\",\n    api_key=\"not-needed\"\n)\n\nresponse = client.chat.completions.create(\n    model=\"local-model\",\n    messages=[{\"role\": \"user\", \"content\": \"Hello!\"}],\n    max_tokens=256\n)\nprint(response.choices[0].message.content)\n```\n\n## Hardware optimization\n\n### Apple Silicon (Metal)\n\n```bash\n# Build with Metal\nmake clean && make GGML_METAL=1\n\n# Run with Metal acceleration\n.\u002Fllama-cli -m model.gguf -ngl 99 -p \"Hello\"\n\n# Python with Metal\nllm = Llama(\n    model_path=\"model.gguf\",\n    n_gpu_layers=99,     # Offload all layers\n    n_threads=1          # Metal handles parallelism\n)\n```\n\n### NVIDIA CUDA\n\n```bash\n# Build with CUDA\nmake clean && make GGML_CUDA=1\n\n# Run with CUDA\n.\u002Fllama-cli -m model.gguf -ngl 35 -p \"Hello\"\n\n# Specify GPU\nCUDA_VISIBLE_DEVICES=0 .\u002Fllama-cli -m model.gguf -ngl 35\n```\n\n### CPU optimization\n\n```bash\n# Build with AVX2\u002FAVX512\nmake clean && make\n\n# Run with optimal threads\n.\u002Fllama-cli -m model.gguf -t 8 -p \"Hello\"\n\n# Python CPU config\nllm = Llama(\n    model_path=\"model.gguf\",\n    n_gpu_layers=0,      # CPU only\n    n_threads=8,         # Match physical cores\n    n_batch=512          # Batch size for prompt processing\n)\n```\n\n## Integration with tools\n\n### Ollama\n\n```bash\n# Create Modelfile\ncat > Modelfile \u003C\u003C 'EOF'\nFROM .\u002Fmodel-q4_k_m.gguf\nTEMPLATE \"\"\"{{ .System }}\n{{ .Prompt }}\"\"\"\nPARAMETER temperature 0.7\nPARAMETER num_ctx 4096\nEOF\n\n# Create Ollama model\nollama create mymodel -f Modelfile\n\n# Run\nollama run mymodel \"Hello!\"\n```\n\n### LM Studio\n\n1. Place GGUF file in `~\u002F.cache\u002Flm-studio\u002Fmodels\u002F`\n2. Open LM Studio and select the model\n3. Configure context length and GPU offload\n4. Start inference\n\n### text-generation-webui\n\n```bash\n# Place in models folder\ncp model-q4_k_m.gguf text-generation-webui\u002Fmodels\u002F\n\n# Start with llama.cpp loader\npython server.py --model model-q4_k_m.gguf --loader llama.cpp --n-gpu-layers 35\n```\n\n## Best practices\n\n1. **Use K-quants**: Q4_K_M offers best quality\u002Fsize balance\n2. **Use imatrix**: Always use importance matrix for Q4 and below\n3. **GPU offload**: Offload as many layers as VRAM allows\n4. **Context length**: Start with 4096, increase if needed\n5. **Thread count**: Match physical CPU cores, not logical\n6. **Batch size**: Increase n_batch for faster prompt processing\n\n## Common issues\n\n**Model loads slowly:**\n```bash\n# Use mmap for faster loading\n.\u002Fllama-cli -m model.gguf --mmap\n```\n\n**Out of memory:**\n```bash\n# Reduce GPU layers\n.\u002Fllama-cli -m model.gguf -ngl 20  # Reduce from 35\n\n# Or use smaller quantization\n.\u002Fllama-quantize model-f16.gguf model-q3_k_m.gguf Q3_K_M\n```\n\n**Poor quality at low bits:**\n```bash\n# Always use imatrix for Q4 and below\n.\u002Fllama-imatrix -m model-f16.gguf -f calibration.txt -o model.imatrix\n.\u002Fllama-quantize --imatrix model.imatrix model-f16.gguf model-q4_k_m.gguf Q4_K_M\n```\n\n## References\n\n- **[Advanced Usage](references\u002Fadvanced-usage.md)** - Batching, speculative decoding, custom builds\n- **[Troubleshooting](references\u002Ftroubleshooting.md)** - Common issues, debugging, benchmarks\n\n## Resources\n\n- **Repository**: https:\u002F\u002Fgithub.com\u002Fggml-org\u002Fllama.cpp\n- **Python Bindings**: https:\u002F\u002Fgithub.com\u002Fabetlen\u002Fllama-cpp-python\n- **Pre-quantized Models**: https:\u002F\u002Fhuggingface.co\u002FTheBloke\n- **GGUF Converter**: https:\u002F\u002Fhuggingface.co\u002Fspaces\u002Fggml-org\u002Fgguf-my-repo\n- **License**: MIT\n",{"name":5,"license":16,"metadata":60,"description":7},{"tags":61,"author":64,"version":65,"dependencies":66},[33,62,40,39,63,38,31],"Quantization","Apple Silicon","Orchestra Research","1.0.0",[67],"llama-cpp-python>=0.2.0","main","2b749c82b5d11fac39d9a6e021ce3f5b8a541bd1","cli-tool\u002Fcomponents\u002Fskills\u002Fai-research\u002Foptimization-gguf",3963,"https:\u002F\u002Fgithub.com\u002Fdavila7\u002Fclaude-code-templates","https:\u002F\u002Faitmpl.com","https:\u002F\u002Fgithub.com\u002Fdavila7","https:\u002F\u002Fdanielavila.me","Building AI dev tools with LLMs","2026-11-15 01:32:48",{"source":9,"skillName":5,"commands":79,"prompt":89,"zipAvailable":90},[80,83,86],{"tool":81,"command":82},"npx","npx skills add davila7\u002Fclaude-code-templates --skill optimization-gguf",{"tool":84,"command":85},"bunx","bunx skills add davila7\u002Fclaude-code-templates --skill optimization-gguf",{"tool":87,"command":88},"pnpm","pnpm dlx skills add davila7\u002Fclaude-code-templates --skill optimization-gguf","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fdavila7\u002Fclaude-code-templates\u002Fblob\u002Fmain\u002Fcli-tool\u002Fcomponents\u002Fskills\u002Fai-research\u002Foptimization-gguf\u002FSKILL.md",true,[92,98,104,108,112,116,120,124,128,132,136,140,144,148,152,156,160,164,168,172,176,180,184,188,192,196,200,204,208,212,216,220,226,230,234,238],{"path":93,"resourceType":94,"resourceTypeDesc":95,"sizeBytes":96,"sourceHtmlUrl":97},"recipes\u002Fenv.example","OTHER","其他",2900,"https:\u002F\u002Fgithub.com\u002FNVIDIA\u002FModel-Optimizer\u002Fblob\u002Fmain\u002Fplugins\u002Fmodelopt\u002Fskills\u002Fevaluation\u002Frecipes\u002Fenv.example",{"path":99,"resourceType":100,"resourceTypeDesc":101,"sizeBytes":102,"sourceHtmlUrl":103},"recipes\u002Fexamples\u002Fexample_eval_next.yaml","REFERENCE","参考文档",8479,"https:\u002F\u002Fgithub.com\u002FNVIDIA\u002FModel-Optimizer\u002Fblob\u002Fmain\u002Fplugins\u002Fmodelopt\u002Fskills\u002Fevaluation\u002Frecipes\u002Fexamples\u002Fexample_eval_next.yaml",{"path":105,"resourceType":100,"resourceTypeDesc":101,"sizeBytes":106,"sourceHtmlUrl":107},"recipes\u002Fexamples\u002Fexample_eval.yaml",11425,"https:\u002F\u002Fgithub.com\u002FNVIDIA\u002FModel-Optimizer\u002Fblob\u002Fmain\u002Fplugins\u002Fmodelopt\u002Fskills\u002Fevaluation\u002Frecipes\u002Fexamples\u002Fexample_eval.yaml",{"path":109,"resourceType":100,"resourceTypeDesc":101,"sizeBytes":110,"sourceHtmlUrl":111},"recipes\u002Fexamples\u002Fgym\u002Fexample_mrcr.yaml",18612,"https:\u002F\u002Fgithub.com\u002FNVIDIA\u002FModel-Optimizer\u002Fblob\u002Fmain\u002Fplugins\u002Fmodelopt\u002Fskills\u002Fevaluation\u002Frecipes\u002Fexamples\u002Fgym\u002Fexample_mrcr.yaml",{"path":113,"resourceType":100,"resourceTypeDesc":101,"sizeBytes":114,"sourceHtmlUrl":115},"recipes\u002Ftasks\u002Faa_next\u002Fswebench_verified.md",9597,"https:\u002F\u002Fgithub.com\u002FNVIDIA\u002FModel-Optimizer\u002Fblob\u002Fmain\u002Fplugins\u002Fmodelopt\u002Fskills\u002Fevaluation\u002Frecipes\u002Ftasks\u002Faa_next\u002Fswebench_verified.md",{"path":117,"resourceType":100,"resourceTypeDesc":101,"sizeBytes":118,"sourceHtmlUrl":119},"recipes\u002Ftasks\u002Faa_next\u002Fterminal_bench_2_1.md",9394,"https:\u002F\u002Fgithub.com\u002FNVIDIA\u002FModel-Optimizer\u002Fblob\u002Fmain\u002Fplugins\u002Fmodelopt\u002Fskills\u002Fevaluation\u002Frecipes\u002Ftasks\u002Faa_next\u002Fterminal_bench_2_1.md",{"path":121,"resourceType":100,"resourceTypeDesc":101,"sizeBytes":122,"sourceHtmlUrl":123},"recipes\u002Ftasks\u002Faa\u002Fgpqa_diamond.md",808,"https:\u002F\u002Fgithub.com\u002FNVIDIA\u002FModel-Optimizer\u002Fblob\u002Fmain\u002Fplugins\u002Fmodelopt\u002Fskills\u002Fevaluation\u002Frecipes\u002Ftasks\u002Faa\u002Fgpqa_diamond.md",{"path":125,"resourceType":100,"resourceTypeDesc":101,"sizeBytes":126,"sourceHtmlUrl":127},"recipes\u002Ftasks\u002Faa\u002Fhle.md",1680,"https:\u002F\u002Fgithub.com\u002FNVIDIA\u002FModel-Optimizer\u002Fblob\u002Fmain\u002Fplugins\u002Fmodelopt\u002Fskills\u002Fevaluation\u002Frecipes\u002Ftasks\u002Faa\u002Fhle.md",{"path":129,"resourceType":100,"resourceTypeDesc":101,"sizeBytes":130,"sourceHtmlUrl":131},"recipes\u002Ftasks\u002Faa\u002Fifbench.md",585,"https:\u002F\u002Fgithub.com\u002FNVIDIA\u002FModel-Optimizer\u002Fblob\u002Fmain\u002Fplugins\u002Fmodelopt\u002Fskills\u002Fevaluation\u002Frecipes\u002Ftasks\u002Faa\u002Fifbench.md",{"path":133,"resourceType":100,"resourceTypeDesc":101,"sizeBytes":134,"sourceHtmlUrl":135},"recipes\u002Ftasks\u002Faa\u002Flcr.md",3120,"https:\u002F\u002Fgithub.com\u002FNVIDIA\u002FModel-Optimizer\u002Fblob\u002Fmain\u002Fplugins\u002Fmodelopt\u002Fskills\u002Fevaluation\u002Frecipes\u002Ftasks\u002Faa\u002Flcr.md",{"path":137,"resourceType":100,"resourceTypeDesc":101,"sizeBytes":138,"sourceHtmlUrl":139},"recipes\u002Ftasks\u002Faa\u002Fmmmu_pro.md",546,"https:\u002F\u002Fgithub.com\u002FNVIDIA\u002FModel-Optimizer\u002Fblob\u002Fmain\u002Fplugins\u002Fmodelopt\u002Fskills\u002Fevaluation\u002Frecipes\u002Ftasks\u002Faa\u002Fmmmu_pro.md",{"path":141,"resourceType":100,"resourceTypeDesc":101,"sizeBytes":142,"sourceHtmlUrl":143},"recipes\u002Ftasks\u002Faa\u002Fomniscience.md",2189,"https:\u002F\u002Fgithub.com\u002FNVIDIA\u002FModel-Optimizer\u002Fblob\u002Fmain\u002Fplugins\u002Fmodelopt\u002Fskills\u002Fevaluation\u002Frecipes\u002Ftasks\u002Faa\u002Fomniscience.md",{"path":145,"resourceType":100,"resourceTypeDesc":101,"sizeBytes":146,"sourceHtmlUrl":147},"recipes\u002Ftasks\u002Faa\u002Fscicode.md",3682,"https:\u002F\u002Fgithub.com\u002FNVIDIA\u002FModel-Optimizer\u002Fblob\u002Fmain\u002Fplugins\u002Fmodelopt\u002Fskills\u002Fevaluation\u002Frecipes\u002Ftasks\u002Faa\u002Fscicode.md",{"path":149,"resourceType":100,"resourceTypeDesc":101,"sizeBytes":150,"sourceHtmlUrl":151},"recipes\u002Ftasks\u002Faa\u002Ftau2_bench_telecom.md",3193,"https:\u002F\u002Fgithub.com\u002FNVIDIA\u002FModel-Optimizer\u002Fblob\u002Fmain\u002Fplugins\u002Fmodelopt\u002Fskills\u002Fevaluation\u002Frecipes\u002Ftasks\u002Faa\u002Ftau2_bench_telecom.md",{"path":153,"resourceType":100,"resourceTypeDesc":101,"sizeBytes":154,"sourceHtmlUrl":155},"recipes\u002Ftasks\u002Faime_2025.md",1571,"https:\u002F\u002Fgithub.com\u002FNVIDIA\u002FModel-Optimizer\u002Fblob\u002Fmain\u002Fplugins\u002Fmodelopt\u002Fskills\u002Fevaluation\u002Frecipes\u002Ftasks\u002Faime_2025.md",{"path":157,"resourceType":100,"resourceTypeDesc":101,"sizeBytes":158,"sourceHtmlUrl":159},"recipes\u002Ftasks\u002Fgym\u002Fmrcr.md",12563,"https:\u002F\u002Fgithub.com\u002FNVIDIA\u002FModel-Optimizer\u002Fblob\u002Fmain\u002Fplugins\u002Fmodelopt\u002Fskills\u002Fevaluation\u002Frecipes\u002Ftasks\u002Fgym\u002Fmrcr.md",{"path":161,"resourceType":100,"resourceTypeDesc":101,"sizeBytes":162,"sourceHtmlUrl":163},"recipes\u002Ftasks\u002Flivecodebench.md",1628,"https:\u002F\u002Fgithub.com\u002FNVIDIA\u002FModel-Optimizer\u002Fblob\u002Fmain\u002Fplugins\u002Fmodelopt\u002Fskills\u002Fevaluation\u002Frecipes\u002Ftasks\u002Flivecodebench.md",{"path":165,"resourceType":100,"resourceTypeDesc":101,"sizeBytes":166,"sourceHtmlUrl":167},"recipes\u002Ftasks\u002Fmmlu_pro.md",735,"https:\u002F\u002Fgithub.com\u002FNVIDIA\u002FModel-Optimizer\u002Fblob\u002Fmain\u002Fplugins\u002Fmodelopt\u002Fskills\u002Fevaluation\u002Frecipes\u002Ftasks\u002Fmmlu_pro.md",{"path":169,"resourceType":100,"resourceTypeDesc":101,"sizeBytes":170,"sourceHtmlUrl":171},"references\u002Fadvanced-usage.md",10887,"https:\u002F\u002Fgithub.com\u002Fdavila7\u002Fclaude-code-templates\u002Fblob\u002Fmain\u002Fcli-tool\u002Fcomponents\u002Fskills\u002Fai-research\u002Foptimization-gguf\u002Freferences\u002Fadvanced-usage.md",{"path":173,"resourceType":100,"resourceTypeDesc":101,"sizeBytes":174,"sourceHtmlUrl":175},"references\u002Fdoom_loops.md",3918,"https:\u002F\u002Fgithub.com\u002FNVIDIA\u002FModel-Optimizer\u002Fblob\u002Fmain\u002Fplugins\u002Fmodelopt\u002Fskills\u002Fevaluation\u002Freferences\u002Fdoom_loops.md",{"path":177,"resourceType":100,"resourceTypeDesc":101,"sizeBytes":178,"sourceHtmlUrl":179},"references\u002Fgym.md",10162,"https:\u002F\u002Fgithub.com\u002FNVIDIA\u002FModel-Optimizer\u002Fblob\u002Fmain\u002Fplugins\u002Fmodelopt\u002Fskills\u002Fevaluation\u002Freferences\u002Fgym.md",{"path":181,"resourceType":100,"resourceTypeDesc":101,"sizeBytes":182,"sourceHtmlUrl":183},"references\u002Flauncher-workflow.md",38874,"https:\u002F\u002Fgithub.com\u002FNVIDIA\u002FModel-Optimizer\u002Fblob\u002Fmain\u002Fplugins\u002Fmodelopt\u002Fskills\u002Fevaluation\u002Freferences\u002Flauncher-workflow.md",{"path":185,"resourceType":100,"resourceTypeDesc":101,"sizeBytes":186,"sourceHtmlUrl":187},"references\u002Fmodel-card-research.md",7065,"https:\u002F\u002Fgithub.com\u002FNVIDIA\u002FModel-Optimizer\u002Fblob\u002Fmain\u002Fplugins\u002Fmodelopt\u002Fskills\u002Fevaluation\u002Freferences\u002Fmodel-card-research.md",{"path":189,"resourceType":100,"resourceTypeDesc":101,"sizeBytes":190,"sourceHtmlUrl":191},"references\u002Fmulti-node.md",1781,"https:\u002F\u002Fgithub.com\u002FNVIDIA\u002FModel-Optimizer\u002Fblob\u002Fmain\u002Fplugins\u002Fmodelopt\u002Fskills\u002Fevaluation\u002Freferences\u002Fmulti-node.md",{"path":193,"resourceType":100,"resourceTypeDesc":101,"sizeBytes":194,"sourceHtmlUrl":195},"references\u002Fnel-next.md",16468,"https:\u002F\u002Fgithub.com\u002FNVIDIA\u002FModel-Optimizer\u002Fblob\u002Fmain\u002Fplugins\u002Fmodelopt\u002Fskills\u002Fevaluation\u002Freferences\u002Fnel-next.md",{"path":197,"resourceType":100,"resourceTypeDesc":101,"sizeBytes":198,"sourceHtmlUrl":199},"references\u002Fnvfp4-modelcard-sampling.md",9352,"https:\u002F\u002Fgithub.com\u002FNVIDIA\u002FModel-Optimizer\u002Fblob\u002Fmain\u002Fplugins\u002Fmodelopt\u002Fskills\u002Fevaluation\u002Freferences\u002Fnvfp4-modelcard-sampling.md",{"path":201,"resourceType":100,"resourceTypeDesc":101,"sizeBytes":202,"sourceHtmlUrl":203},"references\u002Fparallelism.md",8830,"https:\u002F\u002Fgithub.com\u002FNVIDIA\u002FModel-Optimizer\u002Fblob\u002Fmain\u002Fplugins\u002Fmodelopt\u002Fskills\u002Fevaluation\u002Freferences\u002Fparallelism.md",{"path":205,"resourceType":100,"resourceTypeDesc":101,"sizeBytes":206,"sourceHtmlUrl":207},"references\u002Fquantization-benchmarks.md",7150,"https:\u002F\u002Fgithub.com\u002FNVIDIA\u002FModel-Optimizer\u002Fblob\u002Fmain\u002Fplugins\u002Fmodelopt\u002Fskills\u002Fevaluation\u002Freferences\u002Fquantization-benchmarks.md",{"path":209,"resourceType":100,"resourceTypeDesc":101,"sizeBytes":210,"sourceHtmlUrl":211},"references\u002Frun-validation.md",12614,"https:\u002F\u002Fgithub.com\u002FNVIDIA\u002FModel-Optimizer\u002Fblob\u002Fmain\u002Fplugins\u002Fmodelopt\u002Fskills\u002Fevaluation\u002Freferences\u002Frun-validation.md",{"path":213,"resourceType":100,"resourceTypeDesc":101,"sizeBytes":214,"sourceHtmlUrl":215},"references\u002Fslurm.md",1618,"https:\u002F\u002Fgithub.com\u002FNVIDIA\u002FModel-Optimizer\u002Fblob\u002Fmain\u002Fplugins\u002Fmodelopt\u002Fskills\u002Fevaluation\u002Freferences\u002Fslurm.md",{"path":217,"resourceType":100,"resourceTypeDesc":101,"sizeBytes":218,"sourceHtmlUrl":219},"references\u002Ftroubleshooting.md",8904,"https:\u002F\u002Fgithub.com\u002Fdavila7\u002Fclaude-code-templates\u002Fblob\u002Fmain\u002Fcli-tool\u002Fcomponents\u002Fskills\u002Fai-research\u002Foptimization-gguf\u002Freferences\u002Ftroubleshooting.md",{"path":221,"resourceType":222,"resourceTypeDesc":223,"sizeBytes":224,"sourceHtmlUrl":225},"scripts\u002Fnel-gym.sh","SCRIPT","脚本",1233,"https:\u002F\u002Fgithub.com\u002FNVIDIA\u002FModel-Optimizer\u002Fblob\u002Fmain\u002Fplugins\u002Fmodelopt\u002Fskills\u002Fevaluation\u002Fscripts\u002Fnel-gym.sh",{"path":227,"resourceType":222,"resourceTypeDesc":223,"sizeBytes":228,"sourceHtmlUrl":229},"scripts\u002Fnel-next.sh",7940,"https:\u002F\u002Fgithub.com\u002FNVIDIA\u002FModel-Optimizer\u002Fblob\u002Fmain\u002Fplugins\u002Fmodelopt\u002Fskills\u002Fevaluation\u002Fscripts\u002Fnel-next.sh",{"path":231,"resourceType":100,"resourceTypeDesc":101,"sizeBytes":232,"sourceHtmlUrl":233},"tests\u002Fevals.json",21127,"https:\u002F\u002Fgithub.com\u002FNVIDIA\u002FModel-Optimizer\u002Fblob\u002Fmain\u002Fplugins\u002Fmodelopt\u002Fskills\u002Fevaluation\u002Ftests\u002Fevals.json",{"path":235,"resourceType":222,"resourceTypeDesc":223,"sizeBytes":236,"sourceHtmlUrl":237},"tests\u002Ftest_example_mrcr.py",6239,"https:\u002F\u002Fgithub.com\u002FNVIDIA\u002FModel-Optimizer\u002Fblob\u002Fmain\u002Fplugins\u002Fmodelopt\u002Fskills\u002Fevaluation\u002Ftests\u002Ftest_example_mrcr.py",{"path":239,"resourceType":222,"resourceTypeDesc":223,"sizeBytes":240,"sourceHtmlUrl":241},"tests\u002Ftest_nel_gym.py",1630,"https:\u002F\u002Fgithub.com\u002FNVIDIA\u002FModel-Optimizer\u002Fblob\u002Fmain\u002Fplugins\u002Fmodelopt\u002Fskills\u002Fevaluation\u002Ftests\u002Ftest_nel_gym.py",[243,267,293,317,357,385],{"skillNo":244,"name":245,"nameZh":17,"description":246,"descriptionZh":17,"repositoryFullName":9,"ownerLogin":10,"ownerAvatarUrl":11,"ownerAccountNo":12,"ownerDisplayName":13,"repositoryNo":14,"starsCount":15,"licenseSpdxId":16,"licenseFileUrl":17,"sourceHtmlUrl":247,"categories":248,"keywords":249,"publishedAt":55},"01M70NHBTQ8BV0A2SCAZXEPHCX","wealthville-pool-scoring","Score DeFi liquidity pools before providing liquidity. Returns a 0-100 pool score and an Enter\u002FHold\u002FExit\u002FReduce\u002FAvoid verdict with calibrated confidence for ~68,800 Solana pools and 575 EVM pools, plus a public miss-inclusive track record. Use when asked whether a pool is worth LPing into, which pools look best right now, or how accurate the scores have actually been.","https:\u002F\u002Fgithub.com\u002Fdavila7\u002Fclaude-code-templates\u002Fblob\u002Fmain\u002Fcli-tool\u002Fcomponents\u002Fskills\u002Fweb-data\u002Fwealthville-pool-scoring\u002FSKILL.md",[],[250,251,252,253,254,36,255,256,46,35,257,258,259,260,261,262,263,264,265,266],"scoring","pool","wealthville pool scoring","liquidity","which","exit","now","reduce","with","record","track","verdict","evm","solana","how","public","look",{"skillNo":268,"name":269,"nameZh":17,"description":270,"descriptionZh":17,"repositoryFullName":9,"ownerLogin":10,"ownerAvatarUrl":11,"ownerAccountNo":12,"ownerDisplayName":13,"repositoryNo":14,"starsCount":15,"licenseSpdxId":16,"licenseFileUrl":17,"sourceHtmlUrl":271,"categories":272,"keywords":273,"publishedAt":55},"01M70MB6VR8ERJ4EM8D5KHBMEV","technical-debt-auditor","Scans a codebase and produces a quantified technical debt report with a prioritized remediation plan. Analyzes dead code, TODO\u002FFIXME\u002FHACK markers, dependency staleness, complexity hotspots, code duplication signals, test coverage gaps, unused exports, and outdated patterns. Use this skill when the user asks to audit their codebase for tech debt, wants a health check of their code quality, says things like \"where should I focus refactoring\", \"find code smells\", \"audit my codebase\", \"what technical debt do we have\", \"prioritize cleanup work\", or asks about code quality metrics. Also trigger when the user mentions \"code rot\", \"legacy cleanup\", \"refactoring priorities\", or wants to understand the overall health of a project before a major effort. Trigger even if the user doesn't say \"technical debt\" explicitly — any request to systematically assess code quality and identify improvement priorities belongs here.","https:\u002F\u002Fgithub.com\u002Fdavila7\u002Fclaude-code-templates\u002Fblob\u002Fmain\u002Fcli-tool\u002Fcomponents\u002Fskills\u002Fdevelopment\u002Ftechnical-debt-auditor\u002FSKILL.md",[],[274,275,276,277,278,279,280,281,282,283,284,35,285,286,287,288,289,290,291,292],"technical debt","debt","technical","technical debt auditor","auditor","coverage","complexity","markers","project","cleanup","unused","code","todo","work","plan","focus","signals","audit","dependency",{"skillNo":294,"name":295,"nameZh":17,"description":296,"descriptionZh":17,"repositoryFullName":9,"ownerLogin":10,"ownerAvatarUrl":11,"ownerAccountNo":12,"ownerDisplayName":13,"repositoryNo":14,"starsCount":15,"licenseSpdxId":16,"licenseFileUrl":17,"sourceHtmlUrl":297,"categories":298,"keywords":299,"publishedAt":55},"01M70KPYH9QNHCNME5GJQGE22K","readonly-sql-guard","Make an agent's database access provably read-only. Use when an agent runs caller-supplied SQL against a production\u002FERP\u002Fanalytics database (a \"query\" MCP tool, text-to-SQL, an admin console), or when reviewing DB-access code for write\u002FDDL\u002Fside-effect\u002Ftransaction-escape risks. Checks what a statement CALLS, not just its shape.","https:\u002F\u002Fgithub.com\u002Fdavila7\u002Fclaude-code-templates\u002Fblob\u002Fmain\u002Fcli-tool\u002Fcomponents\u002Fskills\u002Fdatabase\u002Freadonly-sql-guard\u002FSKILL.md",[],[300,301,302,303,304,305,306,36,307,308,309,310,311,312,313,46,314,315,35,316],"readonly","guard","sql guard","sql","readonly sql guard","erp","effect","read-only","db","just","tool","calls","only","MCP","access","database","query",{"skillNo":318,"name":319,"nameZh":320,"description":321,"descriptionZh":322,"repositoryFullName":9,"ownerLogin":10,"ownerAvatarUrl":11,"ownerAccountNo":12,"ownerDisplayName":13,"repositoryNo":14,"starsCount":15,"licenseSpdxId":323,"licenseFileUrl":324,"sourceHtmlUrl":325,"categories":326,"keywords":333,"publishedAt":55},"01M6AFY6F7CC2BBZP1QD6VTNVC","web-artifacts-builder","Claude 网页 Artifact 构建","Suite of tools for creating elaborate, multi-component claude.ai HTML artifacts using modern frontend web technologies (React, Tailwind CSS, shadcn\u002Fui). Use for complex artifacts requiring state management, routing, or shadcn\u002Fui components - not for simple single-file HTML\u002FJSX artifacts.","用于创建精细的、多组件的 claude.ai HTML artifact 的工具套件，采用现代前端 Web 技术（React、Tailwind CSS、shadcn\u002Fui）。适用于需要状态管理、路由或 shadcn\u002Fui 组件的复杂 artifact —— 不适用于简单的单文件 HTML\u002FJSX artifact。","Apache-2.0","https:\u002F\u002Fgithub.com\u002Fdavila7\u002Fclaude-code-templates\u002Fblob\u002Fmain\u002Fcli-tool\u002Fcomponents\u002Fskills\u002Futilities\u002Fweb-artifacts-builder\u002FLICENSE.txt","https:\u002F\u002Fgithub.com\u002Fdavila7\u002Fclaude-code-templates\u002Fblob\u002Fmain\u002Fcli-tool\u002Fcomponents\u002Fskills\u002Futilities\u002Fweb-artifacts-builder\u002FSKILL.md",[327,330],{"categoryNo":328,"categoryName":329,"taxonomyType":23,"taxonomyTypeDesc":24},"01M8BQ6TQZN6R52WBJ9H8NRMQM","软件开发工程师",{"categoryNo":331,"categoryName":332,"taxonomyType":28,"taxonomyTypeDesc":29},"01M8BRASNPVNJVQQJ4KZX8XM5D","前端开发与界面实现",[334,335,336,337,338,339,340,341,342,343,344,345,346,347,348,349,350,351,352,353,354,355,36,356],"artifacts builder","web","web artifacts builder","artifacts","builder","state","routing","state management","component","css","frontend","ui","Tools","file","components","shadcn","react","Tailwind","suite","jsx","html","single-file","ui components",{"skillNo":358,"name":359,"nameZh":360,"description":361,"descriptionZh":362,"repositoryFullName":9,"ownerLogin":10,"ownerAvatarUrl":11,"ownerAccountNo":12,"ownerDisplayName":13,"repositoryNo":14,"starsCount":15,"licenseSpdxId":323,"licenseFileUrl":363,"sourceHtmlUrl":364,"categories":365,"keywords":372,"publishedAt":55},"01M6AFWF33SFV9Z3SF4PEEE4BF","webapp-testing","Playwright Web 应用测试","Toolkit for interacting with and testing local web applications using Playwright. Supports verifying frontend functionality, debugging UI behavior, capturing browser screenshots, and viewing browser logs.","使用 Playwright 与本地 Web 应用进行交互和测试的工具包。支持验证前端功能、调试 UI 行为、捕获浏览器截图以及查看浏览器日志。","https:\u002F\u002Fgithub.com\u002Fdavila7\u002Fclaude-code-templates\u002Fblob\u002Fmain\u002Fcli-tool\u002Fcomponents\u002Fskills\u002Fsecurity\u002Fwebapp-testing\u002FLICENSE.txt","https:\u002F\u002Fgithub.com\u002Fdavila7\u002Fclaude-code-templates\u002Fblob\u002Fmain\u002Fcli-tool\u002Fcomponents\u002Fskills\u002Fsecurity\u002Fwebapp-testing\u002FSKILL.md",[366,369],{"categoryNo":367,"categoryName":368,"taxonomyType":23,"taxonomyTypeDesc":24},"01M8BQGD5WG86P4AQ5GPSSKBFR","测试工程师",{"categoryNo":370,"categoryName":371,"taxonomyType":28,"taxonomyTypeDesc":29},"01M8BQJH394GT47X57A9Q8G7HX","测试与质量保障",[373,374,375,376,377,335,378,344,345,379,380,381,382,36,383,258,384],"webapp testing","testing","webapp","browser","playwright","applications","debugging","toolkit","logs","screenshots","local","behavior",{"skillNo":386,"name":387,"nameZh":388,"description":389,"descriptionZh":390,"repositoryFullName":9,"ownerLogin":10,"ownerAvatarUrl":11,"ownerAccountNo":12,"ownerDisplayName":13,"repositoryNo":14,"starsCount":15,"licenseSpdxId":323,"licenseFileUrl":391,"sourceHtmlUrl":392,"categories":393,"keywords":400,"publishedAt":55},"01M6AF67Q67JJJ5V51JR2P52KA","discernment-nudge","回复事实核查追问","After you give a substantive answer or draft that the user may act on — advice or recommendations, drafted artifacts such as goals, plans, pitches, proposals, or emails, estimates or projections, analysis or interpretation of data, factual claims they may rely on, or a multi-step argument — invoke this skill BEFORE finalizing your reply and then, if it applies, append 2-3 short follow-up questions, each tied to something specific in what you just produced, that help the user check key facts, probe the reasoning or assumptions, and notice missing context. Do this at most once per conversation. Skip it when the user asked a trivial how-to or simple lookup, wants a purely educational explanation, asked you only to format, convert, or assemble a file from content they provided, is writing code they will run, is doing creative writing or casual chat, or already asked you to double-check, cite, or review — the skill file explains these boundaries and the exact output format.","在你给出用户可能据以行动的实质性答案或草稿之后——建议或推荐、起草的工件（如目标、计划、推介、提案或电子邮件）、估计或预测、数据分析或解读、他们可能依赖的事实声明，或多步骤论证——在最终确定回复之前调用本技能，然后，如适用，附加 2-3 个简短的后续问题，每个问题都与你刚刚产出的具体内容相关，帮助用户核查关键事实、探究推理或假设，并注意到缺失的上下文。每次对话最多执行一次。当用户询问琐碎的操作方法或简单查找、想要纯教育性解释、仅要求根据提供的内容格式化\u002F转换\u002F组装文件、正在编写将要运行的代码、正在进行创意写作或休闲聊天，或已经要求你复核、引用或审查时跳过——技能文件解释了这些边界和确切的输出格式。","https:\u002F\u002Fgithub.com\u002Fdavila7\u002Fclaude-code-templates\u002Fblob\u002Fmain\u002Fcli-tool\u002Fcomponents\u002Fskills\u002Fproductivity\u002Fdiscernment-nudge\u002FLICENSE.txt","https:\u002F\u002Fgithub.com\u002Fdavila7\u002Fclaude-code-templates\u002Fblob\u002Fmain\u002Fcli-tool\u002Fcomponents\u002Fskills\u002Fproductivity\u002Fdiscernment-nudge\u002FSKILL.md",[394,397],{"categoryNo":395,"categoryName":396,"taxonomyType":28,"taxonomyTypeDesc":29},"01M8BQ6TMSBZZX4V1THHNVC815","回答复核",{"categoryNo":398,"categoryName":399,"taxonomyType":23,"taxonomyTypeDesc":24},"01M8BS5011KJDVSRXG1DC4P666","普通用户",[401,402,403,404,405,406,407,408,337,409,347,285,410,411,412,413,414,312,415,35,416,417,418,419,420,264,421],"discernment nudge","nudge","interpretation","help","run","reasoning","data","writing","lookup","content","review","conversation","short","up","invoke","you","analysis","claims","argument","assemble","recommendations"]