Skip to content
InfraSecIDPublic

About

Offline AI coding assistant. Ollama + DeepSeek + Docker sandbox. No API, no cloud, full control.

Resources

Contributing

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

Β 

History

14 Commits

Folders and files

NameName
Last commit message
Last commit date
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

CodeX β€” Offline AI Coding Assistant

CI GitHub release GitHub stars License

Local, offline AI coding assistant powered by Ollama + DeepSeek + Docker sandbox. No API keys, no cloud, full control on your own machine.

Hybrid mode (v1.2.0+): optionally add Google Antigravity for cloud models.

Yeah, it runs on your own PC. Your GPU is crying, but your privacy is smiling. 😎


✨ Features

  • 🧠 Runs fully offline β€” no internet after setup
  • πŸ’» Cross-platform β€” Windows, Linux, macOS, Termux (Android)
  • πŸ”„ Multi-model support β€” DeepSeek, Qwen, CodeLlama (v1.2.0+)
  • 🌐 Hybrid mode β€” add Antigravity cloud models (v1.2.0+)
  • πŸ›‘οΈ Docker sandbox β€” safe code testing
  • 🎭 Custom persona β€” CodeX, direct & no-nonsense
  • 🎨 CLI banner β€” figlet + lolcat (v1.2.0+)
  • πŸ“š Full docs β€” install guides, troubleshooting, FAQ
  • πŸ”Œ OpenAI-compatible β€” works with OpenCode, LM Studio, etc.

πŸ“‹ Requirements

Platform RAM Disk Notes
Windows 8 GB+ 5 GB Use setup.ps1
Linux 8 GB+ 5 GB Use setup.sh
macOS 8 GB+ 5 GB Use setup.sh
Termux 6 GB+ 3 GB Small models only, no Docker

Model sizes

Model Size RAM needed Best for
deepseek-coder:6.7b 4 GB 8 GB+ Best quality
qwen2.5-coder:1.5b 1 GB 4 GB+ Low-RAM devices
codellama:7b 4 GB 8 GB+ Alternative

⚠️ deepseek-coder:6.7b needs ~4 GB disk and 8 GB RAM minimum. For low-end devices, use qwen2.5-coder:1.5b. Your toaster will thank you.


πŸš€ Quick Start

πŸͺŸ Windows

winget install Ollama.Ollama
ollama pull deepseek-coder:6.7b
git clone https://github.com/InfraSecID/CodeX.git
cd CodeX
Set-ExecutionPolicy -Scope Process Bypass
.\setup.ps1
ollama run codex

Docker sandbox:

docker build -t sandbox .
docker run -it --rm --network none -v ${PWD}:/work sandbox

🐧 Linux / 🍎 macOS

curl -fsSL https://ollama.com/install.sh | sh
ollama pull deepseek-coder:6.7b
git clone https://github.com/InfraSecID/CodeX.git
cd CodeX
chmod +x setup.sh
./setup.sh
ollama run codex

Docker sandbox:

docker build -t sandbox .
docker run -it --rm --network none -v $(pwd):/work sandbox

πŸ“± Termux (Android)

⚠️ Termux cannot run Docker natively. Use the Ollama Termux fork with a small model.

pkg update && pkg upgrade -y
pkg install nodejs-lts -y
npm install -g @mmmbuto/ollama-termux@latest
ollama-termux serve &
ollama-termux pull qwen2.5-coder:1.5b
ollama-termux run qwen2.5-coder:1.5b

Note: For Termux, use small models (1.3b–1.5b). Docker sandbox is not available β€” test code on a PC instead.


πŸ”„ Multi-Model Support (v1.2.0+)

CodeX now supports multiple models. Switch anytime:

./switch-model.sh qwen-1.5b

Benchmark models

./benchmark.sh

Add new model

  1. Create models/your-model.Modelfile
  2. Run ./switch-model.sh your-model
  3. Update OpenCode config with codex-your-model

🌐 Hybrid Mode β€” Antigravity Cloud (v1.2.0+)

Add Google Antigravity as cloud provider (optional, needs internet + Google account):

./setup-antigravity.sh
opencode auth login

Then in OpenCode:

  • /model β†’ pick ollama/codex (local, offline)
  • /model β†’ pick antigravity/gemini-3-pro (cloud, online)

Local vs Cloud

Provider Models Connection Use when
Ollama codex, deepseek, qwen Offline πŸ”’ Privacy, no internet
Antigravity gemini, claude Online 🌐 Complex tasks, bigger models

⚠️ Antigravity is unofficial plugin (opencode-antigravity-auth). Use only in trusted workspaces.


🎨 CLI Banner (v1.2.0+)

Run CodeX with a figlet banner:

./codex-cli.sh

Output:

  ____          _  __  __
 / ___|___   __| | \ \/ /
