Text Generation
Transformers
Safetensors
PyTorch
llama
facebook
meta
llama-3
conversational
Eval Results
text-generation-inference
Instructions to use meta-llama/Llama-3.1-70B-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-70B-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-70B-Instruct", device_map="auto") 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-70B-Instruct") model = AutoModelForCausalLM.from_pretrained("meta-llama/Llama-3.1-70B-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]:])) - Inference
- Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use meta-llama/Llama-3.1-70B-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-70B-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-70B-Instruct", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/meta-llama/Llama-3.1-70B-Instruct
- SGLang
How to use meta-llama/Llama-3.1-70B-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-70B-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-70B-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-70B-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-70B-Instruct", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use meta-llama/Llama-3.1-70B-Instruct with Docker Model Runner:
docker model run hf.co/meta-llama/Llama-3.1-70B-Instruct
Access request FAQ
pinned#13 opened almost 2 years ago
by
samuelselvan
TemporalMesh Transformer: 29.4 PPL at 48% compute — beats Mamba, new open-source architecture
#51 opened about 1 month ago
by
vigneshwar234
Add EvalEval community eval results
#50 opened about 2 months ago
by
EvalEvalBot
fix: set `clean_up_tokenization_spaces` to `false`
#49 opened 4 months ago
by
maxsloef
Upload 2 files
#48 opened 4 months ago
by
kovsbo
llama-70b-fp16
#47 opened 12 months ago
by
srbajpai
Your request to access this repo has been rejected by the repo's authors.
#46 opened about 1 year ago
by
PaolaGhione
Request: DOI
#45 opened about 1 year ago
by
GruntDaddy
Request: DOI
#44 opened over 1 year ago
by
mansurali901
Unable to Open tokenizer.model File
4
#43 opened over 1 year ago
by
d4wnn
set "pad_token" to "<|finetune_right_pad_id|>"
#41 opened over 1 year ago
by
wukaixingxp
Request: DOI
#40 opened over 1 year ago
by
tabishmunir69
meta3.170b
#39 opened over 1 year ago
by
AlexMaq
How to run llama3.1-70B-Instruct inference with mutil-gpu?
1
#38 opened over 1 year ago
by
ToukesuD
Slow response : Text validation
1
#37 opened almost 2 years ago
by
GUrubux
Independent evaluation results
#35 opened almost 2 years ago
by
yaronr
Request: DOI
#34 opened almost 2 years ago
by
Howl1226
Inference client to be added to the pipeline
1
#33 opened almost 2 years ago
by
JulienGuy
Llama 3.1 models continuously unavailable
#32 opened almost 2 years ago
by
HugoMartin
Use of "parameters" or "arguments" in chat template
#31 opened almost 2 years ago
by
mbayser
Update tokenizer_config.json
#30 opened almost 2 years ago
by
Rocketknight1
Deploying to dedicated Inference Endpoints
#29 opened almost 2 years ago
by
stcat
Compute Instance Requirement
#28 opened almost 2 years ago
by
iammano
Slow inference/low GPU utilization.
➕ 4
#27 opened almost 2 years ago
by
hmanju
Pruning
7
#24 opened almost 2 years ago
by
dhivakarsa
Context window size?
👍 1
4
#23 opened almost 2 years ago
by
JulienGuy
Fix chat_template for tool-calling
1
#22 opened almost 2 years ago
by
ishelaputov
[ToolCalling] Fix chat_template error
1
#21 opened almost 2 years ago
by
ishelaputov
what is a way to verify the model I am running is performing as expected?
1
#18 opened almost 2 years ago
by
MarkWard0110
What's up with the MATH Lvl 5 score on HF Open LLM Leaderboard 2?
1
#16 opened almost 2 years ago
by
invalid-access
🚀 LMDeploy support Llama3.1 and its Tool Calling. An example of calling "Wolfram Alpha" to perform complex mathematical calculations can be found from here!
#14 opened almost 2 years ago
by
vansin
Issue with Tokenizer when deploying with TGI
👍 1
1
#10 opened almost 2 years ago
by
BigBoyAlan
Bug in config.json?
3
#7 opened almost 2 years ago
by
dhruvmullick