Text Generation
Transformers
Safetensors
GGUF
English
llama
conversational
text-generation-inference
Instructions to use TinyLlama/TinyLlama-1.1B-Chat-v0.6 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use TinyLlama/TinyLlama-1.1B-Chat-v0.6 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="TinyLlama/TinyLlama-1.1B-Chat-v0.6") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("TinyLlama/TinyLlama-1.1B-Chat-v0.6") model = AutoModelForCausalLM.from_pretrained("TinyLlama/TinyLlama-1.1B-Chat-v0.6", 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]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- llama.cpp
How to use TinyLlama/TinyLlama-1.1B-Chat-v0.6 with llama.cpp:
Install (macOS, Linux)
curl -LsSf https://llama.app/install.sh | sh # Start a local OpenAI-compatible server with a web UI: llama serve -hf TinyLlama/TinyLlama-1.1B-Chat-v0.6:Q4_0 # Run inference directly in the terminal: llama cli -hf TinyLlama/TinyLlama-1.1B-Chat-v0.6:Q4_0
Install from WinGet (Windows)
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama serve -hf TinyLlama/TinyLlama-1.1B-Chat-v0.6:Q4_0 # Run inference directly in the terminal: llama cli -hf TinyLlama/TinyLlama-1.1B-Chat-v0.6:Q4_0
Use pre-built binary
# Download pre-built binary from: # https://github.com/ggerganov/llama.cpp/releases # Start a local OpenAI-compatible server with a web UI: ./llama-server -hf TinyLlama/TinyLlama-1.1B-Chat-v0.6:Q4_0 # Run inference directly in the terminal: ./llama-cli -hf TinyLlama/TinyLlama-1.1B-Chat-v0.6:Q4_0
Build from source code
git clone https://github.com/ggerganov/llama.cpp.git cd llama.cpp cmake -B build cmake --build build -j --target llama-server llama-cli # Start a local OpenAI-compatible server with a web UI: ./build/bin/llama-server -hf TinyLlama/TinyLlama-1.1B-Chat-v0.6:Q4_0 # Run inference directly in the terminal: ./build/bin/llama-cli -hf TinyLlama/TinyLlama-1.1B-Chat-v0.6:Q4_0
Use Docker
docker model run hf.co/TinyLlama/TinyLlama-1.1B-Chat-v0.6:Q4_0
- LM Studio
- Jan
- vLLM
How to use TinyLlama/TinyLlama-1.1B-Chat-v0.6 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-v0.6" # 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-v0.6", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/TinyLlama/TinyLlama-1.1B-Chat-v0.6:Q4_0
- SGLang
How to use TinyLlama/TinyLlama-1.1B-Chat-v0.6 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-v0.6" \ --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-v0.6", "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-v0.6" \ --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-v0.6", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Ollama
How to use TinyLlama/TinyLlama-1.1B-Chat-v0.6 with Ollama:
ollama run hf.co/TinyLlama/TinyLlama-1.1B-Chat-v0.6:Q4_0
- Unsloth Desktop
- Docker Model Runner
How to use TinyLlama/TinyLlama-1.1B-Chat-v0.6 with Docker Model Runner:
docker model run hf.co/TinyLlama/TinyLlama-1.1B-Chat-v0.6:Q4_0
- Lemonade
How to use TinyLlama/TinyLlama-1.1B-Chat-v0.6 with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull TinyLlama/TinyLlama-1.1B-Chat-v0.6:Q4_0
Run and chat with the model
lemonade run user.TinyLlama-1.1B-Chat-v0.6-Q4_0
List all available models
lemonade list
- Atomic Chat
Update README.md
Browse files
README.md
CHANGED
|
@@ -9,7 +9,7 @@ language:
|
|
| 9 |
---
|
| 10 |
<div align="center">
|
| 11 |
|
| 12 |
-
# TinyLlama-1.1B
|
| 13 |
</div>
|
| 14 |
|
| 15 |
https://github.com/jzhang38/TinyLlama
|
|
@@ -19,7 +19,7 @@ The TinyLlama project aims to **pretrain** a **1.1B Llama model on 3 trillion to
|
|
| 19 |
|
| 20 |
We adopted exactly the same architecture and tokenizer as Llama 2. This means TinyLlama can be plugged and played in many open-source projects built upon Llama. Besides, TinyLlama is compact with only 1.1B parameters. This compactness allows it to cater to a multitude of applications demanding a restricted computation and memory footprint.
|
| 21 |
|
| 22 |
-
#### This Model
|
| 23 |
This is the chat model finetuned on top of [TinyLlama/TinyLlama-1.1B-intermediate-step-955k-2T](https://huggingface.co/TinyLlama/TinyLlama-1.1B-intermediate-step-955k-token-2T). **We follow [HF's Zephyr](https://huggingface.co/HuggingFaceH4/zephyr-7b-alpha/edit/main/README.md)'s training recipe.** The model was " initially fine-tuned on a variant of the [`UltraChat`](https://huggingface.co/datasets/stingning/ultrachat) dataset, which contains a diverse range of synthetic dialogues generated by ChatGPT.
|
| 24 |
We then further aligned the model with [🤗 TRL's](https://github.com/huggingface/trl) `DPOTrainer` on the [openbmb/UltraFeedback](https://huggingface.co/datasets/openbmb/UltraFeedback) dataset, which contain 64k prompts and model completions that are ranked by GPT-4."
|
| 25 |
|
|
|
|
| 9 |
---
|
| 10 |
<div align="center">
|
| 11 |
|
| 12 |
+
# TinyLlama-1.1B by Anonymous Pro BD cyber 71
|
| 13 |
</div>
|
| 14 |
|
| 15 |
https://github.com/jzhang38/TinyLlama
|
|
|
|
| 19 |
|
| 20 |
We adopted exactly the same architecture and tokenizer as Llama 2. This means TinyLlama can be plugged and played in many open-source projects built upon Llama. Besides, TinyLlama is compact with only 1.1B parameters. This compactness allows it to cater to a multitude of applications demanding a restricted computation and memory footprint.
|
| 21 |
|
| 22 |
+
#### This Model Anonymous Pro BD Cyber 71
|
| 23 |
This is the chat model finetuned on top of [TinyLlama/TinyLlama-1.1B-intermediate-step-955k-2T](https://huggingface.co/TinyLlama/TinyLlama-1.1B-intermediate-step-955k-token-2T). **We follow [HF's Zephyr](https://huggingface.co/HuggingFaceH4/zephyr-7b-alpha/edit/main/README.md)'s training recipe.** The model was " initially fine-tuned on a variant of the [`UltraChat`](https://huggingface.co/datasets/stingning/ultrachat) dataset, which contains a diverse range of synthetic dialogues generated by ChatGPT.
|
| 24 |
We then further aligned the model with [🤗 TRL's](https://github.com/huggingface/trl) `DPOTrainer` on the [openbmb/UltraFeedback](https://huggingface.co/datasets/openbmb/UltraFeedback) dataset, which contain 64k prompts and model completions that are ranked by GPT-4."
|
| 25 |
|