| |   / _ \ / _` |  \  /
| |__| (_) | (_| |  /  \
 \____\___/ \__,_| /_/\_\

  πŸ€– Offline AI Coding Assistant
  πŸ“‘ Model: codex
  πŸ›‘οΈ  Sandbox: docker run ...
  🌐 Hybrid: use Antigravity for cloud models

Install dependencies:

sudo apt install figlet lolcat

πŸ› οΈ Makefile Shortcuts

Command What it does
make setup Full setup (Ollama + model + persona + sandbox)
make run Chat with CodeX persona
make sandbox Start Docker sandbox (no internet)
make build-model Rebuild CodeX persona from Modelfile
make test Quick sanity test
make clean Remove build artifacts
make help Show all commands

Example:

make setup
make run

🐳 Docker Compose

Run Ollama as a container:

docker compose up -d

Run sandbox with compose:

docker compose --profile sandbox run sandbox

Stop everything:

docker compose down

πŸ€– CI/CD

Every push to main triggers:

  • ShellCheck lint
  • YAML validation
  • Makefile validation
  • Executable permission check

See .github/workflows/ci.yml for details.


πŸ”’ Pre-commit Hooks

Install once:

pip install pre-commit
pre-commit install

Every git commit auto-checks:

  • Large files
  • Private keys
  • Merge conflicts
  • YAML validity
  • Shell script lint

πŸ“š Documentation

Full guides available in docs/:

Guide Description
Install on Windows Windows setup guide
Install on Linux Linux setup guide
Install on Termux Android/Termux guide
Troubleshooting Common issues & fixes
FAQ Frequently asked questions

πŸ“ Repository Structure

codex/
β”œβ”€β”€ README.md
β”œβ”€β”€ LICENSE
β”œβ”€β”€ CHANGELOG.md
β”œβ”€β”€ CONTRIBUTING.md
β”œβ”€β”€ RELEASE_NOTES.md
β”œβ”€β”€ Makefile
β”œβ”€β”€ docker-compose.yml
β”œβ”€β”€ Dockerfile
β”œβ”€β”€ Modelfile
β”œβ”€β”€ setup.sh
β”œβ”€β”€ setup.ps1
β”œβ”€β”€ setup-antigravity.sh
β”œβ”€β”€ switch-model.sh
β”œβ”€β”€ benchmark.sh
β”œβ”€β”€ codex-cli.sh
β”œβ”€β”€ split.py
β”œβ”€β”€ models/
β”‚   β”œβ”€β”€ deepseek-6.7b.Modelfile
β”‚   β”œβ”€β”€ qwen-1.5b.Modelfile
β”‚   └── codellama-7b.Modelfile
β”œβ”€β”€ docs/
β”‚   β”œβ”€β”€ install-windows.md
β”‚   β”œβ”€β”€ install-linux.md
β”‚   β”œβ”€β”€ install-termux.md
β”‚   β”œβ”€β”€ troubleshooting.md
β”‚   └── FAQ.md
└── .github/
    └── workflows/
        └── ci.yml

πŸ› Troubleshooting

Problem Fix
ollama: command not found Reinstall, restart terminal
Model very slow RAM too low β€” use ./switch-model.sh qwen-1.5b
OpenCode not connecting Check curl http://localhost:11434/v1/models
Docker permission denied (Linux) sudo usermod -aG docker $USER, then re-login
Docker can't mount folder (Windows) Enable drive sharing in Docker Desktop settings
Termux: model too heavy Use qwen2.5-coder:1.5b or smaller
switch-model.sh permission denied chmod +x switch-model.sh benchmark.sh codex-cli.sh setup-antigravity.sh
figlet: command not found sudo apt install figlet (Linux) or brew install figlet (macOS)
Model not found ollama pull deepseek-coder:6.7b
Out of memory Use smaller model, close other apps, increase swap
make help fails Makefile uses tabs, not spaces
CI fails on ShellCheck Add severity: 'error' to action config
YAML invalid python3 -c "import yaml; yaml.safe_load(open('docker-compose.yml'))"
setup.sh not executable chmod +x setup.sh split.py
Docker image not built docker build -t sandbox .
Antigravity auth fails opencode auth login again, check Google account
Antigravity not showing in /model Restart OpenCode after setup-antigravity.sh

For more, see docs/troubleshooting.md.


πŸ”— Links


⚠️ Disclaimer

This project is for educational and research purposes. Always test untrusted code inside the Docker sandbox. Antigravity plugin is unofficial β€” use at your own risk. The author is not responsible for misuse. Don't be that guy. Seriously.


πŸ“„ License

MIT β€” see LICENSE for details.


Version: 1.2.0 Last updated: 2026-10-21 Made with: β˜• + 🧠 + a GPU that's probably crying right now Special thanks: to everyone who reads documentation. You're the real MVP. πŸ†

About

Offline AI coding assistant. Ollama + DeepSeek + Docker sandbox. No API, no cloud, full control.

Resources

Contributing

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages