Instructions to use z51722369/ZOZ-Reasoning-Master-3B with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use z51722369/ZOZ-Reasoning-Master-3B with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="z51722369/ZOZ-Reasoning-Master-3B") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("z51722369/ZOZ-Reasoning-Master-3B") model = AutoModelForCausalLM.from_pretrained("z51722369/ZOZ-Reasoning-Master-3B", 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
- vLLM
How to use z51722369/ZOZ-Reasoning-Master-3B with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "z51722369/ZOZ-Reasoning-Master-3B" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "z51722369/ZOZ-Reasoning-Master-3B", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/z51722369/ZOZ-Reasoning-Master-3B
- SGLang
How to use z51722369/ZOZ-Reasoning-Master-3B 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 "z51722369/ZOZ-Reasoning-Master-3B" \ --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": "z51722369/ZOZ-Reasoning-Master-3B", "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 "z51722369/ZOZ-Reasoning-Master-3B" \ --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": "z51722369/ZOZ-Reasoning-Master-3B", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use z51722369/ZOZ-Reasoning-Master-3B with Docker Model Runner:
docker model run hf.co/z51722369/ZOZ-Reasoning-Master-3B
โก ZOZ-Reasoning-Master-3B
A Lightweight, Tri-Stage Agentic Foundation Model (3.09B Parameters)
Hermes Function Calling โข LongBench-v2 In-Context Reasoning โข Magpie-Pro Conversational Alignment
๐ Model Overview
ZOZ-Reasoning-Master-3B is a compact, high-efficiency language model engineered specifically to operate as an Autonomous Edge Agent. It was developed using a sequential Tri-Stage Agentic Pipeline designed to bridge three core competencies rarely found together in 3B-class models: strict schema-compliant tool calling, resilient long-context retrieval without degradation, and structured multi-turn reasoning.
| Attribute | Specification |
|---|---|
| Base Architecture | Qwen2.5-3B (Causal LM) |
| Parameter Count | 3.09 Billion |
| Shipped Weights | Fully Merged FP16 (Unquantized) |
| Context Window | 32,768 Tokens (Trained & Optimized up to 4,096 Tokens) |
| Prompt Format | ChatML (`< |
| Developer | ZOZ AI / Ziad Khodr |
๐ฌ The Tri-Stage Training Pipeline
To prevent Catastrophic Forgetting, the model was trained through an incremental staging protocol:
[Qwen2.5-3B-Instruct]
โ
โผ (Stage 1: Tool Use & Schema Discipline)
[ZOZ-Function-Master-3B] โโโบ NousResearch/hermes-function-calling-v1
โ
โผ (Stage 2: Deep Needle Retrieval & Multi-Hop Reasoning)
[ZOZ-Function-Master-3B-LongContext] โโโบ zai-org/LongBench-v2
โ
โผ (Stage 3: Conversational CoT & Logic Alignment)
[ZOZ-Reasoning-Master-3B] โโโบ Magpie-Align/Magpie-Pro-300K-Filtered (Curated)
- Stage 1 (Function Calling & Tool Use): Fine-tuned on Hermes function-calling datasets to enforce strict JSON output syntax and eliminate parameter hallucination.
- Stage 2 (In-Context Reasoning & Long Retrieval): Trained on hard reasoning tasks from LongBench-v2 to mitigate the Lost-in-the-Middle phenomenon and enable needle-in-a-haystack data extraction.
- Stage 3 (Conversational Alignment): Aligned with a curated subset of Magpie-Pro to impart clean chain-of-thought (CoT) reasoning distilled from frontier models (Llama-3.1-70B) without diluting tool-calling precision.
๐ Quickstart & Inference
1. Basic Reasoning & Chat
import torch
from transformers import AutoModelForCausalLM, AutoTokenizer
model_id = "z51722369/ZOZ-Reasoning-Master-3B"
tokenizer = AutoTokenizer.from_pretrained(model_id)
model = AutoModelForCausalLM.from_pretrained(
model_id,
torch_dtype=torch.float16,
device_map="auto"
)
messages = [
{"role": "system", "content": "You are ZOZ-Reasoning-Master, a precise and logical AI agent."},
{"role": "user", "content": "Analyze the potential bottlenecks of deploying an in-memory Redis cache versus a persistent disk store in a high-throughput microservices architecture."}
]
prompt = tokenizer.apply_chat_template(messages, tokenize=False, add_generation_prompt=True)
inputs = tokenizer(prompt, return_tensors="pt").to(model.device)
outputs = model.generate(
**inputs,
max_new_tokens=512,
temperature=0.3,
top_p=0.9,
repetition_penalty=1.1,
do_sample=True
)
response = tokenizer.decode(outputs[0][inputs.input_ids.shape[1]:], skip_special_tokens=True)
print(response)
2. Function Calling Example
tools_schema = """[
{
"type": "function",
"function": {
"name": "query_database",
"description": "Execute a structured SQL query against the production telemetry database.",
"parameters": {
"type": "object",
"properties": {
"table": {"type": "string", "description": "Target database table"},
"filter": {"type": "string", "description": "SQL WHERE clause filter"}
},
"required": ["table", "filter"]
}
}
}
]"""
messages = [
{"role": "system", "content": f"You are an agent with access to external tools. Available tools:\n{tools_schema}"},
{"role": "user", "content": "Check all failed authentication events in the audit_logs table from the last 2 hours."}
]
prompt = tokenizer.apply_chat_template(messages, tokenize=False, add_generation_prompt=True)
inputs = tokenizer(prompt, return_tensors="pt").to(model.device)
with torch.no_grad():
outputs = model.generate(**inputs, max_new_tokens=256, temperature=0.1)
print(tokenizer.decode(outputs[0][inputs.input_ids.shape[1]:], skip_special_tokens=True))
# Expected Output: <tool_call> {"name": "query_database", "arguments": {"table": "audit_logs", "filter": "status = 'FAILED' AND timestamp >= NOW() - INTERVAL 2 HOUR"}} </tool_call>
โ๏ธ Hyperparameters & Training Specifications
| Stage | Dataset | Sample Size | Learning Rate | Effective Batch Size | Wall Time |
|---|---|---|---|---|---|
| Stage 1 (FC) | hermes-function-calling-v1 |
~15,000 | 2e-4 |
8 | ~1.5 Hours |
| Stage 2 (LC) | zai-org/LongBench-v2 |
503 (Hard) | 1e-4 |
4 | ~35 Mins |
| Stage 3 (Align) | Magpie-Pro-300K-Filtered |
6,000 (Curated) | 1.5e-4 |
8 | ~1 Hour |
- Adapter Method: LoRA ($r=16, \alpha=32$, Dropout = $0.05$)
- Target Modules:
q_proj,k_proj,v_proj,o_proj,gate_proj,up_proj,down_proj - Optimizer:
paged_adamw_8bit - Precision: Mixed FP16 via PyTorch Distributed (
torchrunDDP across 2x Tesla T4 GPUs) - Gradient Clipping:
max_grad_norm = 0.3
๐ฏ Intended Use Cases
- Local RAG Pipelines: High-speed document reasoning engine for locally indexed knowledge bases.
- Autonomous Micro-Agents: Routing, parameter extraction, and execution loops across webhooks and internal APIs.
- Edge & On-Device Deployment: Direct export to 4-bit GGUF or AWQ formats for low-latency execution on mobile devices, Apple Silicon, or embedded compute platforms (e.g., Raspberry Pi 5, Jetson Orin).
โ ๏ธ Limitations & Boundary Conditions
- World Knowledge Limits: As a 3B parameter model, it is not intended to replace 70B+ models for deep encyclopedic trivia. It delivers optimal accuracy when grounded with context or tools.
- Context Window Best Practices: While supporting 32K context natively, maintaining inference sequences between 1,024 and 4,096 tokens yields the best balance between latency and memory footprint.
๐ Citation
If you use or build upon ZOZ-Reasoning-Master-3B, please cite:
@misc{zoz_reasoning_master_3b_2026,
author = {Ziad Khodr (ZOZ AI)},
title = {ZOZ-Reasoning-Master-3B: A Specialized Long-Context & Function-Calling 3B Agent},
year = {2026},
publisher = {Hugging Face},
howpublished = {\url{[https://huggingface.co/z51722369/ZOZ-Reasoning-Master-3B](https://huggingface.co/z51722369/ZOZ-Reasoning-Master-3B)}}
}
- Downloads last month
- -
Model tree for z51722369/ZOZ-Reasoning-Master-3B
Base model
z51722369/ZOZ-Function-Master-3B-LongContext