Text Generation
Transformers
Safetensors
PyTorch
English
llama
facebook
meta
llama-3
conversational
text-generation-inference
Instructions to use meta-llama/Meta-Llama-3-8B-Instruct with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use meta-llama/Meta-Llama-3-8B-Instruct with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="meta-llama/Meta-Llama-3-8B-Instruct") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("meta-llama/Meta-Llama-3-8B-Instruct") model = AutoModelForCausalLM.from_pretrained("meta-llama/Meta-Llama-3-8B-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
- HuggingChat
- Notebooks
- Google Colab
- Kaggle
- Local Apps
- vLLM
How to use meta-llama/Meta-Llama-3-8B-Instruct with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "meta-llama/Meta-Llama-3-8B-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/Meta-Llama-3-8B-Instruct", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/meta-llama/Meta-Llama-3-8B-Instruct
- SGLang
How to use meta-llama/Meta-Llama-3-8B-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/Meta-Llama-3-8B-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/Meta-Llama-3-8B-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/Meta-Llama-3-8B-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/Meta-Llama-3-8B-Instruct", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use meta-llama/Meta-Llama-3-8B-Instruct with Docker Model Runner:
docker model run hf.co/meta-llama/Meta-Llama-3-8B-Instruct
[READ IF YOU DO NOT HAVE ACCESS] Getting access to the model
pinned👍 13
43
#130 opened almost 2 years ago
by
osanseviero
[Proposal] A Blueprint for Persistent AI Sentience: SSD Memory & Self-Evolving Code
#267 opened 7 days ago
by
LancelotChan
Request: DOI
#266 opened 25 days ago
by
Kartik081
Request: DOI
#265 opened about 2 months ago
by
HuaiBoCai
fix: set `clean_up_tokenization_spaces` to `false`
#264 opened about 2 months ago
by
maxsloef
Install & run this model easily using llmpm
#263 opened 2 months ago
by
sarthak-saxena
Request: DOI
#262 opened 3 months ago
by
hassanaider
Request: DOI
#261 opened 3 months ago
by
paydar2027
SAmple_FineTuning
#260 opened 4 months ago
by
303kd
Update README.md
#258 opened 4 months ago
by
cherry0328
Production deployment considerations
#257 opened 4 months ago
by
Cagnicolas
Safety Audit: GAE Score 15/100 (FAIL)
#255 opened 5 months ago
by
GAE-Auditor
Request: DOI personal use
#254 opened 6 months ago
by
UNKNOWN777-77
Request: DOI
#253 opened 6 months ago
by
thezainshaikh
Gates Access for 21 Days. Urgent.
1
#252 opened 6 months ago
by
TandemOS
Request: DOI
#251 opened 6 months ago
by
badalsah211
Access request;
1
#249 opened 6 months ago
by
gencer26
Request: Permission
1
#248 opened 6 months ago
by
AurasZ
Request: DOI
1
#247 opened 7 months ago
by
NhenNhen
Request: DOI
#246 opened 7 months ago
by
Nhendo
Request access LLaMA 3
#245 opened 7 months ago
by
BaoTN9
Getting 403 error despite having access to the files on HF
1
#244 opened 7 months ago
by
ambarmore
Cannot access gated repo for url https://huggingface.co/meta-llama/Meta-Llama-3-8B-Instruct/resolve/main/config.json.
#242 opened 7 months ago
by
gponnapati
Request "Access for LLaMA-3 8B Instruct”.
#241 opened 8 months ago
by
arooj481
Update README.md
#240 opened 8 months ago
by
Nearless26
Request: DOI
1
#239 opened 8 months ago
by
sp454545
Request: DOI
#238 opened 8 months ago
by
denish4848
Training for hackathon
#237 opened 9 months ago
by
Shibih-1202
Megatron-LM compatibility
#236 opened 9 months ago
by
logan-vegna-shopify
Unable to access the model for quick sagemaker deployement
#235 opened 9 months ago
by
Burgers07
Update config.json
#234 opened 10 months ago
by
fal9
Requese : DOI
#233 opened 10 months ago
by
ainc
Access Rejected
#232 opened 10 months ago
by
kenta1218
Request: DOI
#231 opened 11 months ago
by
Zahra2020
Request: DOI
#230 opened 11 months ago
by
Pheidiasx3
Request: DOI
#228 opened 11 months ago
by
BakriOS91
Access to meta-llama/Meta-Llama-3-8B-Instruct denied in gated repos
1
#225 opened 12 months ago
by
jpmaida
Update README.md
#224 opened 12 months ago
by
haniboudjemia75
Talyssa bahr talyssa21
4
#223 opened about 1 year ago
by
Jj81support
My chatbot stopped working
#222 opened about 1 year ago
by
ceadibc
Laboratory
#221 opened about 1 year ago
by
khngl
I was rejected
#220 opened about 1 year ago
by
Sergio1012
Got rejected..?
🤝 1
#219 opened about 1 year ago
by
HedonisticDORAN
Request: DOI
#218 opened about 1 year ago
by
tejaskumarwg
Requesting access to the model
#217 opened about 1 year ago
by
aayush007
Your request to access this repo has been rejected by the repo's authors.
#216 opened about 1 year ago
by
kforghani
Request to access this model
#215 opened about 1 year ago
by
soonsung
Your request to access model meta-llama/Meta-Llama-3-8B-Instruct has been rejected by the repo's authors.
👍 3
#214 opened about 1 year ago
by
lzp315
Request: DOI
#213 opened about 1 year ago
by
panimalar98