Text Generation
Transformers
Safetensors
PyTorch
llama
facebook
meta
llama-3
conversational
Eval Results
text-generation-inference
Instructions to use meta-llama/Llama-3.1-405B-Instruct with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use meta-llama/Llama-3.1-405B-Instruct with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="meta-llama/Llama-3.1-405B-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.1-405B-Instruct") model = AutoModelForCausalLM.from_pretrained("meta-llama/Llama-3.1-405B-Instruct", device_map="auto") 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]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use meta-llama/Llama-3.1-405B-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.1-405B-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.1-405B-Instruct", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/meta-llama/Llama-3.1-405B-Instruct
- SGLang
How to use meta-llama/Llama-3.1-405B-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.1-405B-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.1-405B-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.1-405B-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.1-405B-Instruct", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use meta-llama/Llama-3.1-405B-Instruct with Docker Model Runner:
docker model run hf.co/meta-llama/Llama-3.1-405B-Instruct
Access request FAQ
pinned#10 opened about 2 years ago
by
samuelselvan
Add EvalEval community eval results
#38 opened about 2 months ago
by
EvalEvalBot
Add LEXam evaluation results
#37 opened about 2 months ago
by
joelniklaus
fix: set `clean_up_tokenization_spaces` to `false`
#36 opened 4 months ago
by
maxsloef
Add SWE-Bench Pro evaluation results
🔥 1
#35 opened 5 months ago
by
nielsr
Create a.html
1
#34 opened 8 months ago
by
dronesplace
Model Access
1
#33 opened about 1 year ago
by
stevenpsupermicro
What Files Are Needed or All
1
#32 opened over 1 year ago
by
JerryYang888
set "pad_token" to "<|finetune_right_pad_id|>"
1
#31 opened over 1 year ago
by
wukaixingxp
cannot get 405B-model to run
1
#30 opened over 1 year ago
by
hAI-hades
Llama 3.1 models continuously unavailable
2
#28 opened almost 2 years ago
by
HugoMartin
potential of 405b model
3
#27 opened almost 2 years ago
by
nskumar
Update tokenizer_config.json
1
#26 opened almost 2 years ago
by
Rocketknight1
Model inference giving 503 error
4
#25 opened almost 2 years ago
by
DeepTreeTeam
Num KV heads changed from 16 to 8?
➕ 1
2
#21 opened almost 2 years ago
by
keremturgutlu
This repo is huge!
1
#19 opened almost 2 years ago
by
JohnnieB
Please reply, why am I not allowed to apply for approval? Aren't you open-source?
1
#18 opened almost 2 years ago
by
guangqi
Inference Endpoint (dedicated) not available
1
#16 opened about 2 years ago
by
janhornych
why "num_key_value_heads": 16,
1
#14 opened about 2 years ago
by
xiaoxiawu123
GGUF version request
1
#13 opened about 2 years ago
by
Keionsa
🚀 LMDeploy support Llama3.1 and its Tool Calling. An example of calling "Wolfram Alpha" to perform complex mathematical calculations can be found from here!
1
#11 opened about 2 years ago
by
vansin
TGI available only for pro subscriptions?
7
#7 opened about 2 years ago
by
avfranco
Max output tokens for Llama 3.1
9
#6 opened about 2 years ago
by
abhirup-sainapse
Please move PTH/original into new model/repo.
5
#5 opened about 2 years ago
by
Qubitium