Instructions to use TheBloke/TinyLlama-1.1B-Chat-v0.3-GGUF with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use TheBloke/TinyLlama-1.1B-Chat-v0.3-GGUF with Transformers:
# Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("TheBloke/TinyLlama-1.1B-Chat-v0.3-GGUF", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- llama.cpp
How to use TheBloke/TinyLlama-1.1B-Chat-v0.3-GGUF 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 TheBloke/TinyLlama-1.1B-Chat-v0.3-GGUF:Q4_K_M # Run inference directly in the terminal: llama cli -hf TheBloke/TinyLlama-1.1B-Chat-v0.3-GGUF:Q4_K_M
Install from WinGet (Windows)
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama serve -hf TheBloke/TinyLlama-1.1B-Chat-v0.3-GGUF:Q4_K_M # Run inference directly in the terminal: llama cli -hf TheBloke/TinyLlama-1.1B-Chat-v0.3-GGUF:Q4_K_M
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 TheBloke/TinyLlama-1.1B-Chat-v0.3-GGUF:Q4_K_M # Run inference directly in the terminal: ./llama-cli -hf TheBloke/TinyLlama-1.1B-Chat-v0.3-GGUF:Q4_K_M
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 TheBloke/TinyLlama-1.1B-Chat-v0.3-GGUF:Q4_K_M # Run inference directly in the terminal: ./build/bin/llama-cli -hf TheBloke/TinyLlama-1.1B-Chat-v0.3-GGUF:Q4_K_M
Use Docker
docker model run hf.co/TheBloke/TinyLlama-1.1B-Chat-v0.3-GGUF:Q4_K_M
- LM Studio
- Jan
- Ollama
How to use TheBloke/TinyLlama-1.1B-Chat-v0.3-GGUF with Ollama:
ollama run hf.co/TheBloke/TinyLlama-1.1B-Chat-v0.3-GGUF:Q4_K_M
- Unsloth Desktop
- Docker Model Runner
How to use TheBloke/TinyLlama-1.1B-Chat-v0.3-GGUF with Docker Model Runner:
docker model run hf.co/TheBloke/TinyLlama-1.1B-Chat-v0.3-GGUF:Q4_K_M
- Lemonade
How to use TheBloke/TinyLlama-1.1B-Chat-v0.3-GGUF with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull TheBloke/TinyLlama-1.1B-Chat-v0.3-GGUF:Q4_K_M
Run and chat with the model
lemonade run user.TinyLlama-1.1B-Chat-v0.3-GGUF-Q4_K_M
List all available models
lemonade list
- Atomic Chat
Better than expected!
For the ones looking for the sweet spot, after some prompt engineering, I was able to get decent responses using q6_k. Lowering the quality more than this results in poor performance. It seems like intelligence or the so-called internal world representation emerges on ~835MB.
What is the difference between a cow and a dog?
A cow is a farm animal, while a dog is a member of the canine family.
I'm definitely using it for my future projects.
would you mind sharing your {system} prompt? I'm getting very inconsistent responses from the model and formatting seems correct here? ... Its always hit or miss for me.
from llama_cpp import Llama
llm = Llama(model_path="models/tinyllama-1.1b-chat-v0.3.Q6_K.gguf", verbose=False)
prompt = "What is the difference between a cow and a dog?"
s_system = "The clear answer for this question would be:"
formatted_prompt = f"<|im_start|>user\n{prompt}<|im_end|>\n<|im_start|>assistant\n{s_system}"
stream = llm(formatted_prompt,
top_k=50, repeat_penalty=1.1, top_p=0.9, max_tokens=64,
stop=["", ". ", "<|im_end|>"], echo=True, stream=True)
for s in stream:
print(s['choices'][0]['text'], end='')
i cannot recall the prompt (probably didn't use any anyway) but always use low temperature and play with top_p until you get something similar to what you expect