Agents / README.md
Skydata001's picture
Update README.md
a9c9c26 verified
|
Raw
History Blame Contribute Delete
3.7 kB
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