Text Generation
Transformers
Safetensors
English
llama
unsloth
llama-3
conversational
text-generation-inference
Instructions to use unsloth/llama-3-8b-Instruct with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use unsloth/llama-3-8b-Instruct with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="unsloth/llama-3-8b-Instruct") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("unsloth/llama-3-8b-Instruct") model = AutoModelForCausalLM.from_pretrained("unsloth/llama-3-8b-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=256) print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Inference
- Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use unsloth/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 "unsloth/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": "unsloth/llama-3-8b-Instruct", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/unsloth/llama-3-8b-Instruct
- SGLang
How to use unsloth/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 "unsloth/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": "unsloth/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 "unsloth/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": "unsloth/llama-3-8b-Instruct", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Unsloth Desktop
- Docker Model Runner
How to use unsloth/llama-3-8b-Instruct with Docker Model Runner:
docker model run hf.co/unsloth/llama-3-8b-Instruct
Commit History
-
Upload tokenizer
Verified signaturef371096 -
Upload config
Verified signature97e5a2d -
Upload config
Verified signature083f6d1
-
Upload tokenizer
Verified signature4c78946 -
Upload config
Verified signature632d778 -
Upload config
Verified signature5f3a647
-
Upload tokenizer
Verified signature59d8af4 -
Upload config
Verified signature74e1993 -
Upload config
Verified signature31b3567
-
Upload tokenizer
Verified signaturea4aa68b -
Upload config
Verified signature4226b09 -
Upload config
Verified signaturef52b5a1
-
Upload tokenizer
Verified signature34050bb -
Upload config
Verified signature2ed040d -
Upload config
Verified signature32bfbdc
-
Upload tokenizer
Verified signatureb010df8 -
Upload config
Verified signatured157ee1 -
Upload config
Verified signature71c907f
-
Upload tokenizer
Verified signaturea51068f -
Upload config
Verified signature798ce35 -
Upload config
Verified signatureb66b7e1
-
Upload tokenizer
Verified signaturef89fd1c -
Upload config
Verified signature7190efa -
Upload config
Verified signaturedff9bb5 -
Upload tokenizer
Verified signature0ddc84c -
Upload config
Verified signature1e0a664 -
Upload config
Verified signature466a4c9 -
Upload tokenizer
Verified signature73e99ce -
Upload config
Verified signaturefc6a6e4 -
Upload config
Verified signature4752554 -
Upload tokenizer
Verified signaturea4b7879 -
Upload config
Verified signature62f9e6c -
Upload config
Verified signatureb8cac60 -
Upload tokenizer
Verified signaturea34c0e6 -
Upload config
Verified signature0ef3804 -
Upload config
Verified signature472df8e
-
Upload tokenizer
Verified signature3f99e60 -
Upload config
Verified signature6e9a8ac -
Upload config
Verified signature47d8308 -
Upload tokenizer
Verified signatured2b80f7 -
Upload config
Verified signature352c8ae -
Upload config
Verified signature9c13a68
-
Update README.md
Verified signatureaff1792
-
Update config.json (#3)
Verified signature- Update config.json (05b2d8a4d05b006dfda53c2460d65b82e6609a07) Co-authored-by: Husein Kantarci <huseink@users.noreply.huggingface.co>f778388
-
Upload tokenizer
Verified signature022cb4a
-
Upload tokenizer
Verified signaturef0d0279
-
Upload tokenizer
Verified signature67c7216 -
Upload tokenizer.json
Verified signature723cc34 -
Update generation_config.json
Verified signature33880f4
-
Upload tokenizer
Verified signaturec0e1bc5