Version: 2.1.0 (Final Release) 🏁
CIT (Ci Interface Terminal) is a lightweight API gateway that sits between your Cimeika devices and the OpenAI API.
It exposes a minimal HTTP interface and forwards chat requests to OpenAI using Python's standard library.
The service is designed to run locally on Android through Termux and can be connected to other systems over a LAN.
🧬 Unified Architecture: CIT now serves as the core of a modular ecosystem that unifies 5 repositories (
cit,ciwiki,cimeika-unified,media,cit_versel) following the 111 density principle (1 core, 1 registry, 1 entry point). See Unification Documentation for details.
🆕 v2.1 Features: Autonomous OpenAI client, enhanced Job Manager, memory optimization (~80MB vs ~150MB), and complete API documentation. See Release Notes for details.
Note: For conceptual understanding of Ci and its underlying framework, see the Legend Ci documentation (canonical source: ciwiki/Legend ci). This README focuses on technical implementation.
- Autonomous OpenAI Client – Standalone
OpenAIClientclass for programmatic API access with intelligent routing - Job Management System – Create and track long-running tasks via
/v1/jobs/*endpoints - Memory Optimized – ~80MB memory usage (47% reduction from v2.0) through streaming multipart parsing
- Audit System – Comprehensive logging and monitoring of resources, API requests, and security (see Audit Documentation)
- Health check –
GET /healthreturns a simple JSON object to verify the service is running. - Web UI –
GET /ui(or/) provides a browser-based chat interface with Speech-to-Text (STT) and Text-to-Speech (TTS) support. - Chat proxy –
POST /chatforwards your chat messages to OpenAI and returns the response. - Intelligent API routing – uses OpenAI's Responses API with automatic fallback to Chat Completions API.
- File operations – Upload, download, and manage files via
/files,/file,/uploadendpoints - Configuration – Runtime configuration via
/configendpoint - Audit –
GET /auditandGET /audit/resourcesprovide comprehensive system auditing (see Audit Documentation)
- No external dependencies – implemented with Python's built‑in modules, so it works out of the box in Termux.
- Simple deployment – start the server with a single script or integrate it into Termux Boot for auto‑start.
Follow these three steps to install and run CIT on your Android device using Termux:
-
Install Termux packages
pkg update -y && pkg upgrade -y pkg install -y git python termux-services -
Clone the repository
git clone https://github.com/Ihorog/cit.git ~/cit cd ~/cit
-
Run the server
# Export your OpenAI API key (required) export OPENAI_API_KEY="your-api-key-here" # Optional: Export your HuggingFace token for ML model access export HUGGINGFACE_API_TOKEN="your-token-here" # Start the server on port 8790 python server/cit_server.py
The service will listen on all interfaces (port 8790 by default).
You can add the start command to scripts/termux_boot/cit_start.sh and enable Termux Boot to run CIT automatically after a reboot.
Access the Web UI at http://127.0.0.1:8790/ui in your browser to use the chat interface with voice capabilities.
CIT now includes a modular engine that unifies multiple repositories into a single system. Use the engine CLI for advanced operations:
# Validate all modules and their dependencies
python core/engine.py build# Start the HTTP server (alternative to python ci.py)
python core/engine.py run# Run a specific module
python core/engine.py module <module-id>
# Show system status
python core/engine.py statusFor detailed information about the modular architecture, see Unification Documentation.
Open your browser and navigate to:
http://127.0.0.1:8790/ui
The Web UI provides:
- Text input with "Send" button
- 🎙️ STT button for voice input (Ukrainian language)
- 🔊 TTS button to hear the assistant's response
- Real-time health status indicator
- Dark theme optimized for mobile
Check that CIT is running:
curl http://127.0.0.1:8790/health
# → {"ok": true, "model": "gpt-4o-mini", "ts": "2026-01-01T22:04:59.584648+00:00"}Send a chat message to OpenAI via CIT:
curl -X POST http://127.0.0.1:8790/chat \
-H "Content-Type: application/json" \
-d '{"message": "Hello, world!"}'
# Example response:
# {
# "reply": "Hello! How can I assist you today?",
# "api": "chat.completions",
# "raw": {
# "id": "chatcmpl-abc123",
# "object": "chat.completion",
# "created": 1735756800,
# "model": "gpt-4.1-mini",
# "choices": [
# {
# "index": 0,
# "message": {
# "role": "assistant",
# "content": "Hello! How can I assist you today?"
# },
# "finish_reason": "stop"
# }
# ]
# }
# }Or open the Web UI in your browser:
# Open http://127.0.0.1:8790/ui in your browser
# Features:
# - Interactive chat interface
# - 🎙️ Speech-to-Text (STT) for voice input
# - 🔊 Text-to-Speech (TTS) to hear responses
# - Dark theme optimized for mobileRun a lightweight repo verification (syntax + /health probe) without external dependencies:
./scripts/repo_check.shThe script starts a temporary server on port 8979 by default. Set OPENAI_API_KEY if you want to include the /chat smoke test.
cit/
├── README.md # this file
├── .gitignore # common ignores (.env, Python cache)
├── docs/
│ └── ARCHITECTURE.md # high‑level architecture description
├── server/
│ └── cit_server.py # main HTTP server implementation
└── scripts/
├── termux_bootstrap.sh # optional helper to set up Termux environment
└── termux_boot/cit_start.sh # script run by Termux Boot
Note: Operational scripts have been organized into
scripts/ops/and vault/sync scripts intoscripts/vault/. See README files in those directories for details.
In addition to the embedded UI served by the CIT server, there's a modern Next.js PWA interface called Cimeika in the /web directory.
Features:
- 🎨 Beautiful dark theme optimized for mobile
- 💬 Full-featured chat interface with AI
- 🎙️ Speech-to-Text (Ukrainian)
- 🔊 Text-to-Speech (Ukrainian)
- 📱 PWA support (install as app)
- 🎯 Menu system with multiple sections
- 📊 Real-time health monitoring
Quick start:
# Start CIT server (required)
export OPENAI_API_KEY="your-api-key-here"
python server/cit_server.py
# In another terminal, start web app
cd web
npm install
npm run dev
# Open http://localhost:3000See web/README_WEB.md for detailed documentation, deployment guides, and PWA setup.
Веб-інтерфейс автоматично розгортається на Vercel при кожному push до main гілки.
- Налаштуйте Vercel токени — див. docs/VERCEL_SETUP.md
- Push код — деплой відбудеться автоматично
- Створіть PR — отримаєте preview URL для тестування
# Перевірити що збірка працює
./scripts/test-vercel-deploy.sh
# Деплой вручну (потрібен Vercel CLI)
npm install -g vercel
vercel --prodДетальна документація: docs/VERCEL_SETUP.md
GitHub Copilot development follows the canonical instructions defined in the ciwiki repository.
Key principles:
- Anti-repeat: eliminate repeated actions
- Single execution path through PR → verification → approval
- Documentation first
See .github/copilot-instructions.md for the full instructions synchronized from ciwiki.
For significant features or architectural changes, CIT uses a structured proposal process:
- Create Proposal - Use the implementation proposal template
- Review - Submit PR for team review and feedback
- Implement - Build according to the approved proposal
- Verify - Test against acceptance criteria
- Document - Update CHANGELOG and documentation
Quick start:
# Create a new proposal
cp docs/IMPLEMENTATION_PROPOSAL_TEMPLATE.md docs/proposals/IMPL-$(date +%Y-%m-%d)-my-feature.md
# Edit the proposal and submit for review
git checkout -b proposal/my-feature
git add docs/proposals/IMPL-*-my-feature.md
git commit -m "Proposal: Add my feature"
git push origin proposal/my-featureResources:
- Implementation Proposal Template - Template for new proposals
- Proposal Guide - Step-by-step guide with examples
- Active Proposals - Current proposals under review
See docs/PROPOSAL_GUIDE.md for detailed instructions.
This project is released under the MIT License. See LICENSE for details.