February 2026 · Home lab

Cognitive Silo: A Self-Hosted AI Stack on One GPU

A private AI stack for the AMD Radeon PRO W7900 in my workstation (48 GB, ROCm). One docker compose up starts local LLMs, speech-to-text and text-to-speech, image and video generation and per-project memory, all behind a single OpenAI-compatible gateway that falls back to GPT-4o when the GPU is busy.

  • Docker Compose
  • ROCm
  • Ollama
  • LiteLLM
  • ComfyUI
  • Mem0 + Qdrant
17Containers: 14 services, 3 one-shot setup jobs
8Models behind one gateway
48 GBVRAM, budgeted by hand
544 linesInteractive setup script

At a glance

GPU
AMD Radeon PRO W7900, 48 GB, through ROCm; Ollama and ComfyUI run on it, the speech and music services on the CPU
Gateway
LiteLLM on port 4000: one OpenAI-compatible API with keys, routing, two retries and a GPT-4o fallback through GitHub Models
Language
DeepSeek-R1 32B and 70B, DeepSeek-V2 16B and Llama 3.3 on Ollama, plus nomic-embed-text for embeddings
Speech
Whisper Large v3 Turbo and Kokoro through Speaches, Fish Speech, and XTTS-v2 voice cloning
Images, video, music
FLUX.1-schnell and CogVideoX-2b in ComfyUI; MusicGen Small behind a small REST API
Memory
Mem0 on Qdrant, with each project in its own namespace
Host
32 cores and 62 GB of RAM; reachable from my other machines over Tailscale

Architecture

Everything that speaks the OpenAI API goes through the gateway, so an editor plugin, a script or the chat UI uses the same endpoint and key, and never needs to know which model runs where.

Apps and editorsContinue.dev in VS Code, the OpenAI Python SDK, curl, Open WebUI
OpenAI-compatible API
LiteLLM gateway :4000Keys, routing, retries, fallbacks; usage in PostgreSQL, caching in Redis
Ollama :11434ROCm on the W7900: DeepSeek-R1 32B and 70B, DeepSeek-V2 16B, Llama 3.3, nomic-embed-text
Speaches :8000Whisper Large v3 Turbo for speech-to-text, Kokoro 82M for text-to-speech
GitHub ModelsGPT-4o, used only when a local model fails or is busy

Alongside the gateway

ComfyUI :8188FLUX.1-schnell images, CogVideoX-2b video
Mem0 :8080Project memory on Qdrant :6333
VoicesFish Speech :8001, XTTS-v2 :8002
MusicMusicGen API :8003 and playground :8004
An orange edge marks the two services that run on the GPU. Ports are as published by the compose file; a dashboard on port 9000 links every service and checks that each one answers.

Fitting it in 48 GB

The language models and video generation share one card, so the memory is budgeted rather than left to chance. Ollama keeps at most two models loaded and never unloads them on a timer (OLLAMA_MAX_LOADED_MODELS=2, OLLAMA_KEEP_ALIVE=-1), and an init container warms the two everyday models at startup.

The two models kept loaded take about 30 GB, which leaves about 18 GB for video generation in ComfyUI.
ModelUseVRAM
DeepSeek-R1 32BReasoning and code; kept loaded~20 GB
DeepSeek-V2 16BFast general use; kept loaded~10 GB
DeepSeek-R1 70BHeavy reasoning; needs the card to itself~42 GB
Llama 3.3General use and scripting~42 GB
nomic-embed-text768-dimension embeddings for memory~0.3 GB

Asking for a third model makes Ollama evict the least recently used one. If the GPU is saturated, the gateway sends the request to GPT-4o instead of making the caller wait.

Services

ServicePortImageRole
Open WebUI3000open-webuiChat UI with speech and image generation
LiteLLM4000berriai/litellmThe gateway
Ollama11434ollama:rocmLLM inference on the GPU
Speaches8000speaches (CPU)Whisper speech-to-text, Kokoro text-to-speech
Fish Speech8001fish-speechExpressive text-to-speech
XTTS-v28002xtts-streaming-server (CPU)Multilingual voice cloning
MusicGen API8003own buildText to music
MusicGen UI8004own buildGradio playground
ComfyUI8188own buildFLUX.1-schnell images, CogVideoX-2b video
Mem08080own buildMemory API: add, search, list
Qdrant6333qdrantVectors for Mem0
Dashboard9000nginxService portal with health checks
PostgreSQL–postgres:16Gateway keys and usage
Redis–redis:7Caching and rate limits

Making it repeatable

  • One script from a fresh clone. setup.sh checks the prerequisites, asks for the API keys and writes them to an untracked .env, skips models that are already downloaded, builds the containers, pulls the Ollama models and checks that everything answers.
  • Setup jobs, not manual steps. Three containers download model weights, pull the Ollama models and prepare Speaches on first start, then exit. Weights stay on disk, so later restarts are quick.
  • Start order from health. 13 of the 17 containers have health checks, and services wait for what they depend on to be healthy. Most images ship without curl, so the checks use bash /dev/tcp or Python's urllib.
  • Data where it belongs. Model weights live in a ./models folder; PostgreSQL, Qdrant, Redis and the UIs keep their data in named volumes that survive docker compose down.
  • Usable from anywhere. Other machines reach the gateway over Tailscale; the repository includes a Continue.dev configuration for VS Code and prompt templates for coding, debugging, hardware and UI work.

Files and links