Skip to content

Latest commit

 

History

6 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

██████╗██╗  ██╗ █████╗  ██████╗ ███████╗     █████╗ ██╗
██╔════╝██║  ██║██╔══██╗██╔═══██╗██╔════╝    ██╔══██╗██║
██║     ███████║███████║██║   ██║███████╗    ███████║██║
██║     ██╔══██║██╔══██║██║   ██║╚════██║    ██╔══██║██║
╚██████╗██║  ██║██║  ██║╚██████╔╝███████║    ██║  ██║██║
 ╚═════╝╚═╝  ╚═╝╚═╝  ╚═╝ ╚═════╝ ╚══════╝    ╚═╝  ╚═╝╚═╝
                    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.

Chaos AI Studio Dashboard

Chaos AI Studio Settings


✨ Features

  • 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 on and --lowvram).
  • 4 Themes — Neon Dark · Nord · Gruvbox · Tokyo Night
  • Model Hub — Browse and one-click download models from Hugging Face
  • Process Hygieneatexit hooks strictly manage and clean up all spawned llama.cpp and ComfyUI orphaned 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

🤖 Managed Services

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

⚡ Quick Start

Prerequisites

# Arch Linux
sudo pacman -S git python cmake vulkan-tools

# Ubuntu / Debian
sudo apt install git python3 python3-venv cmake vulkan-tools

Install & Run

git clone https://github.com/YOUR_USERNAME/Chaos-AI-Studio.git
cd Chaos-AI-Studio
chmod +x setup.sh
./setup.sh

The setup script will:

  1. Create a Python virtual environment and install dependencies
  2. Create ~/models/{llm,audio,image,video}-models/ directories
  3. Clone and compile llama.cpp with Vulkan GPU acceleration and the GGML_MAX_NAME=128 patch (required for modern GGUF models)
  4. Create a default config.json

Then launch the dashboard:

source venv/bin/activate
python app.py

Open http://localhost:5000 in your browser.


📁 Project Structure

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

🛠 Configuration

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
    }
}

🚀 Architectural Optimizations (VRAM)

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-server is 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 --lowvram flag. 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. atexit hooks guarantee that no orphaned AI processes are ever left lingering in the background consuming idle memory.

🎮 GPU Support

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.


📦 Adding Models

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.


🐛 Known Issues

  • 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). The setup.sh applies this automatically
  • Intel Arc VRAM reporting requires kernel support for /sys/class/drm/card0/device/mem_info_vram_*

📄 License

MIT — see LICENSE


Built with 🔥 for local-first AI

Releases

Packages

Contributors

Languages