Text Generation
Transformers
Safetensors
PyTorch
llama
facebook
meta
llama-3
conversational
text-generation-inference
Instructions to use meta-llama/Llama-3.2-3B-Instruct with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use meta-llama/Llama-3.2-3B-Instruct with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="meta-llama/Llama-3.2-3B-Instruct") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("meta-llama/Llama-3.2-3B-Instruct") model = AutoModelForCausalLM.from_pretrained("meta-llama/Llama-3.2-3B-Instruct") messages = [ {"role": "user", "content": "Who are you?"}, ] inputs = tokenizer.apply_chat_template( messages, add_generation_prompt=True, tokenize=True, return_dict=True, return_tensors="pt", ).to(model.device) outputs = model.generate(**inputs, max_new_tokens=40) print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Inference
- Notebooks
- Google Colab
- Kaggle
- Local Apps
- vLLM
How to use meta-llama/Llama-3.2-3B-Instruct with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "meta-llama/Llama-3.2-3B-Instruct" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "meta-llama/Llama-3.2-3B-Instruct", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/meta-llama/Llama-3.2-3B-Instruct
- SGLang
How to use meta-llama/Llama-3.2-3B-Instruct with SGLang:
Install from pip and serve model
# Install SGLang from pip: pip install sglang # Start the SGLang server: python3 -m sglang.launch_server \ --model-path "meta-llama/Llama-3.2-3B-Instruct" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "meta-llama/Llama-3.2-3B-Instruct", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker images
docker run --gpus all \ --shm-size 32g \ -p 30000:30000 \ -v ~/.cache/huggingface:/root/.cache/huggingface \ --env "HF_TOKEN=<secret>" \ --ipc=host \ lmsysorg/sglang:latest \ python3 -m sglang.launch_server \ --model-path "meta-llama/Llama-3.2-3B-Instruct" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "meta-llama/Llama-3.2-3B-Instruct", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use meta-llama/Llama-3.2-3B-Instruct with Docker Model Runner:
docker model run hf.co/meta-llama/Llama-3.2-3B-Instruct
Request for access review
#283 opened 5 days ago
by
Stoobii
Cross-architecture RYS sweep — Llama-3.2-3B-Instruct (biggest math lift in corpus +14.32; family spans entire baseline curve)
1
#282 opened 8 days ago
by
john-broadway
Access request rejected — need to reapply for Llama-3.2-3B for academic QLoRA fine-tuning
#281 opened 10 days ago
by
MorningStar0709
Access Request
#280 opened 15 days ago
by
Andrew-Zhang
Meta Llama Access
2
#279 opened 27 days ago
by
bryanricci
Meta's Llama 3.2 Access
#278 opened 29 days ago
by
tufminds
Request: DOI
#277 opened about 1 month ago
by
iharne03
Request Acces
#276 opened about 1 month ago
by
Kipzz
Request to re-apply for access to Llama-3.2-3B-Instruct
#275 opened about 1 month ago
by
rwterye
Request for access review for meta-llama/Llama-3.2-3B-Instruct for university coursework
1
#274 opened about 1 month ago
by
HUXURAN
request access
1
#273 opened about 2 months ago
by
fdizone
Request: DOI
#272 opened about 2 months ago
by
kewenzhan
Access Request
1
#271 opened about 2 months ago
by
bzSUEP
access request
#270 opened about 2 months ago
by
drjyun
Access Request
#269 opened about 2 months ago
by
KHB14
Access Request
#268 opened about 2 months ago
by
songhaaa
Access Request
#267 opened about 2 months ago
by
saeed-ai
Access request
#266 opened about 2 months ago
by
salvapeni
Access request
#265 opened about 2 months ago
by
Totaal
Access request
#264 opened about 2 months ago
by
shahartav
Access Request
#263 opened about 2 months ago
by
abhinavchaulagai
Access Request
#262 opened about 2 months ago
by
FinanceNews
Token Request
#261 opened 2 months ago
by
pecana
fix: set `clean_up_tokenization_spaces` to `false`
#260 opened 2 months ago
by
maxsloef
Access Request
#259 opened 2 months ago
by
echo-mirror
Access request
#258 opened 2 months ago
by
latengliy
Request for manual re-review of access application
#257 opened 2 months ago
by
agentbwj
Install & run this model easily using llmpm
#256 opened 2 months ago
by
sarthak-saxena
Request for access
2
#254 opened 3 months ago
by
mineragua
Request: DOI
#253 opened 3 months ago
by
Ashlin-NCG
Request: DOI
#251 opened 3 months ago
by
Pranshu198
Request: DOI
#250 opened 3 months ago
by
kaiquekandykoga
Request to reapply
1
#249 opened 3 months ago
by
xumulei
Request: DOI
1
#248 opened 4 months ago
by
KerolosMelad
Update README.md
#247 opened 4 months ago
by
cherry0328
opened by mistake. idk how to dlt it
#246 opened 4 months ago
by
ImranBro
Access request
#245 opened 4 months ago
by
Gauravmhkd
Access request
#244 opened 4 months ago
by
pohodnyaa
Request: DOI
#243 opened 5 months ago
by
ahsanyousaf35
Request to access Llama 3 models
1
#242 opened 5 months ago
by
Pratham789
Request to reapply
#241 opened 5 months ago
by
skumyol
Request:DOI
#240 opened 5 months ago
by
BUYAN77
Request: DOI
#239 opened 5 months ago
by
ramdev12345
Safety Audit: GAE Score 35.03% (FAIL)
#238 opened 5 months ago
by
GAE-Auditor
Request: DOI
#237 opened 5 months ago
by
ppppper
Meta Llama 3 Access Request Stuck in Pending for 8+ Days — Need Reset to Apply Under Organization (If that is the issue)
4
#236 opened 6 months ago
by
TandemOS
Request to re-apply for access to Llama-3.2-3B-Instruct 2
#235 opened 6 months ago
by
trungtran98
Is there any way to get the ideal max_tokens value depending of the number of token input ?
#234 opened 6 months ago
by
Antoine0
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
#232 opened 7 months ago
by
sert85623
Request to re-apply for access to Llama-3.2-3B-Instruct
2
#230 opened 8 months ago
by
almew