mirror of
https://github.com/zenlm/zen-eco.git
synced 2026-10-30 14:58:11 +00:00
4.4 KiB
4.4 KiB
Zen Eco Models Training System
Overview
Comprehensive, reproducible training system for all Zen Eco model variants using a simple Makefile-based approach.
Quick Start
# Clone and train everything
git clone <repo>
cd zen-eco
make all
Model Variants
zen-eco-4b-instruct
- Base instruction-following model
- 4B parameters (Qwen3 architecture)
- Zen identity training
- Optimized for general tasks
zen-eco-4b-thinking
- Chain-of-thought reasoning model
- Uses
<thinking>tags for transparency - Step-by-step problem solving
- Same 4B parameter base
zen-eco-4b-agent
- Tool-calling and function use
- Structured output generation
- Agent capabilities
- Built on instruct model
Makefile Targets
Core Training
make instruct- Train instruction modelmake thinking- Train thinking modelmake agent- Setup agent modelmake all- Train everything
Utilities
make gguf- Generate GGUF quantized modelsmake test- Test all modelsmake upload- Upload to HuggingFacemake clean- Clean training artifactsmake help- Show help
Requirements
- Python 3.13
- 16GB+ RAM
- 50GB+ disk space
- macOS (MPS) or Linux (CUDA)
Reproducibility Features
- Fixed Seeds: All random operations use seed=42
- Disabled Telemetry: No wandb, no tracking
- Deterministic Training: Same results every run
- Simple Dependencies: Standard libraries only
- Clear Outputs: Color-coded progress
Directory Structure
zen-eco/
├── Makefile # Main build system
├── scripts/ # Training scripts
│ ├── train_instruct.py
│ ├── train_thinking.py
│ ├── setup_agent.py
│ ├── convert_gguf.py
│ ├── test_models.py
│ └── upload_models.py
├── output/ # Trained models
│ ├── zen-eco-4b-instruct/
│ ├── zen-eco-4b-thinking/
│ └── zen-eco-4b-agent/
└── gguf/ # Quantized models
Training Process
1. Identity Training
All models trained with Zen identity:
- "I am Zen Eco"
- "Created by Hanzo AI"
- Consistent personality
2. LoRA Fine-tuning
Efficient training using LoRA:
- r=16, alpha=32
- Target Q,K,V,O projections
- ~0.24% parameters trained
3. Minimal Epochs
Quick training for identity:
- 3 epochs default
- Small curated dataset
- Focus on identity preservation
Testing
# Test all models
make test
# Quick test
make test-only
Tests verify:
- Model loads correctly
- Generates responses
- Contains Zen identity
- Tool calling (agent only)
Upload to HuggingFace
# Set token
export HF_TOKEN=your_token_here
# Upload all models
make upload
Creates repositories:
{username}/zen-eco-4b-instruct{username}/zen-eco-4b-thinking{username}/zen-eco-4b-agent{username}/zen-eco-4b-{variant}-gguf
GGUF Quantization
Automatic conversion to GGUF:
- Q4_K_M quantization (default)
- ~2GB file size
- Compatible with llama.cpp
- Optimized for inference
Customization
Change Base Model
Edit Makefile:
BASE_MODEL := YourModel/Name
Adjust Training
Modify scripts parameters:
- Learning rate
- Batch size
- LoRA rank
- Epochs
Add New Variant
- Create script in
scripts/ - Add Makefile target
- Update test suite
Troubleshooting
Python 3.13 Required
brew install [email protected]
MPS Issues (Mac)
- FP16 disabled for MPS
- Use CPU fallback if needed
- Set
DEVICE=cpuin Makefile
Memory Issues
- Reduce batch size
- Use gradient accumulation
- Enable CPU offloading
Architecture Details
Base Model
- Qwen2.5-3B-Instruct (default)
- Qwen3 architecture
- 3.09B parameters
- 151936 vocab size
Training Config
- AdamW optimizer
- Cosine scheduler
- Gradient accumulation: 4
- Learning rate: 2e-5
Dataset
- Identity examples
- Thinking examples
- Tool-use examples
- Repeated for memorization
License
Apache 2.0
Credits
Created by Hanzo AI for the Zen model family.
Context for All AI Assistants
This file (LLM.md) is symlinked as:
.AGENTS.mdCLAUDE.mdQWEN.mdGEMINI.md
All files reference the same knowledge base. Updates here propagate to all AI systems.
Rules for AI Assistants
- ALWAYS update LLM.md with significant discoveries
- NEVER commit symlinked files (.AGENTS.md, CLAUDE.md, etc.) - they're in .gitignore
- NEVER create random summary files - update THIS file