A simple and powerful AI-powered quiz generator built with Streamlit.
Enter any topic and get a high-quality multiple-choice quiz with explanations in seconds.
- Generate quizzes on any topic
- Choose number of questions (3–20)
- Select difficulty level (Easy / Medium / Hard)
- Multi-language support (English, Turkish, Spanish, German, French)
- Clean multiple-choice format (A, B, C, D)
- Correct answer + detailed explanation
- Download quiz as JSON or Text
- Supports multiple AI providers:
- OpenAI
- Groq
- xAI (Grok)
- Clone the repository:
git clone https://github.com/dinguk0624/ai-quiz-generator.git
cd ai-quiz-generator- Create a virtual environment (recommended):
python -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate- Install dependencies:
pip install -r requirements.txt- Create a
.envfile:
cp .env.example .env- Add your API key to the
.envfile:
OPENAI_API_KEY=sk-...
# or
GROQ_API_KEY=gsk_...
# or
XAI_API_KEY=xai-...- Run the app:
streamlit run app.pyai-quiz-generator/
├── app.py # Main application
├── requirements.txt # Dependencies
├── .env.example # Example environment variables
├── .gitignore
├── LICENSE
└── README.md
You only need one of the following:
| Provider | Environment Variable | Recommended Model |
|---|---|---|
| OpenAI | OPENAI_API_KEY |
gpt-4o-mini |
| Groq | GROQ_API_KEY |
llama-3.3-70b-versatile |
| xAI | XAI_API_KEY |
grok-3 |
This project is licensed under the MIT License - see the LICENSE file for details.
Contributions, issues and feature requests are welcome!
Made with ❤️ using Streamlit + AI