CodAI documentation

Install, configure, and operate CodAI — the portable, privacy-focused offline AI coding assistant for students, university lab exams, restricted networks, and software developers. v3.0.0 · 100% offline.

Overview & Why CodAI?

CodAI v3.0 is a free, fully offline AI coding assistant designed specifically for computer science students, educational computer laboratories, exam centers, and security-restricted development environments.

100% Offline AI Execution

All neural network inference occurs strictly on your local CPU. Zero internet connection or mobile hotspot required.

Plug & Play USB Portability

Run directly from any flash drive. No administrator privileges, installer wizards, or registry alterations needed.

Strict Air-Gapped Privacy

Zero telemetry, zero cloud logging, and zero data harvesting. Your exam code and intellectual property never leave the machine.

Low-Spec Machine Optimized

Operates efficiently on 2GB–4GB RAM systems. Smooth performance on older lab computers without dedicated GPUs.

Feature / RequirementCodAI v3.0Cloud AI (ChatGPT / Copilot)
Internet ConnectivityNone Required (100% Offline)Mandatory Constant Connection
Admin Rights for InstallationNot Required (Portable USB)Requires Admin / Browser Sync
Lab & Exam FriendlyPermitted in Air-Gapped LabsBlocked by Firewalls / Rules
Code Privacy & IP ProtectionZero Telemetry (100% Private)Logged on External Cloud Servers
Pricing / Subscription100% Free & Open Source (GPL-3.0)$10 – $20 / month recurring

System Requirements & Prerequisites

CodAI was built with lightweight quantized runtime configurations, allowing it to perform with low latency on typical university student laptops and institution desktops.

Minimum Requirements (Entry Hardware)

  • Operating System:Windows 10 (64-bit), macOS 12+, or Linux 5.10+
  • RAM / Memory:2GB minimum (4GB recommended)
  • Processor (CPU):Dual-Core 2.0GHz Intel / AMD (AVX2 supported)
  • Disk Space:2GB free storage space for runtime & model weights
  • GPU:None required (executes purely on CPU)

Recommended Requirements (Optimal Speed)

  • Operating System:Windows 11 (64-bit), macOS Sequoia / Sonoma, Ubuntu 24.04
  • RAM / Memory:8GB or higher
  • Processor (CPU):Quad-Core 2.5GHz+ or Apple Silicon (M1/M2/M3/M4)
  • Disk Space:4GB+ SSD storage for instant warm boot
  • GPU Acceleration:Optional Vulkan, CUDA, or Apple Metal API

Installation & Setup Options

Choose the method that best matches your workflow: a single-click portable executable for student lab environments, or source-code setup for developers.

Recommended for Students

Option 1: Portable Executable (No Admin Rights Needed)

The portable bundle packages the Codai.exe controller, the official llama-server engine, run.bat/kill.bat helpers, and your weights into a ready-to-run folder.

  1. Download the latest release zip: CodaiPro-v3.0.0-Portable-Windows.zip
  2. Extract the contents to your USB flash drive or desktop directory.
  3. Double-click Codai.exe to launch immediately.
Tip for Exams: Keep the extracted directory on a USB flash drive. Plug it into any exam PC and run directly without installing software.

Option 2: Developer Python Setup (Source Code)

Ideal for developers who want to customize prompts, inspect the controller, or modify the engine configuration.

# 1. Clone repository from GitHub
git clone https://github.com/Luckyyaduvanshiofficial/Codaipro.git
cd Codai

# 2. Create and activate a virtual environment
python -m venv venv
venv\Scripts\activate # On Windows
source venv/bin/activate # On Linux/macOS

# 3. Install core dependencies
pip install -r requirements.txt

# 4. Launch the application
python launcher.py

Option 3: Building from Source with PyInstaller

Generate your own standalone distributable package using the automated build script.

# On Windows (from the repository root)
follow the build scripts in the repository (see README.md)

Build output: Codai.exe, bundled with the engine into one portable folder

Student & Lab Exam Workflow

College and university computer labs frequently enforce air-gapped policies, disable public web browsing, and restrict user accounts from running installers. Here is how CodAI addresses every restriction.

Step 1

Prepare USB at Home

Download and extract CodAI onto an NTFS or FAT32 USB flash drive. Test-run it once on your personal PC to ensure models and cache are primed.

Step 2

Plug Into Lab Workstation

Insert your USB stick into the lab PC. Open file explorer, locate the Codai folder, and run run.bat.

Step 3

Code with Zero Internet

Use AI generation, instant bug diagnosis, and code explanations. When finished, simply close the window—no artifacts or registry entries remain on the lab PC.

Information for University IT & Lab Administrators

CodAI was built with student privacy and institution compliance at its core:

  • No outbound network traffic: Firewall logs remain completely clean.
  • Single instance mutex: Prevents multiple competing processes from overloading student PCs.
  • Non-intrusive: No administrative privileges required; clean unlinking on process termination.

Core AI Capabilities & How to Use

CodAI provides four foundational AI coding workflows designed to speed up learning and software development:

1. AI Code Generation

Type natural language prompts to produce production-grade functions, algorithmic solutions, or boilerplate structures.

Prompt example: "Write a Python function to perform binary search on a sorted array with recursion, including docstrings and unit tests."

Supported across 20+ languages: Python, JavaScript, TypeScript, C / C++, Java, Go, Rust, PHP, SQL, HTML / CSS, Kotlin, Swift, C#, Shell / Bash.

2. Step-by-Step Code Explanation

