- Visit: https://aistudio.google.com/app/apikey
- Click "Create API Key"
- Copy your key
- Paste in
config.yamlunderapi_keys.google
No credit card required! Gemini Flash has a generous free tier.
Edit PROBLEM.txt with your problem statement:
Given an array of integers, find the maximum sum...
Input Format:
...
Output Format:
...
Constraints:
...
python main.pyThis will:
- Load problem from
PROBLEM.txt - Generate test cases
- Create brute force solution
- Iteratively generate optimal solutions (up to 5 attempts)
- Save all attempts with verdicts
- Generate
workspace/results.json
# Windows
start viewer.html
# macOS
open viewer.html
# Linux
xdg-open viewer.htmlpython -m http.server 8000Then visit: http://localhost:8000/viewer.html
- ✓/✗ Success status
- Total attempts made
- Success rate percentage
- Accepted solutions count
- Formatted with LaTeX support
- Use
$formula$or$$formula$$for math
- Input test cases
- Expected output (from brute force)
- Reference correct solution
- Syntax highlighted Python code
Each card shows:
- Attempt Number
- Verdict Badge:
- 🟢 Accepted (Green)
- 🔴 Wrong Answer (Red)
- 🟠 Runtime Error (Orange)
- ⚫ Generation Failed (Gray)
- Code (syntax highlighted)
- Error Message (if any)
- "Show Output Diff" button (for wrong answers)
Click "Show Output Diff" to see:
- Column 1: Input
- Column 2: Expected Output
- Column 3: Actual Output
Edit main.py and change the problem_statement variable:
problem_statement = """
Your problem here...
Input Format:
...
Output Format:
...
Constraints:
- Use $n \leq 10^5$ for LaTeX math
...
"""Then run python main.py again and refresh the viewer!
All in workspace/:
small_inputs.txt- Test casesbrute.py- Brute force solutionsmall_outputs.txt- Expected outputsoptimal_attempt_1.py- First attemptoptimal_attempt_1_output.txt- First attempt outputoptimal_attempt_2.py- Second attempt- ... (up to 10 attempts)
results.json- Viewer data
Edit config.yaml:
# Google Gemini (FREE!)
models:
tester_agent: "google:gemini-2.5-flash"
brute_agent: "google:gemini-2.5-flash"
optimal_agent: "google:gemini-2.5-flash"
execution:
max_optimal_attempts: 5 # Max retry count
timeout_seconds: 30 # Execution timeoutAvailable Google Gemini Models (FREE Tier):
google:gemini-2.5-flash- Fast, efficient (250 free requests/day) ⭐google:gemini-2.5-flash-lite- Faster, cheaper (1000 free requests/day)google:gemini-2.5-pro- Most capable (100 free requests/day)
- Run
python main.pyfirst - Check
workspace/results.jsonexists - Use HTTP server instead of file://
- Already fixed with UTF-8 encoding
- If still issues, use:
chcp 65001before running
- Use HTTP server:
python -m http.server 8000 - Files must be in
workspace/directory
For Google Gemini (FREE):
- Get key at: https://aistudio.google.com/app/apikey
- Set in
config.yaml:api_keys.google: "your-key" - Or env var:
export GOOGLE_API_KEY="your-key"
# 1. Get FREE Gemini API key
# Visit: https://aistudio.google.com/app/apikey
# Add to config.yaml under api_keys.google
# 2. Run solver
python main.py
# 3. Check console output
# See attempts, verdicts, and success/failure
# 4. Open viewer
start viewer.html # Windows
# or
python -m http.server 8000 # Then visit localhost:8000/viewer.html
# 5. Explore results
# - View all attempts in reverse order
# - Click "Show Output Diff" to debug
# - Check syntax-highlighted code- LaTeX Math: Use
$...$for inline math,$$...$$for display math - Small Test Cases: TesterAgent generates 3-5 small cases for speed
- Feedback Loop: Each failed attempt gets detailed feedback for next try
- All Saved: Every attempt preserved - nothing is lost!
- Reverse Order: Latest attempts shown first for easy access
Enjoy! 🎉