Local Ollama stays local
Run Sage Router beside your local Ollama runtime and point Codex, OpenClaw, Cursor, Aider, Continue, OpenHands, or any OpenAI SDK client at one local base URL.
Ollama routing for agents
Keep local Ollama and Ollama Cloud in the same model layer as OpenAI, Anthropic, Gemini, NVIDIA NIM, private gateways, and hosted Sage Router keys. Agents keep one OpenAI-compatible endpoint while routing policy handles cost, capability, and reliability.
Run Sage Router beside your local Ollama runtime and point Codex, OpenClaw, Cursor, Aider, Continue, OpenHands, or any OpenAI SDK client at one local base URL.
Use Ollama Cloud models exposed through Ollama while keeping the same router policy, telemetry, and fallback chain used for provider APIs and private endpoints.
When a provider key or route hits a retryable rate limit, Sage Router can fail over to another eligible provider, another API key, or a local Ollama fallback.
export OLLAMA_HOST=http://127.0.0.1:11434
python3 router.py --port 8790
export OPENAI_BASE_URL=http://127.0.0.1:8790/v1
export OPENAI_API_KEY=local-router
curl "$OPENAI_BASE_URL/chat/completions" \
-H "Authorization: Bearer $OPENAI_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "sage-router/frontier",
"messages": [{"role": "user", "content": "Use local or cloud routes intelligently"}]
}'
Configure several OpenAI, Anthropic, Gemini, or compatible keys for one provider, then balance load and fail over when a single credential is rate-limited.
Image, audio, video, and document inputs route only to capable models. Learned served modalities are recorded per model to improve future routing decisions.
Use stable profiles such as sage-router/frontier or direct Ollama models while the router enforces health, capability, and fallback rules.
Direct Ollama works for one machine and one model family. Agents usually need more: local fallback plus hosted frontier models, provider health checks, 429 failover, multiple API-key load balancing, model capability gates, hosted key activation, and Tailnet or public-edge access. Sage Router keeps Ollama in that path instead of replacing it.
Create an API key, read the hosted/local quickstart, see the self-hosted path, or compare OpenRouter.