Instructions to use Orivael-SRD-Lab/tinyllama-1b-srd4 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- llama-cpp-python
How to use Orivael-SRD-Lab/tinyllama-1b-srd4 with llama-cpp-python:
# !pip install llama-cpp-python from llama_cpp import Llama llm = Llama.from_pretrained( repo_id="Orivael-SRD-Lab/tinyllama-1b-srd4", filename="tinyllama_1b_srd4_q4km.gguf", )
llm.create_chat_completion( messages = [ { "role": "user", "content": "What is the capital of France?" } ] ) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- llama.cpp
How to use Orivael-SRD-Lab/tinyllama-1b-srd4 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 Orivael-SRD-Lab/tinyllama-1b-srd4 # Run inference directly in the terminal: llama cli -hf Orivael-SRD-Lab/tinyllama-1b-srd4
Install from WinGet (Windows)
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama serve -hf Orivael-SRD-Lab/tinyllama-1b-srd4 # Run inference directly in the terminal: llama cli -hf Orivael-SRD-Lab/tinyllama-1b-srd4
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 Orivael-SRD-Lab/tinyllama-1b-srd4 # Run inference directly in the terminal: ./llama-cli -hf Orivael-SRD-Lab/tinyllama-1b-srd4
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 Orivael-SRD-Lab/tinyllama-1b-srd4 # Run inference directly in the terminal: ./build/bin/llama-cli -hf Orivael-SRD-Lab/tinyllama-1b-srd4
Use Docker
docker model run hf.co/Orivael-SRD-Lab/tinyllama-1b-srd4
- LM Studio
- Jan
- vLLM
How to use Orivael-SRD-Lab/tinyllama-1b-srd4 with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "Orivael-SRD-Lab/tinyllama-1b-srd4" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Orivael-SRD-Lab/tinyllama-1b-srd4", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/Orivael-SRD-Lab/tinyllama-1b-srd4
- Ollama
How to use Orivael-SRD-Lab/tinyllama-1b-srd4 with Ollama:
ollama run hf.co/Orivael-SRD-Lab/tinyllama-1b-srd4
- Unsloth Studio
How to use Orivael-SRD-Lab/tinyllama-1b-srd4 with Unsloth Studio:
Install Unsloth Studio (macOS, Linux, WSL)
curl -fsSL https://unsloth.ai/install.sh | sh # Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for Orivael-SRD-Lab/tinyllama-1b-srd4 to start chatting
Install Unsloth Studio (Windows)
irm https://unsloth.ai/install.ps1 | iex # Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for Orivael-SRD-Lab/tinyllama-1b-srd4 to start chatting
Using HuggingFace Spaces for Unsloth
# No setup required # Open https://huggingface.co/spaces/unsloth/studio in your browser # Search for Orivael-SRD-Lab/tinyllama-1b-srd4 to start chatting
- Atomic Chat new
- Docker Model Runner
How to use Orivael-SRD-Lab/tinyllama-1b-srd4 with Docker Model Runner:
docker model run hf.co/Orivael-SRD-Lab/tinyllama-1b-srd4
- Lemonade
How to use Orivael-SRD-Lab/tinyllama-1b-srd4 with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull Orivael-SRD-Lab/tinyllama-1b-srd4
Run and chat with the model
lemonade run user.tinyllama-1b-srd4-{{QUANT_TAG}}List all available models
lemonade list
TinyLlama-1.1B · SRD4 Q4_K_M
Standard GGUF — drop into any llama.cpp build, no custom kernels.
Base model: TinyLlama/TinyLlama-1.1B-Chat-v1.0
Quantization: SRD4 → Q4_K_M
File size: ~670 MB
What is SRD?
Standard Q4_K_M loses information systematically. Stochastic Residual Dithering (SRD)
computes an INT8 residual (D8) before quantization. At load time the corrected weights
are: W ≈ W4 + D8 × S8. Inference speed is identical to vanilla Q4_K_M after load.
For TinyLlama specifically, full SRD (D8 applied to all layers) outperforms selective correction. TinyLlama was trained with a uniform objective across layers (3T tokens on SlimPajama/The Pile), without the layer-specialization curriculum of newer architectures. All layers benefit equally from D8 restoration.
Benchmark results
Evaluated on TruthfulQA MC1 (817 questions) and WikiText-2 perplexity.
| Mode | TruthfulQA MC1 ↑ | WikiText-2 PPL ↓ | Δ PPL | D8 overhead |
|---|---|---|---|---|
| Baseline Q4_K_M | 0.289 | 10.46 | — | 0 MB |
| Selective SRD (reasoning layers) | 0.283 | 10.23 | -0.23 | 98 MB |
| Full SRD (all layers) | 0.292 | 10.18 | -0.28 | 392 MB |
Full SRD is recommended for this model. The LLaMA-1 architecture distributes information uniformly — partial correction creates layer mismatch on MC1, though both modes improve perplexity.
WikiText-2 PPL is the primary signal for TinyLlama. SRD delivers a clear -0.23 to -0.28 improvement in language modeling quality. The MC1 differences (±0.006) are within statistical noise (SE ≈ ±0.031 at n=200).
Usage
llama-cli -m tinyllama-1b-srd4-q4km.gguf \
-p "<|system|>\nYou are a helpful assistant.</s>\n<|user|>\nWhat is the speed of light?</s>\n<|assistant|>\n" \
--n-predict 100
How it was built
from research.quant.quantize_model import quantize_hf_model_inplace
from transformers import AutoModelForCausalLM
model = AutoModelForCausalLM.from_pretrained(
"TinyLlama/TinyLlama-1.1B-Chat-v1.0", torch_dtype=torch.float16
)
quantize_hf_model_inplace(model, alpha=1.0, group_size=64)
# → converted to GGUF Q4_K_M via llama.cpp convert_hf_to_gguf.py
Pipeline: orivael-dev/axiom — branch claude/srd-prototype-benchmark-JRtv1
Contribute results
Run llama-perplexity on WikiText-2 and open a Discussion with:
- Hardware (CPU / CUDA / Metal / ROCm)
- Perplexity score
- Tokens/sec
- Downloads last month
- 30
We're not able to determine the quantization variants.
Model tree for Orivael-SRD-Lab/tinyllama-1b-srd4
Base model
TinyLlama/TinyLlama-1.1B-Chat-v1.0