Inspiration
In the age of AI, getting a code snippet is easy, but learning to problem-solve is hard. I noticed that most AI coding assistants provide instant answers, which can short-circuit a student's learning process. The real growth happens in the struggle of debugging and understanding why something is wrong.
My inspiration was to build an AI that acts less like a code-writer and more like a great teacher. I wanted to use a powerful open-source model to create a tool that applies the Socratic method, asking guiding questions to empower students to find the solution themselves and build a deeper, more lasting understanding of programming concepts.
What it does
CodePanda-AI is a "Competence-Aware" AI Python tutor, powered by the gpt-oss-20b model's deep understanding of code. Instead of fixing a user's code, it helps them learn to fix it themselves. The workflow is simple but powerful:
- A user pastes their buggy Python code into the application.
- They select the type of error they believe they have: Syntax, Logical, or Conceptual.
- CodePanda analyzes the code and leverages the nuanced reasoning of the large language model to generate a single, tailored Socratic question.
The question is carefully designed to point the student's attention to the root cause of their error without giving away the solution, encouraging critical thinking.
How we built it
This project was a journey in making the immense power of the gpt-oss-20b model practical and accessible.
Phase 1: Proving the Concept with gpt-oss-20b
The entire project was built around the capabilities of gpt-oss-20b. I chose this model for its 20-billion-parameter scale, knowing that the complex, pedagogical task of generating Socratic questions required a deep understanding of code logic and intent. The initial integration was a massive success: gpt-oss-20b was phenomenal at generating high-quality, insightful questions, proving that the core concept of an AI Socratic tutor was not only possible but highly effective.
Phase 2: Solving the Accessibility Challenge
This power, however, came at a cost. The model's size made it slow and resource-intensive, limiting its use to those with high-end hardware. The central technical challenge of the hackathon became: how can we make the pedagogical intelligence of gpt-oss-20b accessible to everyone?
Phase 3: Distilling Intelligence through Prompt Engineering
The solution was to treat the powerful outputs of gpt-oss-20b as a "gold standard." I meticulously studied its high-quality responses and reverse-engineered its reasoning patterns into a highly-structured and efficient system prompt. This "prompt-as-a-program," filled with strict rules, XML tags, and clear examples, effectively codified the intelligence of the larger model.
Phase 4: The Final, Optimized Product
This engineered prompt was then applied to a much smaller model, DeepSeek Coder 6.7B, as a lightweight execution engine. The result was a breakthrough: the smaller model, guided by the prompt distilled from gpt-oss-20b, produced outputs of the same high quality. We had successfully made the power of the 20B model accessible, creating a tool that is fast, private, and runs on any modern laptop.
Challenges we ran into
The primary challenge was the paradox of gpt-oss-20b: its greatest strength—its immense size and power—was also its greatest weakness in terms of accessibility. The core of our work was overcoming this hurdle without sacrificing the quality of the output.
Crafting a prompt that could successfully "download" the nuanced reasoning of gpt-oss-20b was a significant undertaking. It required dozens of iterations to perfect the balance of rules and examples that would constrain the AI to a Socratic, non-code-writing persona.
Accomplishments that we're proud of
I'm most proud of successfully validating a complex pedagogical concept using the powerful gpt-oss-20b model. This proved that open-source AI could be used for more than just code generation—it could be used for teaching.
Our biggest accomplishment, however, was solving the accessibility problem by "distilling" the core reasoning of gpt-oss-20b into a prompt. This engineering effort allows smaller, more efficient models to perform at a similar level, making the benefits of the large model available to a much wider audience.
What we learned
Working with a model as powerful as gpt-oss-20b taught us a crucial lesson: the raw capability of a large model can serve as a "gold standard" from which to engineer more efficient and accessible solutions. This project was a masterclass in prompt engineering, proving that a well-crafted prompt can be just as important as the model itself.
What's next for CodePanda-AI
The pedagogical engine we've built, validated with gpt-oss-20b, has exciting potential.
The most exciting next step is to merge this Socratic logic with creative storytelling in a project I'm calling the "Live-Coding Dungeon Master." I envision an interactive text-based adventure game where a student plays as a character in a fantasy world. To cast spells or overcome obstacles, they must solve Python challenges. CodePanda-AI would evolve into the Dungeon Master, generating the story, presenting the coding puzzles, and providing its signature Socratic hints when the player gets stuck, making learning to code a truly engaging quest.
Built With
- llama-cpp-python
- python
- streamlit

Log in or sign up for Devpost to join the conversation.