Spaces:
Paused
Paused
metadata
title: Agents
emoji: π»
colorFrom: green
colorTo: yellow
sdk: docker
pinned: false
license: mit
short_description: Local Agents Program
π°οΈ NEXUS AI β Elite AI Chat Platform
A state-of-the-art, self-hosted AI chat platform for Hugging Face Spaces running on an NVIDIA A100 instance. Local ultra-fast inference via vLLM, a FastAPI orchestrator, a glassmorphic web UI, a three-tier AI engine, a secure sandbox terminal, live GPU/CPU telemetry, and an AI-powered self-healing log analyzer.
β¨ Feature Map
| Area | Description |
|---|---|
| β‘ Flash mode | Direct low-latency token streaming from the local model |
| π§ Max mode | Deep reasoning pipeline: planning β web research β reasoning β self-reflection β final answer, with visible <thinking> steps |
| π€ Agents mode | A swarm of specialized agents (PM, Coder, Debugger, Security, Researcher, Database, UI/UX) collaborating through a routing loop |
| ποΈ Turso DB | users, chats, messages, memories, system_logs, sandbox_projects, auth_audit |
| π‘οΈ Security shield | Master-token auth (HF secret ADMIN_API_KEY) + IP capture + HTML5 GPS audit + JWT sessions; every page is locked |
| π usage.html | Live CPU / RAM (142 GB) / GPU engine / VRAM / token-rate dashboard over WebSocket + Chart.js |
| π©Ί logs.html | AI diagnostic agent that analyzes the rolling log buffer and can apply patches to repair files |
| π» console.html | Web-based bash emulator (xterm.js) jailed to the sandbox folder, with pip install support |
| π¨ UI | Deep dark #0B0F19 palette, backdrop-blur glass panels, neon-cyan glow, fully responsive |
π Required Space Secrets
| Secret | Purpose |
|---|---|
ADMIN_API_KEY |
Master token that unlocks the platform lockscreen |
TURSO_DATABASE_URL |
e.g. libsql://your-db.turso.io (optional β falls back to a local embedded database) |
TURSO_AUTH_TOKEN |
Turso auth token |
HF_TOKEN |
Only if you serve a gated model (e.g. Llama-3-70B-Instruct) |
βοΈ Optional environment variables
| Variable | Default | Description |
|---|---|---|
MODEL_NAME |
deepseek-ai/DeepSeek-Coder-V2-Lite-Instruct |
Any vLLM-compatible model |
MAX_MODEL_LEN |
32768 |
Context window served by vLLM |
GPU_MEMORY_UTILIZATION |
0.90 |
Fraction of VRAM vLLM may use |
MOCK_MODE |
auto |
1 forces the built-in simulation engine (no GPU needed) |
JWT_SECRET |
derived | Session-signing secret |
SAFE_LAT / SAFE_LON / SAFE_RADIUS_KM |
unset | Optional geo-fence for logins |
STRICT_GEO |
0 |
1 rejects logins outside the geo-fence |
EXTRA_VLLM_ARGS |
empty | Extra flags passed to vllm serve |
π Local development (CPU only)
pip install -r requirements.txt
MOCK_MODE=1 ADMIN_API_KEY=dev-key uvicorn main:app --port 7860
# open http://127.0.0.1:7860 β enter "dev-key" on the lockscreen
π Layout
βββ Dockerfile # CUDA PyTorch base, A100 tuning, vLLM bootstrap
βββ entrypoint.sh # starts vLLM (background) + uvicorn
βββ requirements.txt
βββ main.py # FastAPI orchestrator (engines, auth, DB, WS)
βββ static/
βββ index.html # main chat UI
βββ lockscreen.html # glassmorphic multi-factor lockscreen
βββ usage.html # live resource dashboard
βββ logs.html # AI log analyzer / self-healing console
βββ console.html # web terminal emulator
βββ style.css # design system
βββ app.js # chat application logic