DEV Community

Tripurala Spandana
Tripurala Spandana

Posted on

I Built My Friend a Local AI Coding Buddy

CodeBuddy: A Local AI Coding Companion I Built for a Friend 🤖

This is a submission for the Hacktoberfest Weekend Challenge: Build for a Friend.

What I Built

I built CodeBuddy, a small AI coding companion for a friend who is learning programming.

When you're learning to code, getting stuck is probably one of the most frustrating parts. Sometimes it's a syntax error, sometimes you understand the concept but don't know how to approach a problem, and sometimes you just need someone to explain it in a simpler way.

I wanted to build something that could help with those situations without making the learning process more complicated.

CodeBuddy currently has four main options:

  • Ask a Coding Question — ask about a programming concept and get an explanation.
  • Debug My Code — share code that isn't working and get help understanding the problem.
  • Give Me a Hint — get a small push in the right direction instead of immediately seeing the complete solution.
  • Practice Question — get programming questions to practice with.

The last one was important to me because I don't want an AI assistant to only give answers. If someone is learning, sometimes a hint or a practice problem is more useful than a complete solution.

I kept the application intentionally simple. My goal wasn't to build another huge coding platform. I wanted to build something my friend could open when they are stuck and immediately know how to use.

The AI behind CodeBuddy runs locally using Ollama with the Qwen2.5-Coder:3b model.

Demo

Here is the CodeBuddy demo:

In this demo, I show the main CodeBuddy features, including asking a coding question, debugging code, getting a hint, and generating a practice question.

The demo also shows that CodeBuddy is running locally on my computer using Ollama and Qwen2.5-Coder:3b.

Code

The complete project is available on GitHub:

CodeBuddy 🤖

A local AI coding practice assistant powered by open-source AI.

CodeBuddy is a beginner-friendly coding assistant built for learners who want help with programming questions, debugging, hints, and practice — while keeping their interactions local on their own computer.

It uses Ollama to run the open-source Qwen2.5-Coder model locally.


✨ Features

  • 💡 Ask a Coding Question — Get simple explanations of programming concepts.
  • 🐛 Debug My Code — Understand errors and find possible fixes.
  • 🧩 Give Me a Hint — Get guidance without immediately seeing the full solution.
  • 📝 Practice Question — Generate programming questions for practice.
  • 🔒 Local AI — Questions and code are processed locally through Ollama.
  • 🌐 Simple Web Interface — Clean and beginner-friendly UI.

🏗️ How It Works

User
  ↓
CodeBuddy Web Interface
  ↓
Python Local Server
  ↓
Ollama
  ↓
Qwen2.5-Coder
  ↓
AI Response
  ↓
CodeBuddy Interface

The application uses:

  • HTML for the interface
  • …

The project is intentionally small and has only a few main files:

CodeBuddy/
├── index.html
├── style.css
├── server.py
└── README.md
Enter fullscreen mode Exit fullscreen mode

I wanted to keep it simple enough that I could understand every part of it rather than depending on a large number of frameworks or services.

How I Built It

I started with the part I was most curious about: running a coding model locally.

I installed Ollama and downloaded Qwen2.5-Coder:3b. Before building the interface, I tested the model directly and tried a few programming questions to see how it responded.

Once I knew that part was working, I connected it to Python.

For the backend, I decided to keep things lightweight and use Python's built-in HTTP server functionality instead of adding another framework.

Then I worked on the browser side using HTML, CSS and JavaScript.

At first, I was mainly focused on getting the basic interaction working. I wanted to be able to type a question in the browser, send it to Python, have the local model process it, and display the answer back in the page.

After that was working, I spent more time on the interface and on making the different learning options easy to use.

The final setup uses:

  • HTML, CSS and JavaScript for the frontend
  • Python for the local server
  • Ollama for running the AI model
  • Qwen2.5-Coder:3b for coding-related responses

One thing I liked about this setup was that I didn't need to build a large backend just to make a small AI learning tool.

The application communicates with Ollama on the same computer, so after the model has been downloaded, the normal AI interaction can run locally.

Why Does Open Innovation Matter?

This is probably the part of the project that made me think the most.

I've used AI through online APIs before, so using a model locally was a different experience for me.

For CodeBuddy, I didn't really need a large cloud infrastructure. I wanted a coding assistant that could run on a personal computer and help with programming questions.

Running the model locally gives me more control over that setup.

For example, the user's coding questions don't have to be sent to a remote AI service just to get a response. That can be useful when someone is experimenting with their own code and wants to keep their work local.

There is also no separate API request cost for every question once the model has been installed.

Another thing I liked is the flexibility. Because I'm using Ollama, I can experiment with different compatible local models later without rebuilding the entire application around a particular hosted API.

There are trade-offs, of course.

Local AI needs the computer to have enough resources to run the model, and the initial model download requires an internet connection. A local model may also not perform the same way as a much larger cloud model.

But for CodeBuddy, I think the trade-off makes sense.

My friend doesn't need a huge AI system just to ask:

"Why isn't this Python code working?"

A local coding model is enough for what I wanted to build.

That's what open innovation made possible for this project: I could experiment with AI locally, choose how it fits into my application, and build a small tool without making a cloud AI API the center of the project.

My Agent Session

I did not use DevRelay for this project, so I am leaving this optional section out.

Prize Categories

I am not entering a partner-specific prize category for this project.

Building CodeBuddy also taught me something outside of the technical side.

When I started, it would have been easy to keep adding features just because they sounded interesting. But because I was building this for one person, I kept coming back to a much simpler question:

Would this actually help my friend when they are learning programming?

That helped me keep the project focused.

I also learned that I don't always need a complicated stack to build something useful. A small Python server, a simple frontend, Ollama, and a local coding model were enough to turn the idea into a working application.

CodeBuddy isn't meant to be the ultimate AI coding assistant.

It's just something I built for a friend who is learning.

And that's exactly what I liked about this challenge.

I started with a person, found a problem, and then chose the technology that could help solve it.

🤖 Built for a friend. Built to learn.

Top comments (0)