Repository navigation
Home
Hi, and thanks for stopping by.
CodeWise is a small AI assistant that helps you understand a codebase by talking to it. You give it a project, whether that's a folder on your laptop, a zip file, or a GitHub repository, and then ask questions in plain English:
"How does the upload flow work?" "Who calls
process_pdf_pipeline?" "What would break if I changedstore.py?"
It answers using your actual code, and it shows you which files and line numbers the answer came from, so you can check it yourself instead of trusting it blindly.
The part I care about most: everything runs on your own machine. The AI model runs locally through Ollama, the search index lives on your disk, and your code never leaves your computer. No API keys, no subscription, and nothing uploaded to anyone's cloud.
Anyone who has joined a new project knows the feeling. There are hundreds of files, and you don't know where anything starts or how the pieces connect. The usual answer is to read everything or keep asking a teammate.
AI coding tools help, but most of them send your code to a remote server. That's a non-starter for a lot of company code, client work, or anything you'd rather keep private.
So the question behind CodeWise was simple: how good can a code assistant be if it has to run entirely on a laptop? It turns out that with careful retrieval (finding the right pieces of code before asking the model anything), a small local model can give genuinely useful, grounded answers.
Bring in a whole project
- Upload single files, a whole folder (drag and drop works), or a
.zip - Import a public GitHub repo just by pasting its URL
- Junk is skipped automatically:
node_modules,venv,.git, lockfiles, minified bundles, and anything your.gitignoreexcludes
Ask questions and get grounded answers
- Answers stream in word by word, and a Stop button ends them early
- Every answer lists its sources: file, line range, and the function or class
- Follow-up questions work ("how does it handle errors?")
- If the answer isn't in your code, it's designed to say so instead of making something up
Understand how code connects
- CodeWise maps which functions call which, and which files import which
- So "who calls X?" or "what depends on this file?" is answered from the real structure of your code, not just from text that looks similar
Get a whole-project overview
- Generate AI Code Audit reviews the architecture, patterns, code quality and security concerns across the project
Here's what happens when you ask a question:
-
Your code gets cut into sensible pieces. Not arbitrary 1000-character slices, but whole functions and classes, so no answer is built from half a function.
-
Each piece gets a "meaning fingerprint" (an embedding) and is stored in a local database (ChromaDB). CodeWise also builds a map of calls and imports.
-
When you ask something, it searches in three ways at once:
- by meaning (finds code that does what you described, even with different words),
- by keywords (finds exact names like
parse_config), - and through the call/import map (finds where a function is used).
The results are combined into one ranked list.
-
The best pieces are handed to the model, with real line numbers, trimmed to fit what the model can read at once.
-
The model (Qwen2.5-Coder, running in Ollama) writes the answer, and it streams back to you.
The model only ever sees your code and your question. The quality of the answer depends heavily on step 3: if search finds the right code, even a small model does well.
You'll need Python 3.11+, Node.js, and Ollama.
# 1. Get the models (one time)
ollama pull qwen2.5-coder:7b
ollama pull nomic-embed-text
# 2. Start the backend
cd CodeWise
python -m venv venv && source venv/bin/activate
pip install -r requirements.txt
python backend.py # runs on http://127.0.0.1:8000
# 3. Start the frontend (in a second terminal)
cd frontend
npm install
npm run dev # open http://localhost:5173Then click Create Project, upload some code, and start asking.
💡 On a Mac? The backend uses port 8000 because macOS reserves port 5000 for AirPlay Receiver.
-
Name things when you can. "Who calls
save_user?" works much better than "who uses the saving thing?". Putting names inbacktickshelps CodeWise spot them. -
Mention file names. "Explain
auth.py" points the search straight at the right place. - Ask one thing at a time. Two focused questions beat one big compound question.
- Check the source chips. They show where each answer came from. If they point to the wrong files, rephrase the question with more specific names.
- Be patient on the first question. The model needs a few seconds to load into memory.
I'd rather you know these up front:
- It's slower than cloud tools. On a MacBook with an M4 chip and 16 GB of RAM, an answer takes roughly 20–40 seconds; words start appearing after about 10. That's the cost of running a 7-billion-parameter model locally.
- A small model is still a small model. It's great at explaining and locating code, but weaker at deep reasoning across many files, and it occasionally gets a file path slightly wrong. Always check the sources.
-
The call map matches by name. If two different classes both have a
save()method, "who callssave?" will show callers of both. Dynamic calls (callbacks, reflection) aren't detected. - It's a snapshot. If you edit your code, upload the changed files again.
- No user accounts yet. It's built for running on your own machine, not for putting on the public internet.
| Version | What changed |
|---|---|
| 1.0 | The first working version: upload files, ask questions, get answers with sources |
| 2.0 | Rebuilt the search: smarter chunking, code-aware embeddings, hybrid search, follow-up questions, correct line numbers, project data that survives restarts, and a test suite |
| 3.0 | Folder, zip and GitHub import, streaming answers, the call/import map, and tools for measuring answer quality |
Full details are in the Releases.
Ideas I'd like to explore:
- Optional cloud model: keep local as the default, but let people plug in a faster hosted model when privacy isn't a concern
- Faster answers: shorter default answers, smarter reuse of work between questions
- Keeping in sync with your code: re-index only the files that changed
- A VS Code extension: ask questions without leaving the editor
- A bigger, real-world test set: built from questions people actually ask, to measure progress honestly
Does my code get sent anywhere? No. The model, the search index and the project data all stay on your machine. The only network request is when you ask it to import a GitHub repo.
Which languages does it support? Python, JavaScript/TypeScript, Java, Kotlin, C/C++, C#, Go, Rust, PHP, Ruby, Swift, SQL, plus Markdown, JSON, YAML, HTML and CSS. The call/import map is most accurate for Python, then JavaScript/TypeScript.
Can I use a different model?
Yes. Set CODEWISE_CHAT_MODEL to any chat model you've pulled in Ollama. Bigger models give better answers but need more memory and are slower.
My old project gives a "409" error. It was indexed with an older embedding model. Create a new project and upload the code again.
Why is port 5000 not used? On macOS, AirPlay Receiver already uses it, so the backend runs on 8000.
CodeWise is built by Sanskar Shekhar, a computer science engineer interested in AI, machine learning and full-stack development.
If you try it and something breaks, or you have an idea, please open an issue. I'd genuinely love to hear how you use it. ⭐ If it helped you, a star on the repo means a lot.