π A private, offline AI coding assistant that runs the official llama.cpp engine and opens in your browser
Built for lab exams, coding competitions, and any room where the network is off limits
π₯ Download Latest Release β’ π Website β’ π Model Guide
The desktop GUI is gone. CodaiPro now runs the official llama-server engine from llama.cpp with a fast browser chat UI β streaming answers token by token, markdown rendering, code copy buttons, a stop button, and a controller that watches the engine and restarts it if it crashes. One folder, one script, no Python GUI toolkits, no heavyweight dependencies.
- 100% Offline β inference happens on your CPU; nothing leaves the machine
- Real llama.cpp engine β
llama-serverwith streaming, not a Python wrapper - Browser UI β ChatGPT-style chat with markdown and code blocks, opened automatically
- Self-healing β engine health monitor, auto-restart, stale lock recovery, crash reports
- Hardware-aware β RAM/CPU tiers tune context size and threads automatically
- Portable β one folder on a USB stick;
run.batdoes everything
1. Download the portable zip from releases and unzip to a writable folder
2. Drop ONE .gguf model into the models/ folder (default: gemma-3-1b-it-Q4_K_M.gguf)
3. Double-click run.bat
4. Wait for [READY] - your browser opens http://127.0.0.1:8081/
5. Press any key in the launcher window to stop Codai safely
The release zip includes Codai.exe and the official engine\llama-server.exe β the only thing you add is a model.
git clone https://github.com/Luckyyaduvanshiofficial/Codaipro.git
cd Codai
pip install -r requirements.txt # just psutil
# Windows
run.bat
# Linux / macOS
python dev/controller.pyFrom source you also need the engine binary in engine/:
- Windows:
winget install llama.cpp, then copyllama-server.exeintoengine\β or grabllama-bXXXX-bin-win-cpu-x64.zipfrom llama.cpp releases - Linux: download
llama-bXXXX-bin-ubuntu-x64.tar.gzfrom llama.cpp releases and putllama-server(+ the.sofiles) intoengine/ - macOS: use the llama.cpp release binaries or
brew install llama.cpp, then symlinkllama-serverintoengine/
CodaiPro runs a local GGUF model. Drop one .gguf file into the models/ folder. The default expected by config.json is Gemma 3 1B β using a different file? Set "model_name" in config.json (or run DOWNLOAD_MODEL.bat).
Weak lab PC? Take a tiny one β under 1 GB, runs on almost anything:
| Model | Size | Direct download (Q4_K_M) |
|---|---|---|
| Gemma 3 1B Instruct (default) | 0.81GB | Download Β· Model page |
| Qwen3.5-0.8B (newest) | 0.58GB | Download Β· Model page |
| Qwen3-0.6B | 0.48GB | Download Β· Model page |
| Llama 3.2 1B Instruct | 0.81GB | Download Β· Model page |
The Qwen 3 family thinks before it answers; the engine keeps the scratchpad out of your way.
When 2 GB is fine β a better coder:
| Model | Size | Best For | Source |
|---|---|---|---|
| Phi-3.5-mini β | 2.3GB | Best speed/quality balance | microsoft/Phi-3.5-mini-instruct-gguf |
| Qwen2.5-Coder-3B | 2GB | Fast coding on low-spec machines | Qwen/Qwen2.5-Coder-3B-Instruct-GGUF |
| Qwen2.5-Coder-7B | 4.7GB | Most powerful (q4_k_m) | Qwen/Qwen2.5-Coder-7B-Instruct-GGUF |
- Pick the q4 / q4_k_m quantization for the best CPU performance.
- If a model downloads as split parts, keep all parts together in
models/. - Chat templates are applied by the engine from the model metadata β every model above just works.
CodaiPro/
βββ dev/
β βββ config.py # config, constants, paths, env overrides
β βββ controller.py # orchestrator: lifecycle, logging, shutdown
β βββ engine.py # llama-server process + health monitor + restart
β βββ proxy.py # serves the UI, forwards API, streaming, telemetry
β βββ system.py # hardware analysis (RAM/CPU tiers)
βββ engine/ # llama-server binary (downloaded, not in git)
βββ models/ # your .gguf model (not in git)
βββ ui/ # browser chat UI (index.html, app.js, styles.css)
βββ config.json # port, model name, debug
βββ run.bat # Windows launcher
βββ kill.bat # force-clean processes and locks
- Controller starts the proxy, boots the engine, tracks lifecycle phases, performs graceful shutdown
- Proxy serves
ui/and forwards/v1/chat/completionsto the engine with request IDs, queue control, and SSE streaming - Engine manager validates the binary, waits for readiness, monitors health every 5s, auto-restarts up to 3 times
- Ports: UI
8081, engine8082(fromconfig.jsonorCODAI_PORT)
{
"port": 8081,
"model_name": "gemma-3-1b-it-Q4_K_M.gguf",
"ctx": 2048,
"threads": 4,
"host": "127.0.0.1",
"debug": false,
"log_level": "INFO"
}Environment overrides: CODAI_PORT, CODAI_MODEL, CODAI_CTX, CODAI_THREADS, CODAI_HOST, CODAI_DEBUG, CODAI_LOG_LEVEL. Priority: environment > config.json > hardware-derived defaults.
Logs land in logs/codai.log, logs/engine.log, logs/crash.log. Debug mode ("debug": true) also exposes /logs and the /telemetry page.
- OS: Windows 10/11 (64-bit) for the packaged release; Linux/macOS from source
- RAM: 4GB minimum, 8GB recommended
- Storage: ~1GB for the app + 0.5β5GB for one model
- Runtime: Python 3.10+ with
psutil(source mode only), llama.cppllama-serverengine - UI: your browser β no GUI toolkit, no Electron, no internet
- Streaming chat over SSE with stop support
- Engine health monitor with staged auto-restart (0s / 2s / 5s backoff)
- Hardware-aware tuning β context and threads scale to the machine
- Single instance β PID lock with stale-lock recovery
- Rotating logs + crash reports in
logs/
See CONTRIBUTING.md and the developer deep-dive in docs/contributor-project-info.md. Bug reports and model-compatibility reports are very welcome via issues.
Full-Stack Developer & DevOps Enthusiast
"Building tools that make coding accessible to everyone, everywhere."
As a student, I experienced firsthand the frustration of lab environments without internet access. During crucial exams and projects, when you need coding assistance the most, traditional AI tools are unavailable. CodaiPro solves this by bringing powerful AI assistance directly to your machine β no internet required.
Licensed under the MIT License β see the LICENSE file.
- llama.cpp team β for the incredible
llama-serverengine - bartowski & model publishers β for the quantized GGUF models
- Open Source Community β for inspiration and support
- π Bug Reports: GitHub Issues
- π¬ Discussions: GitHub Discussions
- π Portfolio: luckyyaduvanshiofficial.github.io