A Gradio web app where two AI models debate any topic you choose. A third AI model acts as an impartial analyst to determine the winner.
https://huggingface.co/spaces/randrewsv/ai-debate
- Python 3.9+
- Hugging Face Account (free): Required for API access to AI models
- Sign up at huggingface.co
- The app uses the HF Inference API to run LLMs without local GPU requirements
-
Create virtual environment
python -m venv venv
-
Activate venv
# Windows venv\Scripts\activate # Linux/Mac source venv/bin/activate
-
Install dependencies
pip install -r requirements.txt
python app.pyOpen the URL shown in terminal (default: http://127.0.0.1:7860).
- Click Login with Hugging Face in the sidebar
- Enter a debate topic
- Select models for Bot 1, Bot 2, and Analyst
- Click Start Debate
src/
├── __init__.py # Package metadata
├── config.py # Models list, CSS, constants
├── clients.py # HuggingFace API client setup
├── streaming.py # Real-time response streaming
├── debate.py # Debate orchestration logic
└── ui.py # Gradio interface
MIT