An intelligent routing system that automatically selects the best AI teacher for your question based on complexity. Three distinct teaching personalities work together to provide the optimal learning experience.
| Teacher | Base Model | Size | Personality | Best For |
|---|---|---|---|---|
| Quick Tutor | qwen2.5:1.5b | ~1GB | โก Snappy, energetic, micro-learning | Quick facts, definitions, mnemonics |
| Balanced Tutor | mistral | ~4GB | ๐ฌ Warm, Socratic, conversational | General explanations, guided discovery |
| Deep Tutor | qwen2.5:14b | ~9GB | ๐ง Rigorous, academic mentor | Complex topics, in-depth analysis |
- Style: Flash-card format with memorable sound bites
- Temperature: 0.5 (focused and consistent)
- Max Response: 512 tokens
- Format: Core Answer โ Quick Example โ Check Question
- Perfect for: "What is DNA?", "Define photosynthesis", "List 3 examples"
- Style: Socratic dialogue, builds on what you know
- Temperature: 0.7 (natural conversation)
- Approach: Sandwich method (affirm โ expand โ encourage)
- Perfect for: "Explain how X works", "Compare A and B", "Why does Y happen?"
- Style: University-level depth with multiple perspectives
- Temperature: 0.75 (nuanced analysis)
- Max Response: 4096 tokens
- Structure: Overview โ Core Explanation โ Edge Cases โ Resources โ Challenge
- Perfect for: "Explain in detail...", "Step by step...", "Prove that...", Complex debugging
- Python 3.8+
- At least 10GB free disk space
- 16GB+ RAM recommended (8GB minimum)
curl -fsSL https://ollama.com/install.sh | shbrew install ollamaDownload from ollama.com/download
ollama serveKeep this terminal running. Open a new terminal for the next steps.
# Pull all three base models (this will take some time)
ollama pull qwen2.5:1.5b # ~1GB download
ollama pull mistral # ~4GB download
ollama pull qwen2.5:14b # ~9GB downloadNote: You can start with just one or two models if you have limited bandwidth or disk space.
cd /path/to/ABalancedTeacher
# Create all three teacher models
ollama create quick-tutor -f Modelfile.fast
ollama create balanced-tutor -f Modelfile.normal
ollama create deep-tutor -f Modelfile.strongpip install requestspython routing_client.py$ python routing_client.py
Temperature (0-1, default 0.7): [press Enter]
Ready! Type your message (or /bye to exit)
You: What is DNA?
[๐ quick-tutor] ๐ DNA is the molecule...| Command | Description |
|---|---|
/fast |
Force next query to use Quick Tutor |
/normal |
Force next query to use Balanced Tutor |
/strong |
Force next query to use Deep Tutor |
/auto |
Return to automatic routing (default) |
/status |
Show current routing mode |
/models |
List available models |
/bye |
Exit the program |
Simple query โ Routes to Quick Tutor:
You: Define photosynthesis
Medium query โ Routes to Balanced Tutor:
You: Explain how photosynthesis works
Complex query โ Routes to Deep Tutor:
You: Explain in detail the biochemical pathway of photosynthesis step by step
The system automatically analyzes your question and routes to the appropriate teacher:
- Greetings: "hi", "hello", "thanks"
- Short questions (< 10 words)
- Simple definitions: "What is X?"
- Quick lists: "Name 3 examples"
- General explanations: "explain", "why", "how does"
- Comparisons: "compare A and B"
- Basic code questions
- Medium-length queries (10-100 words)
- Detailed requests: "explain in detail", "step by step"
- Advanced topics: "algorithm", "architecture", "mathematical"
- Code debugging: "debug", "fix this code", "review my code"
- Multiple questions or complex code blocks
- Very long queries (100+ words)
Edit the model configuration in routing_client.py:
FAST_MODEL = "quick-tutor" # Change to any fast model
NORMAL_MODEL = "balanced-tutor" # Change to any medium model
STRONG_MODEL = "deep-tutor" # Change to any strong modelEdit the Modelfiles to customize teaching styles:
Modelfile.fast- Quick Tutor personalityModelfile.normal- Balanced Tutor personalityModelfile.strong- Deep Tutor personality
After editing, recreate the models:
ollama create quick-tutor -f Modelfile.fastWhen starting the client, enter a different temperature (0-1):
- Lower (0.3-0.5): More focused and deterministic
- Medium (0.6-0.8): Balanced creativity
- Higher (0.9-1.0): More creative and varied
| Component | Minimum | Recommended |
|---|---|---|
| RAM | 8GB | 16GB+ |
| Disk Space | 10GB | 20GB+ |
| GPU VRAM | Not required | 8GB+ (faster inference) |
| Model | Download | Disk Space | RAM Usage |
|---|---|---|---|
| Quick Tutor | ~600MB | ~1GB | ~2GB |
| Balanced Tutor | ~2.5GB | ~4GB | ~6GB |
| Deep Tutor | ~5GB | ~9GB | ~12GB |
CPU-only mode: Works fine but slower. GPU recommended for Deep Tutor.
# Make sure Ollama server is running
ollama serve# List available models
ollama list
# If models are missing, recreate them
ollama create quick-tutor -f Modelfile.fast
ollama create balanced-tutor -f Modelfile.normal
ollama create deep-tutor -f Modelfile.strong- Try using smaller models (Quick or Balanced Tutor)
- Close other applications to free up RAM
- Consider using GPU if available
- Start with only Quick Tutor (
ollama pull qwen2.5:1.5b) - Use
/fastcommand to force lightweight model - Close unnecessary applications
- Start Simple: Begin with Quick Tutor to get fast overviews
- Build Understanding: Move to Balanced Tutor for deeper exploration
- Master Topics: Use Deep Tutor for comprehensive understanding
- Experiment: Try forcing different teachers with commands to see how they differ
- Ask Follow-ups: Each teacher maintains conversation history
ABalancedTeacher/
โโโ README.md # This file
โโโ routing_client.py # Main application
โโโ Modelfile.fast # Quick Tutor configuration
โโโ Modelfile.normal # Balanced Tutor configuration
โโโ Modelfile.strong # Deep Tutor configuration
To modify the teaching styles:
- Edit the relevant Modelfile
- Recreate the model:
ollama create <name> -f Modelfile.<type> - Test with the routing client
- Ollama: ollama.com
- LM Arena: Rankings for model performance
- Qwen2.5: Alibaba's high-performing language models
- Mistral: Efficient 7B parameter model
This project uses open-source models. Check individual model licenses:
- Qwen2.5: Apache 2.0
- Mistral: Apache 2.0
- Add voice input/output
- Save conversation history
- Export learning notes
- Multi-language support
- Web interface
- Fine-tune for specific subjects
Version: 1.0.0
Last Updated: January 29, 2026
For questions or issues, refer to the Ollama Documentation.