Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

CodePanda Logo

CodePanda-AI 🐼

An AI Python Tutor that teaches by asking questions, not by giving answers.

Python Version Framework Model License


The Problem with AI Code Assistants

In the age of AI, getting a code snippet is easy. But learning is about the struggle, not the solution. Most AI coding tools provide instant answers, which can short-circuit a student's learning process and prevent them from developing critical debugging and problem-solving skills.

The Solution: A Socratic Tutor

CodePanda-AI takes a different approach. Instead of fixing code, it helps you learn to fix it yourself. It's a "Competence-Aware" AI tutor that first analyzes the type of error you're facing and then asks a single, tailored Socratic question designed to guide you to your own "aha!" moment.

It's a coding partner that helps you learn, not just a tool that gives you answers.


📽️ Image

Code1

✨ Core Features

  • Socratic Method: Never gives away the answer, only asks guiding questions.
  • Competence-Aware Logic: Provides different, specialized prompts based on whether the error is Syntax, Logical, or Conceptual.
  • Local-First & Private: Runs entirely on your local machine. Your code never leaves your computer.
  • Efficient & Accessible: Engineered to run a powerful 6.7B parameter model with a 4-5 second response time on consumer-grade hardware.
  • Simple UI: A clean and intuitive interface built with Streamlit.

🛠️ How It Was Built: From Raw Power to Refined Efficiency

This project was a journey in pragmatic AI engineering.

1. Prototyping with a Heavyweight Model (gpt-oss-20b) The initial proof-of-concept was built using the powerful, 20-billion-parameter gpt-oss-20b. This model was incredible at generating nuanced, high-quality Socratic questions, proving the core concept was highly effective. The problem? It was too slow and resource-intensive for anyone without a high-end GPU.

2. The Pivot to Prompt Engineering The core challenge became clear: could I distill the "intelligence" of the 20B model into a prompt so effective that a much smaller model could achieve the same results?

I iteratively rebuilt the system prompt from the ground up, incorporating:

  • Strict XML Tagging: To create an unambiguous structure the model had to follow.
  • Negative Constraints: Adding absolute rules like NEVER WRITE OR CORRECT CODE.
  • Few-Shot Examples: Providing a perfect example of the "user goal -> internal analysis -> final question" thought process I wanted the AI to mimic.

3. Success with an Efficient Model (DeepSeek Coder 6.7B) Finally, I applied this highly-engineered prompt to the DeepSeek Coder 6.7B Instruct model. The result was a breakthrough. The smaller model, guided by the intelligent prompt, produced outputs of the same high quality as the original 20B model but in a fraction of the time. The project successfully transitioned from a slow, academic curiosity to a fast, practical, and accessible tool.


⚙️ Getting Started

Prerequisites

  • Python 3.9+
  • A GGUF model file.

Installation

  1. Clone the repository:

    git clone https://github.com/Harshitmishra001/CodePandaAI.git
    cd CodePanda-AI
  2. Install dependencies:

    pip install -r requirements.txt
  3. Download the model:

    • Place your GGUF file in the root of the project directory.
  4. Run the application:

    streamlit run app.py

🔮 What's Next for CodePanda-AI

The "Competence-Aware" framework has exciting potential. The next evolution is to merge this Socratic logic with creative storytelling in a project I'm calling the "Live-Coding Dungeon Master."

Imagine an interactive text-based adventure game where a student plays as a character in a fantasy world. To cast spells, open enchanted doors, or overcome obstacles, they must solve Python challenges in real-time. 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. This would transform learning to code from a task into a truly engaging quest.


About

A fully functional web application that implements the "Competence-Aware" tutoring system proposed in the research plan. Instead of just a theoretical evaluation, this project serves as a working prototype that demonstrates the viability of using open-source LLMs for nuanced, pedagogical feedback in programming education.

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages