Self-hosted AI gateway & runtime LLM switcher for Ollama, OpenAI, and Anthropic.
174

One API. Any LLM. No Restart.
SLIR is a self-hosted AI gateway, runtime model switcher, latency X-ray profiler, and observability dashboard bundled in a single container.
Point your app once to http://localhost:4101/v1 with model: "active-model", switch between local models (Ollama, LM Studio, vLLM) and cloud APIs (OpenAI, Anthropic, Groq, DeepSeek) from the browser without restarting your code, and inspect latency breakdown, token costs, and failover attempt logs.
latest — Latest stable unified containerv1.0.0 — Release v1.0.0docker run -d --name slir \
-p 4100:4101 -p 4101:4101 \
--add-host=host.docker.internal:host-gateway \
-e OLLAMA_URL=http://host.docker.internal:11434 \
-v slir_data:/app/data \
varad177/slir-app:latest
http://localhost:4100http://localhost:4101/v1 (OpenAI) or http://localhost:4101/v1/messages (Anthropic)services:
app:
image: varad177/slir-app:latest
container_name: ai_monitor_app
restart: unless-stopped
ports:
- "4100:4101"
- "4101:4101"
extra_hosts:
- "host.docker.internal:host-gateway"
environment:
- OLLAMA_URL=http://host.docker.internal:11434
- DATABASE_PATH=/app/data/monitor.db
volumes:
- ai_monitor_sqlite_data:/app/data
volumes:
ai_monitor_sqlite_data:
model: "active-model" or pin models per app (mp_live_ keys). Changes apply immediately on the next request.POST /v1/chat/completions and native POST /v1/messages (x-api-key) with streaming SSE, tool calling, vision, cache_control, and json_schema.tok/s), with live num_ctx and temperature defaults.429, 5xx, timeouts, or network errors and record step-by-step error traces.429 budget blocks, and Slack/Discord webhooks.WAL): Runs offline with zero prompt retention—only anonymous telemetry is stored.| Endpoint | Purpose |
|---|---|
POST /v1/chat/completions | OpenAI Chat Completions gateway |
POST /v1/messages | Native Anthropic Messages API gateway |
GET /v1/models | Local Ollama + registered cloud models |
GET /api/health | Liveness check (?deep=1 checks Ollama) |
GET /api/metrics | Prometheus metrics endpoint |
| Variable | Default | Description |
|---|---|---|
PORT | 4101 | Internal listener for UI, API, and gateway |
OLLAMA_URL | http://host.docker.internal:11434 | Local Ollama endpoint(s) |
DATABASE_PATH | /app/data/monitor.db | SQLite WAL database path |
RETENTION_DAYS | 0 | Retention window in days (0 = keep forever) |
SLIR_PUBLIC_BASE_URL | (auto) | Fixed base URL behind reverse proxies |
Content type
Image
Digest
sha256:f38677abb…
Size
81.3 MB
Last updated
7 days ago
docker pull varad177/slir-app