How meta-llama/llama-models works
This repository distributes Llama model assets and provides a CLI for cataloguing, downloading, verifying, and removing them, plus native Llama 3 and Llama 4 inference code. The main usage paths are CLI request → model catalog/download → local checkpoint, and prompt → model-specific inference entry point → generated text. Llama 4 also includes image preprocessing and vision components; quantization is an optional inference path. The README documents these capabilities; sampled source confirms selected implementations, so unsampled wiring is left unspecified.
Main entry points: cli Model CLI Commands · generation.py Llama 3 Generation · checkpoint.py Local Checkpoints · download.py Download Command
Components 25
Model CLI
- CLI Router
models/cli/llama.py - Download Command
models/cli/download.py - Verify Download
models/cli/verify_download.py - Remove Model
models/cli/remove.py - Describe Model
models/cli/describe.py - Prompt Format
models/cli/prompt_format.py - Model CLI Commands
models/cli
Model Assets
- Model Catalog
models/sku_list.py - Local Checkpoints
models/checkpoint.py
Llama 3 Runtime
- Llama 3 Scripts
models/llama3/scripts - Llama 3 Generation
models/llama3/generation.py - Chat Formatting
models/llama3/chat_format.py - Llama 3 Tokenizer
models/llama3/tokenizer.py - Llama 3 Model
models/llama3/model.py
Llama 4 Runtime
- Llama 4 Scripts
models/llama4/scripts - Llama 4 Generation
models/llama4/generation.py - Llama 4 Model
models/llama4/model.py - Image Preprocessing
models/llama4/preprocess.py - Vision Encoder
models/llama4/vision/encoder.py - Vision Embeddings
models/llama4/vision/embedding.py
Quantization
- Llama 3 Quantization
models/llama3/quantization/loader.py - Llama 4 Quantization
models/llama4/quantization/loader.py - Quantization Kernels
models/quantize_impls.py
Other components
- Developer
- Meta / Hugging Face
Connections 29
- Developer → CLI Router: runs commands
- CLI Router → Model CLI Commands: dispatches
- Model CLI Commands → Model Catalog: lists models
- Model CLI Commands → Describe Model: dispatches
- Model CLI Commands → Download Command: dispatches
- Model CLI Commands → Verify Download: dispatches
- Model CLI Commands → Remove Model: dispatches
- Model CLI Commands → Prompt Format: dispatches
- Download Command → Model Catalog: selects model
- Download Command → Meta / Hugging Face: downloads from
- Download Command → Local Checkpoints: writes files
- Verify Download → Local Checkpoints: checks files
- Remove Model → Local Checkpoints: removes files
- Developer → Llama 3 Scripts: runs inference
- Llama 3 Scripts → Llama 3 Generation: invokes
- Llama 3 Generation → Chat Formatting: formats chat
- Llama 3 Generation → Llama 3 Tokenizer: tokenizes prompts
- Llama 3 Generation → Llama 3 Model: runs model
- Llama 3 Generation → Local Checkpoints: loads weights
- Llama 3 Generation → Llama 3 Quantization: converts weights
- Developer → Llama 4 Scripts: runs inference
- Llama 4 Scripts → Llama 4 Generation: invokes
- Llama 4 Generation → Llama 4 Model: runs model
- Llama 4 Generation → Local Checkpoints: loads weights
- Llama 4 Generation → Llama 4 Quantization: converts weights
- Llama 3 Quantization → Quantization Kernels: uses kernels
- Llama 4 Quantization → Quantization Kernels: uses kernels
- Image Preprocessing → Vision Embeddings: prepares image input
- Vision Embeddings → Vision Encoder: encodes patches