Paste complex, unfamiliar, or poorly documented code. CodAI deconstructs the logic line-by-line, explaining algorithmic complexity, data structures, and invariants.

Prompt example: "Explain how this Dijkstra algorithm implementation handles cyclic weighted graphs and what the time complexity is."

3. Instant Debug & Bug Detection

Encountering a segmentation fault, recursion depth error, or null pointer exception? Paste your code along with the terminal traceback error message.

Prompt example: "Fix this IndexError: list index out of range occurring in my nested matrix traversal loop."

4. Code Optimization & Refactoring

Transform quadratic $O(N^2)$ brute-force solutions into linearithmic $O(N \log N)$ or linear $O(N)$ implementations, reduce memory allocations, and enhance idiomatic readability.

Prompt example: "Refactor this string matching loop using the KMP (Knuth-Morris-Pratt) pattern to avoid repeated character scans."

Configuration & Keyboard Shortcuts

Fine-tune CodAI's inference parameters from the built-in Settings Panel:

Temperature Control

Adjust creativity vs. deterministic precision. Use 0.1 – 0.2 for syntax debugging and math; use 0.6 – 0.8 for prototyping creative algorithms.

Max Token Length

Choose between concise code snippets (512 tokens) and extensive full-project classes or multi-file solutions (up to 2048+ tokens).

Theme Toggle

Toggle between Dark Mode and Light Mode with high-contrast accessibility presets for low-light lab settings.

Crash Recovery & Autosave

Session state is automatically buffered to local disk so you never lose prompt history or generated code snippets if a machine restarts.

Productivity Keyboard Shortcuts

Key CombinationAction / Description
Ctrl + EnterGenerate code / Send prompt to local AI assistant
Ctrl + LClear chat transcript and reset context buffer
Ctrl + KFocus cursor onto prompt input textarea
Ctrl + SSave session state and export current code snippets
Ctrl + Shift + CCopy current selected code block to clipboard
EscCancel active token generation or close settings panel

System Architecture & 4-Layer Stability

Under the hood, CodAI v3.0 separates the browser chat UI, the controller, and the inference engine into clean, decoupled layers with automated process protection:

Layer 1

Chat UI (browser)

A modern, GPU-friendly Python GUI that provides a responsive desktop user interface with syntax highlighting, streaming token animations, and zero web browser overhead.

Layer 2

Controller (Codai.exe)

The packaged controller health-monitors the engine, auto-restarts it after crashes, tunes settings to your RAM/CPU tier, and writes rotating logs.

Layer 3

Inference Engine (Llama.cpp / Quantized GGUF)

C++ accelerated offline model execution using 4-bit integer quantization (Q4_K_M). Delivers fast tokens-per-second on standard CPU cores using AVX2 vector SIMD instructions.

Layer 4

4-Layer Single Instance & Cleanup Protection

Combines Windows Named Mutex, Socket Port Locking, PID verification, and OS signal traps to guarantee that multiple instances never conflict and no zombie processes linger on shutdown.

Troubleshooting & Solutions

Encountering an issue on a lab computer or developer machine? Use these field-tested solutions:

Issue: Multiple instances open or the engine won't start

If a previous session crashed abnormally, a background engine process may still be running.

# Quick Solution (In the CodAI directory):
kill.bat

# Manual PowerShell / Command Prompt command:
taskkill /IM Codai.exe /F
taskkill /IM llama-server.exe /F

Issue: Low Memory (RAM) or Slow Token Generation

If running on an older 2GB or 4GB machine, ensure other memory-heavy programs are closed.

  • Close Google Chrome / heavy browser tabs before running generation.
  • Set Max Tokens to 512 in Settings to lower peak memory allocation.
  • Use Ctrl + L frequently to purge older conversation context.

Issue: Missing dependencies when running from Python source

Ensure you are in a clean virtual environment and run a force-reinstall:

pip install --force-reinstall -r requirements.txt

Frequently Asked Questions

How does CodAI work without an internet connection?

CodAI runs the official llama.cpp engine (llama-server) locally, with a browser chat UI and a controller that keeps the engine healthy. It loads quantized GGUF models directly into memory on your computer, eliminating the need for any cloud APIs or internet connection.

Can I use CodAI during university lab exams?

Yes! CodAI was specifically engineered for restricted educational environments. The portable version runs directly from a USB drive or desktop folder without administrative permissions and operates completely offline with zero network calls.

What are the minimum hardware requirements to run CodAI?

CodAI is optimized to run smoothly on machines with as little as 2GB to 4GB of RAM. An entry-level dual-core 2.0GHz CPU and 2GB of free disk space are all that is required—no dedicated GPU is needed.

Is my source code stored or transmitted to external servers?

Never. CodAI has zero telemetry and zero external network calls. Every prompt, code snippet, and generated suggestion remains strictly on your local machine.

What should I do if multiple windows open or the engine won’t start?

CodAI includes a pre-built kill.bat utility that resets background processes and locks. Simply run kill.bat, then start again with run.bat.

Open Source, Contributing & Community

CodAI is an open-source project released under the GPL-3.0 license. We warmly welcome student contributions, bug reports, feature requests, and university partnership suggestions.

How to Contribute

  1. Fork the repository: github.com/Luckyyaduvanshiofficial/Codaipro
  2. Create a feature branch: git checkout -b feature/amazing-feature
  3. Commit your improvements: git commit -m 'feat: add feature'
  4. Open a Pull Request with a clear summary of changes.

Ready to code offline?