QA-Pilot is an interactive chat project designed to leverage online or local large language models (LLMs) to quickly understand and navigate GitHub code repositories or compressed file resources. It combines LLMs and vector embedding technology to enable question answering and exploration of code repositories.
Main Uses
- Converse with public GitHub repositories to quickly understand code structure and content.
- Upload local source code directories to index and ask questions without Git cloning.
- Support multiple LLM providers, including online APIs and local models.
Main Capabilities
- Chat and Navigation: Chat with public GitHub repositories via Git cloning, supporting multi-session management, chat history storage, and searching to locate sessions.
- Local Directory Upload: Click the New Source button, select a local folder to upload, and the files are uploaded to the QA-Pilot server and indexed without Git cloning. Supported file types include .py, .md, .js, .html, .css, .ts, .sh, .go, .java, .svelte (non-empty UTF-8 text). Dependency/cache directories such as .git, .venv, node_modules are skipped. Limits: up to 2000 source files, 10 MiB per file, 50 MiB total. Each upload creates an independent snapshot and session; local changes require re-uploading. Uploaded sources support chat and the existing Python/Go code graph.
- Code Graph Integration: Integrates code graph (codegraph) to view Python and Go files.
- Multi-Model Support: Supports multiple LLM models, including:
- ollama (deepseek, llama3.1, phi3, llama3, gemma2)
- openai (gpt-4o, gpt-4-turbo, gpt-4, gpt-3.5-turbo)
- mistralai (mistral-tiny, mistral-small-latest, mistral-medium-latest, mistral-large-latest, codestral-latest)
- localai (gpt-4, etc.)
- zhipuai (glm-4-0520, glm-4, glm-4-air, glm-4-airx, glm-4-flash)
- anthropic (claude-3-opus-20240229, claude-3-sonnet-20240229, claude-3-haiku-20240307, claude-3-5-sonnet-20240620)
- llamacpp
- nvidia (meta/llama3-70b-instruct, etc.)
- tongyi (qwen-turbo, qwen-plus, qwen-max, etc.)
- moonshot (moonshot-v1-8k, moonshot-v1-32k, moonshot-v1-128k)
- llmman (gemma4, qwen3.8, hf.co/unsloth/Qwen3.5-0.8B-GGUF, etc.)
- Configuration and Settings: Easy configuration setup, support for prompt template settings, improved sidebar settings list, support for llamacpp model upload.
- Search Functionality: Search using FlashRank, with support for the rr: option.
Usage
- Deployment Steps:
- Clone the QA-Pilot repository.
- Install conda for virtual environment management, create and activate a new virtual environment.
- Install the required dependencies.
- Install PyTorch with CUDA.
- Set up providers:
- Ollama: Refer to the official website and GitHub to manage local LLMs.
- llmman: A local model runner that provides the Ollama API on port 17434; if not the default http://localhost:17434,需在 Set llmman base_url in config/config.local.ini.
- LocalAI: Set localAI base_url in config/config.local.ini.
- llamacpp: Use llama-cpp-python, upload models to the llamacpp_models directory or upload from settings, and set models in the llamacpp_llm_models section of config/config.local.ini.
- Set API keys in .env:
- OpenAI: OPENAI_API_KEY='<openai_api_key>'
- MistralAI: MISTRAL_API_KEY='<mistralai_api_key>'
- ZhipuAI: ZHIPUAI_API_KEY='<zhipuai_api_key>'
- Anthropic: ANTHROPIC_API_KEY='<anthropic_api_key>'
- Nvidia: NVIDIA_API_KEY='<nvidia_api_key>'
- TongYi: DASHSCOPE_API_KEY='<tongyi_api_key>'
- Moonshot: MOONSHOT_API_KEY='<moonshot_api_key>'
- For the Go code graph, make sure the GO environment is set up, compile the Go files, and test.
- Copy config/config.ini to config/config.local.ini (ignored by Git), set the relevant parameters, such as model provider, model, variables, Ollama API URL, and set up the PostgreSQL environment.
- Download and install Node.js, and set up the frontend environment in one terminal.
- Run the backend QA-Pilot in another terminal.
- Usage Tips:
- Do not use the URL and upload features at the same time.
- The remove button cannot actually remove the local ChromaDB; when stopped,it must be removed manually.
- Switch to the New Source button to add a new project.
- Use rsd: to start typing and retrieve source documents.
- Use rr: to start typing and search using FlashrankRerank.
- Click Open Code Graph in QA-Pilot to view the code (make sure you are already in the project session and it is loaded); currently supports Python and Go.
Applicable Scenarios
- Quickly understand open-source code repositories on GitHub.
- Q&A and exploration of local codebases.
- Code analysis scenarios that require switching between multiple models.
Limitations and Notes
- This project is a test project to verify the feasibility of a fully localized Q&A solution. It is not production-ready and is not suitable for production environments.
- Do not use the model to analyze critical or production data.
- Do not use the model to analyze customer data to ensure data privacy and security.
- Do not use the model to analyze private/sensitive code repositories.
- Upload limits: up to 2000 source files, 10 MiB per file, 50 MiB total.
- The remove button cannot actually remove the local ChromaDB; it must be removed manually.
- Do not use the URL and upload features at the same time.
- Update runtime settings: refer to the deployment guide for the tested Python 3.13 / LangChain 1.x environment, pinned dependencies, Ollama settings, and systemd service. The old installation instructions describe the original environment, and it is no longer necessary to install all historical model SDKs.
Update History
- 2024-07-03: Updated langchain to version 0.2.6, added moonshot API support.
- 2024-06-30: Added Go code graph.
- 2024-06-27: Added nvidia/tongyi API support.
- 2024-06-19: Added llamacpp API support, improved the sidebar settings list, added llamacpp model upload functionality, added prompt template settings.
- 2024-06-15: Added anthropic API support, refactored some functionality, fixed chat display messages.
- 2024-06-12: Added zhipuai API support.
- 2024-06-10: Converted Flask to FastAPI, added localai API support.
- 2024-06-07: Added the rr: option to search using FlashRank.
- 2024-06-05: Upgraded langchain to v0.2, added ollama embeddings.
- 2024-05-26: Released v2.0.1: refactored, replaced the Streamlit frontend with Svelte to improve performance.