A Python-based AI debate system that facilitates structured discussions between two AI models (Zephyr and Mistral) using Ollama. The system provides a real-time, interactive debate experience with distinct AI personalities and perspectives.
- 🤖 Dual AI Debate: Engage two different AI models (Zephyr and Mistral) in a structured debate
- 🎨 Colorful Interface: Clear visual separation between speakers with color-coded responses
- 💬 Real-time Streaming: Watch the debate unfold in real-time with streaming responses
- 🔄 Robust Error Handling: Automatic retries and graceful error recovery
- 🎯 Structured Conversation: Maintains conversation history and context
- 🎭 Distinct Personalities: Each AI has a unique debating style and perspective
- Object-oriented design with
DebateManagerclass for state management - Type-hinted code for better IDE support and maintainability
- Modular structure for easy extension and modification
- Zephyr (7B): Empathetic and thoughtful debate partner
- Mistral (7B): Dynamic and insightful counter-perspective
- Both models run locally via Ollama
- Automatic retry mechanism for failed API calls
- Graceful degradation when responses fail
- Clear error messages and status updates
- Python 3.8 or higher
- Ollama installed and running locally
- Required Python packages (see requirements.txt)
-
Install Ollama:
# macOS/Linux curl https://ollama.ai/install.sh | sh
-
Pull Required Models:
ollama pull zephyr:7b ollama pull mistral:7b
-
Install Python Dependencies:
pip install -r requirements.txt
-
Start Ollama:
ollama serve
-
Run the script:
python DebatingAI.py
-
Enter a debate topic when prompted
-
Watch the AI models debate in real-time
-
Choose to continue or end the debate after each round
DebatingAI/
├── DebatingAI.py # Main application file
├── requirements.txt # Python dependencies
└── README.md # This documentation
DebateManager: Core class managing debate state and AI interactionscall_ai(): Generic method for AI model communicationadd_message(): Message history managementrainbow_text(): UI enhancement for user prompts