Instructions to use unsloth/tinyllama with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use unsloth/tinyllama with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="unsloth/tinyllama")# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("unsloth/tinyllama") model = AutoModelForCausalLM.from_pretrained("unsloth/tinyllama", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use unsloth/tinyllama with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "unsloth/tinyllama" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "unsloth/tinyllama", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/unsloth/tinyllama
- SGLang
How to use unsloth/tinyllama 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/tinyllama" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "unsloth/tinyllama", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'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/tinyllama" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "unsloth/tinyllama", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Unsloth Desktop
- Docker Model Runner
How to use unsloth/tinyllama with Docker Model Runner:
docker model run hf.co/unsloth/tinyllama
Commit History
-
Upload tokenizer
Verified signature277240b -
Upload config
Verified signature5d1d298 -
Upload config
Verified signaturefebb287
-
Upload tokenizer
Verified signature6a073f6 -
Upload config
Verified signature30edcd8 -
Upload config
Verified signatureb0002a6
-
Upload tokenizer
Verified signature1a6c980 -
Upload config
Verified signature84b9c15 -
Upload config
Verified signature102c1c2
-
Upload tokenizer
Verified signaturebfe1c5c -
Upload config
Verified signatureded454a -
Upload config
Verified signature5b11d86
-
Upload tokenizer
Verified signatureae2976a -
Upload config
Verified signature86583bc -
Upload config
Verified signature8836083
-
Upload tokenizer
Verified signature468c00f -
Upload config
Verified signaturefd44b76 -
Upload config
Verified signature8baa05f
-
Upload tokenizer
Verified signature5feda39 -
Upload config
Verified signature76ce2db -
Upload config
Verified signature5707ca8
-
Upload tokenizer
Verified signature7375952 -
Upload config
Verified signature88a1f92 -
Upload config
Verified signatureab99555 -
Upload tokenizer
Verified signaturea018546 -
Upload config
Verified signaturecaeb1f2 -
Upload config
Verified signaturee91dbb3 -
Upload tokenizer
Verified signature39ca57d -
Upload config
Verified signature67e164e -
Upload config
Verified signature1dc7dc9 -
Upload LlamaForCausalLM
Verified signature6beb143 -
Upload tokenizer
Verified signature6b87fd9 -
Upload config
Verified signature3df376e -
Upload config
Verified signature5933680
-
Update README.md
Verified signatureb549043 -
Update README.md
Verified signature14a73f9 -
Update README.md
Verified signaturedb98d3a
-
Update README.md
b391f31
-
Upload tokenizer
b1e304c -
Upload LlamaForCausalLM
8281be5
-
Create README.md
931fb5f -
Upload tokenizer
858395d -
Upload LlamaForCausalLM
0e03f18 -
initial commit
7032560