Text Generation
Transformers
Safetensors
English
llama
unsloth
tinyllama
text-generation-inference
4-bit precision
bitsandbytes
Instructions to use unsloth/tinyllama-bnb-4bit with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use unsloth/tinyllama-bnb-4bit with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="unsloth/tinyllama-bnb-4bit")# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("unsloth/tinyllama-bnb-4bit") model = AutoModelForCausalLM.from_pretrained("unsloth/tinyllama-bnb-4bit", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use unsloth/tinyllama-bnb-4bit with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "unsloth/tinyllama-bnb-4bit" # 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-bnb-4bit", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/unsloth/tinyllama-bnb-4bit
- SGLang
How to use unsloth/tinyllama-bnb-4bit 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-bnb-4bit" \ --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-bnb-4bit", "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-bnb-4bit" \ --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-bnb-4bit", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Unsloth Desktop
- Docker Model Runner
How to use unsloth/tinyllama-bnb-4bit with Docker Model Runner:
docker model run hf.co/unsloth/tinyllama-bnb-4bit
Commit History
-
Upload tokenizer
Verified signaturec6cc312 -
Upload config
Verified signaturec1d440b -
Upload config
Verified signature888011e
-
Upload tokenizer
Verified signatured61e00b -
Upload config
Verified signature017a75c -
Upload config
Verified signature039b81b
-
Upload tokenizer
Verified signaturec850f69 -
Upload config
Verified signaturecbd4223 -
Upload config
Verified signature1ec5288
-
Upload tokenizer
Verified signatureb3ee023 -
Upload config
Verified signatured4f787d -
Upload config
Verified signature5600270
-
Upload tokenizer
Verified signaturec98ad12 -
Upload config
Verified signature1642abe -
Upload config
Verified signature7abf160
-
Upload tokenizer
Verified signature16c351e -
Upload config
Verified signature902d332 -
Upload config
Verified signature45954a5
-
Upload tokenizer
Verified signature9f6caaa -
Upload config
Verified signature44dcf2b -
Upload config
Verified signature631bf3d
-
Upload tokenizer
Verified signaturec7ee982 -
Upload config
Verified signaturee737f2a -
Upload config
Verified signatured5633b3 -
Upload tokenizer
Verified signaturecf29ba8 -
Upload config
Verified signature320f761 -
Upload config
Verified signature61120e7 -
Upload tokenizer
Verified signature7d3f371 -
Upload config
Verified signature1468c93 -
Upload config
Verified signature82f12ab -
Upload LlamaForCausalLM
Verified signatureb647498 -
Upload tokenizer
Verified signature1da36b4 -
Upload config
Verified signature123ed36 -
Upload config
Verified signature400c71a
-
Update README.md
Verified signature82c9ac4
-
Upload tokenizer
fc56510 -
Upload LlamaForCausalLM
9dc9c5e
-
Create README.md
f8a1405 -
Upload tokenizer
13164d6 -
Upload LlamaForCausalLM
798a6b6 -
initial commit
925c15e