CodeWise is a Flask-based web application that allows you to ingest, index, and chat with your code repositories using large language models (LLMs) such as GPT-OSS (via Hugging Face or Ollama). It provides a modern UI for exploring code, saving chat history, and leveraging retrieval-augmented generation (RAG) for code understanding.
- Repository Ingestion: Add public or private GitHub repositories for analysis.
- Code Indexing: Automatically chunk, embed, and index code for semantic search.
- Chat with Code: Ask questions about your codebase and get context-aware answers from an LLM.
- Saved Chats: Save and organize chat responses as markdown files for future reference.
- Modern UI: File explorer, chat interface, and saved chat management.
- Supports Multiple LLM Backends: Use Hugging Face API or run models locally with Ollama.
- Python 3.12 or newer
- Git (for repo ingestion)
- Ollama (optional, for local LLM inference)
Install Python dependencies:
pip install -r requirements.txtCreate a .env file in the project root for sensitive configuration:
HF_API_KEY=your_huggingface_api_key_here
HF_API_KEYis required if you use Hugging Face's hosted LLMs. in this version though you can hard code the key in rag_repo.py- For Ollama, no API key is needed.
python app.pyThe app will be available at http://localhost:5000.
- Enter a GitHub repository URL in the UI, or add path to the private repo.
- (Optional) Provide a GitHub Personal Access Token for private repos.
- Click "Ingest" to process and index the repository.
- Select the ingested repository from the dashboard.
- Use the chat interface to ask questions about the codebase.
- The LLM will answer using context from the indexed code.
- Save any AI response as a markdown file.
- View, search, and reuse saved chats from the sidebar.
Beauty of NaviGit is that it let's the user go totally offline, does not even need a browser to interact with it, Most of larger codespaces have a shared server that can be only accessed with cli, so NaviGit is inbuilt with its own CLI support without the need of even turning on the flask App
- Terminal will prompt you to enter the github repo url, and PAT only needed for private repos, you may select your local path too
- After successful ingestion move on to next step
- This will start building the indexes if not already built
- Once built you can directly chat with GPT OSS for your queries related to the codebase!
- Ensure
HF_API_KEYis set in your.env. for this version you can hardcode it directly intot rag_repo.py, search for langchain, hard code it inside that function - The app will use Hugging Face's GPT-OSS endpoint.
- Install and run Ollama.
- Pull a model, e.g.:
ollama pull gpt-oss
- In
rag_repo.py, comment out the Hugging Faceask_llmfunction and uncomment the Ollama version:def ask_llm(prompt: str): client = OpenAI( base_url="http://localhost:11434/v1", api_key="ollama", # Any string, not used by Ollama ) completion = client.chat.completions.create( model="llama3", # Or your preferred model messages=[{"role": "user", "content": prompt}], ) return completion.choices[0].message.content
- Restart the Flask app.
- WebSocket Disconnects: In development, the chat may disconnect on code changes. This is normal due to Flask's auto-reload. Run on gunicorn rather than Werkzeug
- Indexing Errors: Ensure the repository URL is correct and accessible. For private repos, use a valid GitHub token. Timeouts may occur if your Network speed is a bottleneck
- LLM Errors: Check your API key, model name, and backend availability.
- Torch Errors During installing sentence transformers, you may run into pyTorch errors, you can fix them by just installing the appropriate torch versions!
noodl/
├── app.py
├── rag_repo.py
├── requirements.txt
├── .env
├── static/
│ └── index.css
├── templates/
│ ├── index.html
│ └── workspace.html
├── indexes/
│ └── <repo>/
│ ├── repo.index
│ ├── chunks.json
│ ├── graph.pkl
│ └── saved_chats/
└── ...
This project is Open Sourced, feel free to contribute, expand and fork this project into something amazing. Review the licenses of any LLMs or datasets you use with this tool.