--- title: Gemini + Claude Distractor Generator emoji: 🧠 colorFrom: indigo colorTo: pink sdk: gradio sdk_version: "4.26.0" app_file: app.py pinned: false --- # Gemini + Claude Distractor Generator This is a web app that uses **Gemini 1.5 Flash (Free Tier)** to generate multiple-choice distractors and then uses **Claude 3.5 Sonnet (via OpenRouter)** to **rank the distractors** based on how confusing they are. ## Features - Generates distractors using Gemini 1.5 Flash - Uses Claude Sonnet 3.5 to evaluate and rank distractors (LLM-as-Judge) - Displays the correct answer, distractors, and Claude's ranking - Simple and clean Gradio UI ## Files - `app.py`: Main Gradio application logic - `requirements.txt`: Dependencies - `README.md`: This file ## How to Run ### Locally 1. Install dependencies: ```bash pip install -r requirements.txt ``` 2. Set your API keys inside `app.py`: - Gemini API key (for generation) - OpenRouter API key (for ranking via Claude) 3. Run: ```bash python app.py ``` 4. Open the Gradio link shown in your terminal. ### On Hugging Face Spaces 1. Upload `app.py`, `requirements.txt`, and `README.md` 2. Choose `Gradio` as the SDK 3. Make sure to set your **Gemini API key** and **OpenRouter API key** via HF secrets or hardcode for testing 4. Set `app.py` as your main file (`app_file`) ## Notes - Claude is used only to rank distractors; Gemini handles generation. - Free-tier Gemini is slower and limited — ranking may take longer due to OpenRouter limits.