Repository navigation
Local Ollama Docker
Guide for running OmniRoute in Docker while Ollama runs natively on the host — the setup used with VS Code OmniCopilot and other OpenAI-compatible clients.
VS Code / OmniCopilot
↓ :20128
OmniRoute (Docker)
↓ host.docker.internal:11434
Ollama (native, GPU)
↓
your model (e.g. qwen35b-highctx:latest)
-
Install and start Ollama on the host (
ollama serve, bound to0.0.0.0:11434if remote clients need access). -
Start OmniRoute with the local Ollama compose overlay:
docker compose -f docker-compose.ollama-local.yml up -d
-
In the OmniRoute dashboard, add an OpenAI-compatible provider:
-
Base URL:
http://host.docker.internal:11434/v1 -
Prefix:
ollama(optional, forollama/model-namerouting)
-
Base URL:
-
Point your client at OmniRoute:
-
VS Code OmniCopilot:
omnicopilot.baseUrl→http://<host-ip>:20128 -
Model:
ollama/<model-name>
-
VS Code OmniCopilot:
docker exec omniroute getent hosts host.docker.internal
# → 172.17.0.1 host.docker.internal
docker exec omniroute node -e \
"fetch('http://host.docker.internal:11434/api/tags').then(r=>r.json()).then(j=>console.log(j.models.length,'models')).catch(console.error)"This 504 originates in OmniRoute, not OmniCopilot. The direct (no-proxy) fetch path uses resolveDirectHeadersTimeoutMs() in open-sse/utils/directResponseStartTimeout.ts. When OMNIROUTE_DIRECT_HEADERS_TIMEOUT_MS is unset, the default per-attempt budget is 30 seconds. OmniRoute retries once on a fresh socket, so failures often appear at ~60 seconds total.
Large local models (22B+ MoE) and VS Code Copilot agent requests (big system prompt + tools) can exceed 30s time-to-first-byte, especially on cold start.
Simple curl tests with small prompts may succeed while Copilot fails.
OmniRoute now auto-raises the direct response-start floor to 300s for local/self-hosted targets (host.docker.internal, 192.168.x.x, localhost, etc.).
For older images or explicit control, set in docker-compose.ollama-local.yml:
environment:
- OMNIROUTE_DIRECT_HEADERS_TIMEOUT_MS=300000
- OMNIROUTE_LOCAL_DIRECT_HEADERS_TIMEOUT_MS=300000
- STREAM_IDLE_TIMEOUT_MS=600000
- RATE_LIMIT_EXECUTION_MAX_WAIT_MS=300000
- RATE_LIMIT_MAX_WAIT_MS=300000
- OMNIROUTE_DIRECT_DISPATCHER_CONNECTIONS=32Heavy agent sessions can also hit RATE_LIMIT_EXECUTION_TIMEOUT when concurrent requests queue behind a long SSE stream. Increase RATE_LIMIT_EXECUTION_MAX_WAIT_MS and RATE_LIMIT_MAX_WAIT_MS as shown above.
- DOCKER_GUIDE.md — full compose profiles
- OmniCopilot — VS Code extension (no request timeout settings; errors come from OmniRoute)
OmniRoute · Website · npm · Docker Hub
- Setup Guide
- User Guide
- Features
- Quick Start (Docker)
- Electron Desktop App
- Termux (Android)
- PWA Guide
- MCP Server
- A2A Server
- Agent Protocols
- OpenCode Plugin
- Webhooks
- Cloud Agents
- Skills
- Memory
- Evals
- Gamification
- Guardrails
- Compliance
- Error Sanitization
- Public Credentials
- Route Guard Tiers
- Stealth Guide
- CLI Token Auth