llama
Skill15 starsChanged 44 days agoMITView on GitHub
Expert Meta Llama (Llama 3 / 3.2 / 3.3) assistance covering fine-tuning (LoRA/QLoRA), vLLM deployment, and prompt templates. Use when deploying open-weight foundation models locally or in the cloud.
In this repository350 other files it gives its agents.
- airflowSkill
- catboostSkill
- claudeSkill
- comfyuiSkill
- cursor-aiSkill
- dalleSkill
- daskSkill
- dbtSkill
- deepseekSkill
- fastaiSkill
- geminiSkill
- github-copilotSkill
- huggingfaceSkill
- jaxSkill
- jupyterSkill
- kerasSkill
- langchainSkill
- lightgbmSkill
- llamaindexSkill
- matplotlibSkill
- midjourneySkill
- mistralSkill
- mlflowSkill
- nltkSkill
- numpySkill
- ollamaSkill
- openai-gptSkill
- opencvSkill
- pandasSkill
- perplexitySkill
- plotlySkill
- polarsSkill
- pytorchSkill
- raySkill
- scikit-learnSkill
- seabornSkill
- spacySkill
- sparkSkill
- stable-diffusionSkill
- tensorflowSkill
- vaexSkill
- weights-biasesSkill
- whisperSkill
- xgboostSkill
- api-gatewaySkill
- clean-architectureSkill
- cqrsSkill
- domain-driven-designSkill
- event-drivenSkill
- event-sourcingSkill
- graphqlSkill
- grpcSkill
- hexagonalSkill
- microservicesSkill
- modular-monolithSkill
- monolithSkill
- rest-apiSkill
- sagaSkill
- serverlessSkill
- service-meshSkill
- The first 60 shown.
The file
We split this skill into the rules it gives an agent
4 rules. About 0 are common, 2 are distinctive, and 2 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈2
Distinctive · estimate
This author's own choices. Worth a look.
2
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 118
Use GGUF 4-bit (Q4_K_M) or 5-bit (Q5_K_M) quantization for optimal balance of speed and perplexity.
- Very specific: line 120
Use Meta Llama 3 prompt template formatting (<|start_header_id|>...<|end_header_id|>) for accurate instruction following.
- Distinctive: line 125
Run unquantized 16-bit models on consumer GPUs if memory capacity causes swap thrashing.
- Distinctive: line 127
Use chat models without supplying system prompts specifying constraints and formatting rules.
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Llama
Meta Llama is the foundation standard for open-weight language models, providing dense and Mixture-of-Experts architectures optimized for fine-tuning, quantization, and local deployment.
When to Use
- Local & On-Premise LLM Deployment: Running Meta Llama 3.1/3.2/3.3 locally without data leaving the private perimeter.
- High-Efficiency Quantized Inference: Utilizing GGUF (via llama.cpp) and AWQ/GPTQ on consumer and enterprise GPUs.
- Fine-Tuning on Custom Domain Data: Training LoRA/QLoRA adapters with Unsloth or Axolotl.
- Embedded & Mobile Edge AI: Running lightweight Llama 3.2 1B and 3B models directly on laptops and mobile devices.
Quick Start
# Serve Llama 3 with vLLM for high-throughput OpenAI-compatible inference
vLLM serve meta-llama/Llama-3.2-3B-Instruct \
--port 8000 \
--max-model-len 8192 \
--gpu-memory-utilization 0.90Core Concepts
Local GGUF Inference with llama-cpp-python
Fast, low-latency CPU/GPU inference with zero external network calls:
from llama_cpp import Llama
# Load GGUF model with GPU layer offloading
llm = Llama(
model_path="./models/Meta-Llama-3.1-8B-Instruct-Q4_K_M.gguf",
n_gpu_layers=-1, # Offload all layers to GPU (Metal / CUDA)
n_ctx=8192, # Context window
verbose=False
)
# Chat completion with standard Llama 3 instruction prompt format
response = llm.create_chat_completion(
messages=[
{"role": "system", "content": "You are a concise Unix systems administrator."},
{"role": "user", "content": "How do I find processes holding open deleted files?"}
],
temperature=0.2,
max_tokens=256
)
print(response["choices"][0]["message"]["content"])Serving Llama via vLLM with OpenAI API Compatibility
Deploying Llama 3.1 as an enterprise production endpoint:
# Launch vLLM server with tensor parallelism and 16k context window
vllm serve meta-llama/Llama-3.1-8B-Instruct \
--dtype bfloat16 \
--max-model-len 16384 \
--port 8000Parameter-Efficient Fine-Tuning with LoRA & PEFT
Adapting Llama to domain specific instructions:
from peft import LoraConfig, get_peft_model
from transformers import AutoModelForCausalLM
model = AutoModelForCausalLM.from_pretrained("meta-llama/Llama-3.2-3B-Instruct", device_map="auto")
lora_config = LoraConfig(
r=16,
lora_alpha=32,
target_modules=["q_proj", "v_proj", "k_proj", "o_proj"],
lora_dropout=0.05,
bias="none",
task_type="CAUSAL_LM"
)
peft_model = get_peft_model(model, lora_config)
peft_model.print_trainable_parameters()Common Patterns
Official Llama 3 Chat Template Formatting
Problem: Incorrect header formatting degrades instruction following and triggers repetition loops.
Solution: Apply tokenizer chat template:
from transformers import AutoTokenizer
tokenizer = AutoTokenizer.from_pretrained("meta-llama/Llama-3.2-3B-Instruct")
messages = [
{"role": "system", "content": "You are a concise programming assistant."},
{"role": "user", "content": "Write a quicksort function in Python."}
]
prompt = tokenizer.apply_chat_template(messages, tokenize=False, add_generation_prompt=True)
# Formats into: <|begin_of_text|><|start_header_id|>system<|end_header_id|>...Best Practices
Do:
- Use GGUF 4-bit (
Q4_K_M) or 5-bit (Q5_K_M) quantization for optimal balance of speed and perplexity. - Offload all layers (
n_gpu_layers=-1) to GPU memory whenever VRAM capacity allows. - Use Meta Llama 3 prompt template formatting (
<|start_header_id|>...<|end_header_id|>) for accurate instruction following. - Pin model versions and test against specific release tags (e.g.
Llama-3.1-8B-Instruct).
Don't:
- Run unquantized 16-bit models on consumer GPUs if memory capacity causes swap thrashing.
- Forget to configure appropriate context lengths (
n_ctx); exceeding default context degrades performance. - Use chat models without supplying system prompts specifying constraints and formatting rules.
Troubleshooting
| Error | Cause | Solution |
403 Client Error: Cannot access repository | Missing access approval for Llama model on Hugging Face. | Request model access on Meta/HuggingFace and provide Hugging Face token. |
Model generating endless repetition tokens | Missing stop tokens in inference generation config. | Configure explicit stop tokens: <|eot_id|> and <|end_of_text|>. |
CUDA out of memory during vLLM serve | KV cache memory allocation exceeds available VRAM. | Lower --gpu-memory-utilization or reduce --max-model-len. |
References
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

