██████╗██╗ ██╗ █████╗ ██████╗ ███████╗ █████╗ ██╗
██╔════╝██║ ██║██╔══██╗██╔═══██╗██╔════╝ ██╔══██╗██║
██║ ███████║███████║██║ ██║███████╗ ███████║██║
██║ ██╔══██║██╔══██║██║ ██║╚════██║ ██╔══██║██║
╚██████╗██║ ██║██║ ██║╚██████╔╝███████║ ██║ ██║██║
╚═════╝╚═╝ ╚═╝╚═╝ ╚═╝ ╚═════╝ ╚══════╝ ╚═╝ ╚═╝╚═╝
S T U D I O
A self-hosted, GPU-accelerated AI management dashboard for running LLMs, image generation, video AI, music generation, and text-to-speech — entirely offline.
- Unified Dashboard — Start, stop, and monitor all your AI services from one place
- Real-time Telemetry — Live CPU, RAM, Swap, and GPU VRAM usage graphs
- Split-View Logs — Coloured ANSI log panel slides in from the right per-service
- VRAM Guard & Dynamic CPU Offloading — Prevents OOM crashes by dynamically reserving 5% of VRAM (leaving a 205MB margin) and perfectly balancing layer offloading between your GPU and CPU (
--fit onand--lowvram). - 4 Themes — Neon Dark · Nord · Gruvbox · Tokyo Night
- Model Hub — Browse and one-click download models from Hugging Face
- Process Hygiene —
atexithooks strictly manage and clean up all spawnedllama.cppandComfyUIorphaned processes on shutdown. - Force Stop — SIGKILL button for services that refuse to shut down gracefully
- Fully Local — No cloud, no telemetry, no internet required after setup
| Service | Technology | Port | What it does |
|---|---|---|---|
| Text AI (Llama) | llama.cpp | 8080 | OpenAI-compatible LLM API |
| Image AI (ComfyUI) | ComfyUI | 8188 | Stable Diffusion image gen |
| Video AI (Wan2.2) | ComfyUI + Wan | 8188 | Text/Image → Video |
| Audio AI (MusicGen) | Gradio | 7860 | AI music generation |
| TTS (VibeVoice) | llama.cpp GGUF | 8090 | Text-to-speech |
# Arch Linux
sudo pacman -S git python cmake vulkan-tools
# Ubuntu / Debian
sudo apt install git python3 python3-venv cmake vulkan-toolsgit clone https://github.com/YOUR_USERNAME/Chaos-AI-Studio.git
cd Chaos-AI-Studio
chmod +x setup.sh
./setup.shThe setup script will:
- Create a Python virtual environment and install dependencies
- Create
~/models/{llm,audio,image,video}-models/directories - Clone and compile
llama.cppwith Vulkan GPU acceleration and theGGML_MAX_NAME=128patch (required for modern GGUF models) - Create a default
config.json
Then launch the dashboard:
source venv/bin/activate
python app.pyOpen http://localhost:5000 in your browser.
Chaos-AI-Studio/
├── run.py # Thin entry point to launch the server
├── backend/ # Core python package (Flask + Logic)
│ ├── __init__.py # App factory & Blueprint registration
│ ├── config.py # Config loading/saving logic
│ ├── hardware.py # System telemetry & GPU/VRAM monitoring
│ ├── models_manager.py # Model discovery & HuggingFace catalogue
│ ├── process_manager.py # AI service start/stop, watchdog, atexit
│ ├── routes_ui.py # Flask Blueprint for HTML page rendering
│ └── routes_api.py # Flask Blueprint for REST API endpoints
├── setup.sh # One-command installer
├── requirements.txt # Python dependencies
├── config/
│ └── config.json # Runtime settings (gitignored)
├── docs/ # Additional documentation
├── logs/ # Log files
├── scripts/
│ ├── start_ai_stack.sh # Llama LLM server
│ ├── start_comfyui.sh # ComfyUI image generation
│ ├── start_musicgen.sh # MusicGen audio
│ └── start_text2speech.sh # VibeVoice TTS
├── templates/
│ ├── base.html # Layout, sidebar, log panel, themes
│ ├── dashboard.html # Service cards, telemetry
│ └── models.html # Model hub / download manager
└── static/
└── style.css # Theme system + all component styles
Settings are stored in config.json (auto-created on first run). You can also edit them per-service through the ⚙ gear icon on each service card.
{
"llama": {
"ctx_size": 4096,
"ngl": "auto",
"port": 8080,
"threads": 4,
"model": "Llama-3.2-3B-Instruct-Q4_K_M.gguf"
},
"text2speach": {
"ctx_size": 1024,
"ngl": "auto",
"port": 8090,
"threads": 4,
"model": "vibevoice-1.5b-q4_k_m.gguf"
},
"comfyui": {
"lowvram": true,
"normalvram": false
}
}Chaos AI Studio is engineered to run heavily demanding AI models on entry-level hardware (like the 4GB Intel Arc A370M) through strict memory partitioning:
- Dynamic Llama.cpp Splitting:
llama-serveris spawned using--fit on --fit-target 205. This enforces a strict 95% maximum VRAM fill rate, dynamically placing exactly the right number of layers onto your GPU while gracefully overflowing excess weight into System RAM without crashing. - PyTorch Low-VRAM Enforcement: Image and Video generation processes (ComfyUI) are unconditionally bound to PyTorch's
--lowvramflag. The massive diffusion models reside securely in CPU RAM and are pushed sequentially to the GPU tensor-by-tensor precisely at inference time. - Strict Process Hygiene: All backend bash scripts strictly adhere to PEP8 guidelines and clean up gracefully.
atexithooks guarantee that no orphaned AI processes are ever left lingering in the background consuming idle memory.
| GPU Family | Backend | Notes |
|---|---|---|
| Intel Arc (DG2+) | Vulkan (Mesa) | Tested on A370M 4GB |
| AMD Radeon (RDNA2+) | Vulkan (Mesa/AMDVLK) | |
| NVIDIA | Vulkan or CUDA | Use CUDA build for best perf |
| CPU only | AVX2 | Falls back automatically |
The setup.sh script automatically detects Vulkan and enables it at compile time.
Drop model files into the appropriate subdirectory under ~/models/:
~/models/
├── llm-models/ ← .gguf files for Llama, Qwen, Phi, etc.
├── audio-models/ ← .gguf files for TTS (VibeVoice)
├── image-models/ ← .safetensors for ComfyUI
└── video-models/ ← .gguf or .safetensors for Wan2.2
Or use the Model Hub tab in the dashboard to download directly.
- ComfyUI / Wan2.2 share the same process (ComfyUI backend) — the studio uses a sentinel file (
/tmp/wan_video_active) to tell them apart - VibeVoice GGUF requires the patched
llama.cpp(tensor name limit ≥128). Thesetup.shapplies this automatically - Intel Arc VRAM reporting requires kernel support for
/sys/class/drm/card0/device/mem_info_vram_*
MIT — see LICENSE

