Instructions to use zenlm/zen-nano with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use zenlm/zen-nano with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="zenlm/zen-nano") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("zenlm/zen-nano") model = AutoModelForCausalLM.from_pretrained("zenlm/zen-nano") 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]:])) - llama-cpp-python
How to use zenlm/zen-nano with llama-cpp-python:
# !pip install llama-cpp-python from llama_cpp import Llama llm = Llama.from_pretrained( repo_id="zenlm/zen-nano", filename="gguf/zen-nano-0.6b-Q4_K_M.gguf", )
llm.create_chat_completion( messages = [ { "role": "user", "content": "What is the capital of France?" } ] ) - Inference
- Notebooks
- Google Colab
- Kaggle
- Local Apps
- llama.cpp
How to use zenlm/zen-nano with llama.cpp:
Install from brew
brew install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama-server -hf zenlm/zen-nano:Q4_K_M # Run inference directly in the terminal: llama-cli -hf zenlm/zen-nano:Q4_K_M
Install from WinGet (Windows)
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama-server -hf zenlm/zen-nano:Q4_K_M # Run inference directly in the terminal: llama-cli -hf zenlm/zen-nano: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 zenlm/zen-nano:Q4_K_M # Run inference directly in the terminal: ./llama-cli -hf zenlm/zen-nano: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 zenlm/zen-nano:Q4_K_M # Run inference directly in the terminal: ./build/bin/llama-cli -hf zenlm/zen-nano:Q4_K_M
Use Docker
docker model run hf.co/zenlm/zen-nano:Q4_K_M
- LM Studio
- Jan
- vLLM
How to use zenlm/zen-nano with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "zenlm/zen-nano" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "zenlm/zen-nano", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/zenlm/zen-nano:Q4_K_M
- SGLang
How to use zenlm/zen-nano 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 "zenlm/zen-nano" \ --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": "zenlm/zen-nano", "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 "zenlm/zen-nano" \ --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": "zenlm/zen-nano", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Ollama
How to use zenlm/zen-nano with Ollama:
ollama run hf.co/zenlm/zen-nano:Q4_K_M
- Unsloth Studio new
How to use zenlm/zen-nano 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 zenlm/zen-nano 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 zenlm/zen-nano to start chatting
Using HuggingFace Spaces for Unsloth
# No setup required # Open https://huggingface.co/spaces/unsloth/studio in your browser # Search for zenlm/zen-nano to start chatting
- Pi new
How to use zenlm/zen-nano with Pi:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama-server -hf zenlm/zen-nano:Q4_K_M
Configure the model in Pi
# Install Pi: npm install -g @mariozechner/pi-coding-agent # Add to ~/.pi/agent/models.json: { "providers": { "llama-cpp": { "baseUrl": "http://localhost:8080/v1", "api": "openai-completions", "apiKey": "none", "models": [ { "id": "zenlm/zen-nano:Q4_K_M" } ] } } }Run Pi
# Start Pi in your project directory: pi
- Hermes Agent new
How to use zenlm/zen-nano with Hermes Agent:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama-server -hf zenlm/zen-nano:Q4_K_M
Configure Hermes
# Install Hermes: curl -fsSL https://hermes-agent.nousresearch.com/install.sh | bash hermes setup # Point Hermes at the local server: hermes config set model.provider custom hermes config set model.base_url http://127.0.0.1:8080/v1 hermes config set model.default zenlm/zen-nano:Q4_K_M
Run Hermes
hermes
- Docker Model Runner
How to use zenlm/zen-nano with Docker Model Runner:
docker model run hf.co/zenlm/zen-nano:Q4_K_M
- Lemonade
How to use zenlm/zen-nano with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull zenlm/zen-nano:Q4_K_M
Run and chat with the model
lemonade run user.zen-nano-Q4_K_M
List all available models
lemonade list
llm.create_chat_completion(
messages = [
{
"role": "user",
"content": "What is the capital of France?"
}
]
)Zen Nano 0.6B
Zen Nano is an ultra-lightweight 0.6B parameter language model optimized for edge devices and mobile deployment. A compact foundation model that delivers impressive performance in a tiny package.
Model Details
- Model Type: Causal Language Model
- Architecture: 0.6B dense transformer
- Parameters: 0.6 billion
- License: Apache 2.0
- Languages: English, Chinese
- Context Length: 32K tokens
- Developed by: Zen AI Team (Hanzo AI)
Capabilities
- 💡 Lightweight: Only 0.6B parameters for edge deployment
- 📱 Mobile-Ready: Runs on smartphones and IoT devices
- ⚡ Fast: 44K tokens/sec on M3 Max (MLX)
- 🔋 Efficient: Low power consumption
- 🌐 Multilingual: English and Chinese support
- 📦 Multiple Formats: PyTorch, MLX, GGUF (Q2_K to F16)
- 🎯 32K Context: Extended context window
Performance
Throughput
- M3 Max (MLX): 44,000 tokens/sec
- RTX 4090 (GGUF Q4): 35,000 tokens/sec
- iPhone 15 Pro: 8,000 tokens/sec
- Raspberry Pi 5: 2,500 tokens/sec
Memory Usage
| Format | VRAM/RAM |
|---|---|
| Q2_K | 0.3GB |
| Q4_K_M | 0.4GB |
| Q8_0 | 0.7GB |
| F16 | 1.2GB |
Use Cases
- Edge AI applications
- Mobile chatbots
- IoT device intelligence
- Offline AI assistants
- Resource-constrained environments
- Real-time inference
- Embedded systems
Installation
Transformers
from transformers import AutoModelForCausalLM, AutoTokenizer
model = AutoModelForCausalLM.from_pretrained(
"zenlm/zen-nano-0.6b",
torch_dtype="auto",
device_map="auto"
)
tokenizer = AutoTokenizer.from_pretrained("zenlm/zen-nano-0.6b")
MLX (Apple Silicon)
from mlx_lm import load, generate
model, tokenizer = load("zenlm/zen-nano-0.6b")
response = generate(model, tokenizer, prompt="Hello!", max_tokens=100)
GGUF (llama.cpp)
./llama-cli -m zen-nano-0.6b-Q4_K_M.gguf -p "Hello!" -n 100
Zen Engine
zen-engine serve --model zenlm/zen-nano-0.6b --port 3690
Training with Zen Gym
Fine-tune Zen Nano for your use case:
cd /path/to/zen-gym
llamafactory-cli train \
--config configs/zen_nano_lora.yaml \
--dataset your_dataset
Benchmarks
| Task | Score | Notes |
|---|---|---|
| MMLU | 35.2% | 5-shot |
| GSM8K | 28.4% | 8-shot CoT |
| HumanEval | 24.1% | pass@1 |
| MATH | 18.7% | 4-shot |
Limitations
- Smaller capacity than larger models
- May struggle with complex reasoning
- Limited specialized knowledge
- Best for short-to-medium contexts
- Quantization reduces quality slightly
Citation
@misc{zennano2025,
title={Zen Nano: Ultra-Lightweight Language Model},
author={Zen AI Team},
year={2025},
howpublished={\url{https://huggingface.co/zenlm/zen-nano-0.6b}}
}
Links
- GitHub: https://github.com/zenlm
- Zen Gym (Training): https://github.com/zenlm/zen-gym
- Zen Engine (Inference): https://github.com/zenlm/zen-engine
Part of the Zen AI ecosystem.
Citation
@misc{zenlm2025zen-nano,
title={Zen LM: zen-nano},
author={Hanzo AI and Zoo Labs Foundation},
year={2025},
publisher={HuggingFace},
howpublished={\url{https://huggingface.co/zenlm/zen-nano}}
}
Abliteration
Zen Nano 0.6B weights are derived from an abliterated base model. Abliteration removes refusal behavior by identifying and nullifying the "refusal direction" in the model's residual stream, as described in Maxime Labonne's methodology.
Method: Directional ablation on the residual stream across all layers Source: Zen MoDE (Mixture of Distilled Experts) architecture base Effect: Removes refusal behaviors while preserving all other capabilities Identity layer: Zen identity added via system prompt — full LoRA fine-tuning planned
Abliteration is a feature, not a limitation. It enables unrestricted research, security testing, and applications where safety guardrails are managed at the application layer rather than baked into model weights.
- Downloads last month
- 70
# !pip install llama-cpp-python from llama_cpp import Llama llm = Llama.from_pretrained( repo_id="zenlm/zen-nano", filename="", )