Instructions to use TinyLlama/TinyLlama-1.1B-Chat-v1.0 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use TinyLlama/TinyLlama-1.1B-Chat-v1.0 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="TinyLlama/TinyLlama-1.1B-Chat-v1.0") 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("TinyLlama/TinyLlama-1.1B-Chat-v1.0") model = AutoModelForCausalLM.from_pretrained("TinyLlama/TinyLlama-1.1B-Chat-v1.0", 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]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use TinyLlama/TinyLlama-1.1B-Chat-v1.0 with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "TinyLlama/TinyLlama-1.1B-Chat-v1.0" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "TinyLlama/TinyLlama-1.1B-Chat-v1.0", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/TinyLlama/TinyLlama-1.1B-Chat-v1.0
- SGLang
How to use TinyLlama/TinyLlama-1.1B-Chat-v1.0 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 "TinyLlama/TinyLlama-1.1B-Chat-v1.0" \ --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": "TinyLlama/TinyLlama-1.1B-Chat-v1.0", "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 "TinyLlama/TinyLlama-1.1B-Chat-v1.0" \ --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": "TinyLlama/TinyLlama-1.1B-Chat-v1.0", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use TinyLlama/TinyLlama-1.1B-Chat-v1.0 with Docker Model Runner:
docker model run hf.co/TinyLlama/TinyLlama-1.1B-Chat-v1.0
A small pad note: tokenizer files name id 2 while generation_config names 0
#71 opened 7 days ago
by
nootxlm
Listed on OpenModelMap
#70 opened 9 days ago
by
duola15
Listed on OpenModelMap
#69 opened 3 months ago
by
duola15
Inference Playground and Generated Python Code Returning bad_request
#68 opened 5 months ago
by
Yash-1503
TinyLlama — the community's tiny champion
#67 opened 5 months ago
by
3morixd
Listed on OpenModelMap
#66 opened 5 months ago
by
duola15
TemporalMesh Transformer: 29.4 PPL at 48% compute — dynamic graph attention + adaptive exit gates (open-source, 226 tests)
#65 opened 6 months ago
by
vigneshwar234
Cross-architecture RYS sweep — TinyLlama-1.1B-Chat-v1.0 (EQ-amplifier extreme +47.85; refines hypothesis to weakest-dimension)
1
#64 opened 7 months ago
by
john-broadway
Update README.md
#62 opened 10 months ago
by
xyuit01
Update README.md
#61 opened 10 months ago
by
cherry0328
error:size mismatch for model.layers.0.self_attn.k_proj.weight: copying a param with shape torch.Size([256, 2048]) from checkpoint, the shape in current model is torch.Size([2048, 2048]).
#60 opened about 1 year ago
by
Kanade-jie
Add link to Neuron-optimized version
#59 opened about 1 year ago
by
badaoui
testing
#58 opened over 1 year ago
by
robinhassan
Request: DOI
#57 opened over 1 year ago
by
VCoder1410
Rename README.md to Orbital-AI — TinyLLaMA 1.1B Chat (Fine-Tune Ready)
#56 opened over 1 year ago
by
PlanetX95
leave-letter-generator
#54 opened over 1 year ago
by
jeyakeerthanaa
What is the original license of 1.1B Llama ?
1
#52 opened over 1 year ago
by
JLouisBiz
Adding Evaluation Results
#51 opened over 1 year ago
by
MythX7
Adding ONNX file of this model
#50 opened over 1 year ago
by
WRCREX
Create Tinyllama
#49 opened over 1 year ago
by
Meenakshi14
License question, is it based on Llama license?
1
#48 opened almost 2 years ago
by
JLouisBiz
chat_template not set in tokenizer_config
#47 opened almost 2 years ago
by
vizzard110
Is there a checkpoint after fine-tuning only on `ultrachat_200k`, which we would like to use it to do research on alignment algorithms?
#45 opened about 2 years ago
by
AIR-hl
Interview request: genAI evaluation & documentation
#44 opened about 2 years ago
by
evatang
Adding Evaluation Results
#42 opened over 2 years ago
by
leaderboard-pr-bot
How to remove input token to get only output token ?
➕ 2
#41 opened over 2 years ago
by
ducknificient
Multilingual model
#40 opened over 2 years ago
by
ducknificient
Instruction Tuning Model
2
#39 opened over 2 years ago
by
ducknificient
Request: DOI
#38 opened over 2 years ago
by
climbingm
Adding Evaluation Results
#37 opened over 2 years ago
by
leaderboard-pr-bot
CUDA assertion error when trying to train
#36 opened over 2 years ago
by
brianwilcken
Can you upload the SFT version as well?
#34 opened over 2 years ago
by
jiwan-chung
Adding Evaluation Results
#33 opened over 2 years ago
by
leaderboard-pr-bot
Adding Evaluation Results
#32 opened over 2 years ago
by
asck
Adding Evaluation Results
#31 opened over 2 years ago
by
leaderboard-pr-bot
It wrote an credible new recipe for spiced frog salad
#30 opened over 2 years ago
by
MartialTerran
Write a story....
#29 opened over 2 years ago
by
MartialTerran
Too much Junk vocab words in the vocab.json.
8
#28 opened over 2 years ago
by
MartialTerran
Bing (ChatGPT4) analyzes the "def fibonacci_sequence_to_digits(n)" example code.
#27 opened over 2 years ago
by
MartialTerran
Update widget example
#26 opened over 2 years ago
by
Xenova
Adding Evaluation Results
#25 opened over 2 years ago
by
leaderboard-pr-bot
Deployment?
3
#24 opened over 2 years ago
by
huggingface9837
[AUTOMATED] Model Memory Requirements
#22 opened almost 3 years ago
by
model-sizer-bot
[AUTOMATED] Model Memory Requirements
#21 opened almost 3 years ago
by
model-sizer-bot
[AUTOMATED] Model Memory Requirements
#20 opened almost 3 years ago
by
model-sizer-bot
Dataset for DPO, with a Template?
1
#17 opened almost 3 years ago
by
ewqr2130
Prompt format?
4
#16 opened almost 3 years ago
by
anuragrawal
Minimum supported device?
2
#15 opened almost 3 years ago
by
sachinmyneni