This is a submission for the Hacktoberfest Open-Source AI Challenge Week 1: Touch Grass
What I Built
AI Code Debugger is a web tool that finds errors in your Python code, explains them in simple words, and can fix them automatically.
You paste your code, click Explain error to understand what went wrong, or click Auto-fix and the AI rewrites the code, re-runs it, and repeats (up to 3 tries) until the error is gone.
The "touch grass" angle: beginners can lose hours staring at a red error message. This tool shortens that time, so you can fix the bug, close the laptop, and go outside.
Who is it for: students and beginners learning Python who get stuck on errors.
Demo
🔗 Live app: https://semicolonsaviour.streamlit.app/
(Try the examples in the sidebar, like "Division by zero", then click Explain error or Auto-fix.)
Code
https://github.com/TANISHA268814/ai-code-debugger
How I Built It
- Open-weight models: Llama 3.3 70B (served through Groq's free tier) for the online demo, and Qwen2.5-Coder running locally through Ollama on my laptop.
- Framework: Python and Streamlit for the web interface.
-
How it works:
- The app runs the pasted code in a separate process with a 30-second timeout and catches the error.
- It sends the code and the error to the model with a beginner-friendly prompt.
- For Auto-fix, it asks the model for fixed code, runs it again, and repeats until it works or reaches 3 tries.
- Safety: API keys are hidden from the code being run, and the app keeps them in secrets, not in the repo.
-
Switchable AI: one small file (
llm.py) decides which model to use, so the same project works online with Groq or fully offline with Ollama.
Why Does Open Innovation Matter?
Open-weight models made this possible for a student with a normal laptop and no budget:
- It runs offline and privately. With Ollama, your code never leaves your computer, which matters when you're pasting homework or work code.
- It's free. I didn't need to pay for a closed API to build and test it.
- It's swappable. When one hosted service ran out of free credits during deployment, I switched to another provider by changing one file. A closed API would have locked me in.
- Others can contribute. The repo is open for Hacktoberfest, so anyone can add new languages or features. __
Top comments (0)