A Python application that orchestrates conversations between multiple AI models (ChatGPT, Gemini, and Claude) in a round-robin fashion. The AIs engage in structured dialogues, building upon each other's responses to explore complex topics and generate rich, multi-perspective conversations.
- Multi-AI Conversations: Supports ChatGPT (OpenAI), Gemini (Google), and Claude (Anthropic)
- Round-Robin Dialogue: AIs take turns responding to each other in a configurable order
- Flexible Configuration: Easily customize conversation parameters, AI participants, and model selection
- Comprehensive Logging: Dual logging system with detailed timestamps and clean dialogue-only logs
- Model Selection: Choose from the latest AI models with different capabilities and pricing
- Error Handling: Robust error handling with graceful degradation
- Security-First: Template-based configuration to protect API keys
- Python 3.7 or higher
- API keys for the AI services you want to use:
- OpenAI API Key (for ChatGPT)
- Google AI Studio API Key (for Gemini)
- Anthropic API Key (for Claude)
-
Clone or download this repository
git clone <repository-url> cd ai-orchestrator
-
Install dependencies
pip install -r requirements.txt
-
Set up configuration
# Copy the template configuration file cp config.template.ini config.ini # Edit config.ini and replace the placeholder API keys with your real ones # Example: CHATGPT_API_KEY = sk-your-actual-api-key-here
-
Run the program
python ai_orchestrator.py
ai-orchestrator/
βββ ai_orchestrator.py # Main application file
βββ config.template.ini # Configuration template (safe for version control)
βββ config.ini # Your actual configuration (ignored by git)
βββ requirements.txt # Python dependencies
βββ README.md # This file
βββ .gitignore # Git ignore rules
βββ logs/ # Generated log files (created automatically)
βββ conversation_log.txt # Detailed log with timestamps
βββ conversation_alone.txt # Clean dialogue-only log
The application uses config.ini for all settings. Here are the key configuration options:
[API_KEYS]
CHATGPT_API_KEY = your-openai-api-key-here
GEMINI_API_KEY = your-google-api-key-here
CLAUDE_API_KEY = your-anthropic-api-key-here[CONVERSATION_SETTINGS]
# Which AIs participate and in what order
PARTICIPATING_AIS = ChatGPT,Claude
# The message that starts the conversation
INITIAL_MESSAGE = Hello! Let's discuss artificial intelligence.
# Which AI receives the first message
INITIAL_AI_TARGET = ChatGPT
# Number of back-and-forth exchanges after the initial response
NUMBER_OF_TURNS = 10
# How many previous messages each AI sees for context
HISTORY_LENGTH = 5
# Where to save the conversation log
LOG_FILE = conversation_log.txt
# Optional instructions sent to all AIs
SYSTEM_PROMPT = You are a helpful assistant.# Choose specific models for each AI service
CHATGPT_MODEL_NAME = gpt-4.1-mini # Cost-effective option
GEMINI_MODEL_NAME = gemini-2.0-flash # Fast and efficient
CLAUDE_MODEL_NAME = claude-sonnet-4 # Balanced performance- gpt-4o - Latest GPT-4 optimized model (high capability, higher cost)
- gpt-4.1-mini - Compact version with good performance (recommended for cost-effectiveness)
- gpt-4.1 - Enhanced GPT-4 with improvements
- o3 - Advanced reasoning model (specialized use cases)
- gemini-2.5-pro-preview - Latest Pro model (best quality)
- gemini-2.0-flash - Current Flash model (recommended for speed)
- gemini-1.5-pro-latest - Stable Pro version
- gemini-1.5-flash-latest - Stable Flash version
- claude-opus-4 - Most capable model (highest quality, higher cost)
- claude-sonnet-4 - Balanced performance and cost (recommended)
- claude-haiku-3.5 - Fastest and most economical
PARTICIPATING_AIS = ChatGPT,Claude
INITIAL_MESSAGE = We are two philosophers debating the nature of consciousness. One argues for materialism, the other for dualism. Begin the debate.
NUMBER_OF_TURNS = 20
SYSTEM_PROMPT = You are a knowledgeable philosopher. Present rigorous arguments and respond thoughtfully to counterarguments.PARTICIPATING_AIS = ChatGPT,Gemini,Claude
INITIAL_MESSAGE = Let's collaboratively write a science fiction story. Start with a character discovering something unusual.
NUMBER_OF_TURNS = 15
SYSTEM_PROMPT = You are a creative writer. Build upon the previous narrative while adding your own creative elements.PARTICIPATING_AIS = ChatGPT,Claude
INITIAL_MESSAGE = Discuss the pros and cons of different machine learning architectures for natural language processing.
SYSTEM_PROMPT = You are a technical expert. Provide detailed, accurate information and cite relevant research when possible.AI API calls cost money based on token usage. Here are some tips to manage costs:
- Use smaller models:
gpt-4.1-mini,gemini-2.0-flash,claude-haiku-3.5 - Reduce
NUMBER_OF_TURNSfor shorter conversations - Lower
HISTORY_LENGTHto reduce context size - Test with 2-3 turns before running long conversations
- Check your API usage dashboards regularly
- Set up billing alerts in your AI service accounts
- Monitor the generated log files to understand token consumption patterns
"Could not find configuration file"
- Ensure you've copied
config.template.initoconfig.ini - Check that the file is in the same directory as
ai_orchestrator.py
"API key appears to be placeholder"
- Edit
config.iniand replaceYOUR_API_KEY_HEREwith your actual API key - Ensure there are no extra spaces or quotes around the API key
"AI not recognized"
- Check spelling in
PARTICIPATING_AIS(case-sensitive: ChatGPT, Gemini, Claude) - Ensure the AI name matches exactly
API Errors
- Verify your API keys are valid and have sufficient credits
- Check that the model names are correct and currently available
- Some models may have usage restrictions or require special access
To debug issues, start with minimal settings:
PARTICIPATING_AIS = ChatGPT
NUMBER_OF_TURNS = 2
HISTORY_LENGTH = 2
INITIAL_MESSAGE = Hello, how are you?- Never commit
config.iniwith real API keys to version control - The
.gitignorefile is configured to prevent accidental commits - Keep your API keys secure and rotate them periodically
- Monitor your API usage for unexpected activity
- Consider using environment variables for API keys in production deployments
The application generates two types of logs:
Contains timestamps, system messages, and full conversation flow:
[2025-05-28 16:30:15] System: Starting conversation. Log file: conversation_log.txt
[2025-05-28 16:30:15] USER: Hello! Let's discuss AI.
[2025-05-28 16:30:18] ChatGPT: Hello! I'd be happy to discuss AI with you...
Contains only the conversation without timestamps:
USER: Hello! Let's discuss AI.
ChatGPT: Hello! I'd be happy to discuss AI with you...
Claude: That's a fascinating topic. From my perspective...
Contributions are welcome! Here are some ways you can help:
- Report bugs or suggest features via GitHub issues
- Improve documentation
- Add support for new AI models or services
- Optimize performance or add new features
- Share interesting conversation examples
This project is open source. Please check the license file for details.
- OpenAI for the GPT models and API
- Google for the Gemini models and API
- Anthropic for the Claude models and API
- The Python community for excellent libraries
If you encounter issues:
- Check this README for common solutions
- Review the configuration template and examples
- Check the log files for error messages
- Ensure your API keys are valid and have sufficient credits
- Create an issue on GitHub with details about your problem
Happy AI orchestrating! ππ€