---
title: "FitaLabs Infra — Complete Stack"
description: "Documentation: FitaLabs Infra — Complete Stack"
type: reference
tags: [infra, gateway, docker, mcp, relay-ai, fitalabs]
timestamp: 2026-06-30
---

# FitaLabs Infra — Complete Stack

**Location**: `~/Claude/fitalabs/infra/` (git versioned)
**Compose**: 8+ Docker containers
**Gateway**: FastAPI in Python, Anthropic Messages API compatible

## Services

| Container | Function | Port |
|-----------|----------|------|
| Caddy | HTTPS reverse proxy + Let's Encrypt | 80, 8443 |
| CPM | Caddy Proxy Manager (Web UI) | 8501 |
| Technitium DNS | Local split-DNS | 5380, 53530/udp |
| LiteLLM Gateway | Core — multi-provider proxy | 4000 |
| SearXNG | Meta-search engine | 8888 |
| Crawl4AI | Web crawler | 11235 |
| Open WebUI | Chat interface | 3000 |
| Uptime Kuma | Health monitoring | 3001 |
| Open Terminal | Embedded terminal | 8000 |

## LiteLLM Gateway — Architecture

### Router (`router.py`)
- Detects **tier** (haiku/sonnet/opus) from model name
- Detects **effort** (low/medium/high) via `thinking.budget_tokens`
- Detects **multimodality** (image/audio/video/pdf) → route to MiMo omni
- **Routing table**: (Tier, Effort) → Backend
- Backends: MiMo v2.5, MiMo v2.5 Pro, DeepSeek V4 Flash, DeepSeek V4 Pro

### Handlers
| Endpoint | Handler | Function |
|----------|---------|----------|
| `POST /v1/messages` | messages.py | Anthropic Messages API |
| `POST /v1/messages/count_tokens` | (inline) | Token counting |
| `POST /v1/chat/completions` | chat.py | OpenAI Chat Completions |
| `POST /v1/audio/speech` | audio.py | TTS |
| `POST /v1/audio/transcriptions` | audio.py | STT |
| `POST /mcp` | mcp.py | MCP JSON-RPC (tools/list, tools/call) |
| `WS /v1/voice` | voice.py | Voice mode WebSocket |
| `GET /search` | search.py | SearXNG-compatible |
| `POST /load` | loader.py | URL loader |
| `GET /health` | admin.py | Health check |

### Services
- `forwarding.py` — Forward to backends with protocol translation
- `tool_executor.py` — Tool execution
- `web_fetch.py` — Fetch via Crawl4AI
- `fallback.py` — Fallback chain

### MCP Endpoint
Currently only exposes `web_fetch` via Crawl4AI. Foundation for extension with notes, whiteboard, etc. tools.

## relay-ai — External Reference

CLI for launching Claude Code, Claude Desktop, Codex, Gemini CLI with provider registry.
**GitHub**: https://github.com/jacob-bd/relay-ai
**Stars**: 84 | **Commits**: 53

### Capabilities relay-ai has (that we don't)
1. Dynamic provider registry (`~/.relay-ai/providers.json` + OS Keychain)
2. Model favorites + `/model` switching mid-session (20 favorites)
3. Multi-launcher: `relay-ai claude-app`, `codex-app`, `gemini`
4. Server wizard: provider filtering, model id masking, local vs network
5. Environment isolation: strips 17 conflicting env vars
6. Vertex AI gateway: `--vertex` with gcloud ADC
7. NDJSON/JSONL streaming for headless agents

### Capabilities we have (that relay-ai doesn't)
1. Tool injection + filtering
2. Web search via SearXNG
3. Voice mode WebSocket
4. MCP with web_fetch (Crawl4AI)
5. Anthropic to OpenAI translation
6. Multimodal routing
7. CPM, Technitium DNS, Uptime Kuma
8. Crawl4AI with proxy

## Gap Analysis — What's Missing

### Priority 1 (For Kaggle + daily operations)
- Dynamic provider registry (reference: relay-ai)
- Model favorites + `/model` switching
- Environment isolation in gateway
- Notes MCP server (extract selection, inline comments)

### Priority 2 (For PCR Protocol)
- Multi-launcher for Claude Desktop, Claude Code, Codex
- Dynamic dispatch between instances
- Slack integration (MCP server for Slack)
- Whiteboard MCP App

### Priority 3 (For ground zero)
- Harness reconstruction via leaked source
- Bare metal inference (PS3 Cell BE)
- Apple Container Machine bridge

## Connections

- [[mcp-ecosystem]] — MCP Apps, protocol, specs
- [[fitalabs-gateway-modelos]] — Gateway details (if dedicated page exists)
- [[claude-desktop-bundles]] — Harness where MCP servers run
- [[pcr-protocol]] — Harness reconstruction via local models
