How to use from
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 zenlm/zen-agent-4b:Q2_K
# Run inference directly in the terminal:
llama cli -hf zenlm/zen-agent-4b:Q2_K
Install from WinGet (Windows)
winget install llama.cpp
# Start a local OpenAI-compatible server with a web UI:
llama serve -hf zenlm/zen-agent-4b:Q2_K
# Run inference directly in the terminal:
llama cli -hf zenlm/zen-agent-4b:Q2_K
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-agent-4b:Q2_K
# Run inference directly in the terminal:
./llama-cli -hf zenlm/zen-agent-4b:Q2_K
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-agent-4b:Q2_K
# Run inference directly in the terminal:
./build/bin/llama-cli -hf zenlm/zen-agent-4b:Q2_K
Use Docker
docker model run hf.co/zenlm/zen-agent-4b:Q2_K
Quick Links

Zen Agent 4b

Compact 4B agent model with strong function calling and tool-use capabilities.

Overview

Fine-tuned from Qwen3-4B-Instruct-2507 (Apache 2.0) with Hanzo identity + agentic-data training + abliteration. Dense Qwen3 architecture, 4B parameters, 256K-token context.

Developed by Hanzo AI and the Zoo Labs Foundation.

Quick Start

from transformers import AutoModelForCausalLM, AutoTokenizer

model_id = "zenlm/zen-agent-4b"
tokenizer = AutoTokenizer.from_pretrained(model_id)
model = AutoModelForCausalLM.from_pretrained(model_id, torch_dtype="auto", device_map="auto")

messages = [{"role": "user", "content": "Hello!"}]
text = tokenizer.apply_chat_template(messages, tokenize=False, add_generation_prompt=True)
inputs = tokenizer([text], return_tensors="pt").to(model.device)
outputs = model.generate(**inputs, max_new_tokens=512)
print(tokenizer.decode(outputs[0][inputs.input_ids.shape[1]:], skip_special_tokens=True))

API Access

curl https://api.hanzo.ai/v1/chat/completions \
  -H "Authorization: Bearer $HANZO_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"model": "zen-agent-4b", "messages": [{"role": "user", "content": "Hello"}]}'

Get your API key at console.hanzo.ai โ€” $5 free credit on signup.

Model Details

Attribute Value
Base model Qwen/Qwen3-4B-Instruct-2507
Parameters 4B
Architecture Qwen3 (dense)
Context 256K tokens
License Apache 2.0

Credits

Fine-tuned from Qwen/Qwen3-4B-Instruct-2507 by Qwen (Alibaba Cloud), licensed under Apache 2.0. Hanzo adds identity training, agentic-data fine-tuning, and abliteration.

License

Apache 2.0 โ€” inherited from the Qwen3-4B-Instruct-2507 base model.

Downloads last month
1,595
Safetensors
Model size
4B params
Tensor type
F16
ยท
Inference Providers NEW
This model isn't deployed by any Inference Provider. ๐Ÿ™‹ Ask for provider support

Model tree for zenlm/zen-agent-4b

Finetuned
(1860)
this model

Spaces using zenlm/zen-agent-4b 3

Collection including zenlm/zen-agent-4b