Self-hosted AI infrastructure

Self-hosted AI model router with automatic provider failover

Run Sage Router on your own machine, server, Docker host, or Tailnet. Give agents one OpenAI-compatible endpoint that can route across local Ollama, cloud providers, private endpoints, and hosted Sage Router keys without moving provider custody by default.

Read quickstart Run locally Create hosted key Compare OpenRouter

No provider key or credit card required until your generated sk_sage key exists.

Local-first custody

Provider API keys, OAuth profiles, local models, and private gateway credentials can stay on the router host. Hosted generated keys authorize Sage Router account access, quotas, and analytics.

Agent-grade failover

Route by provider health, latency, policy, model capability, multimodal input requirements, and fallback order. Fail over on rate limits and provider outages without app-by-app rewiring.

Ollama and Tailnet

Use local Ollama and Ollama Cloud through your local runtime, then expose the router to trusted agents on port 8790 locally or across a private Tailnet.

30-second local start

python3 router.py --port 8790
export OPENAI_BASE_URL=http://localhost: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": "Route this well"}]
  }'

Self-hosted does not mean isolated

The local router can stay useful by itself, but hosted Sage Router can add account-managed generated keys, quotas, analytics, health monitoring, and reliability routing. Public plans sell routing infrastructure and control-plane convenience; they do not bundle provider resale.

Multiple API keys

Configure multiple keys for the same provider, balance load, and fail over when a key hits 429 or another retryable provider error.

Multimodal routing

Image, audio, video, and document signals are routed to capable models instead of text-only models. Learned modalities improve future routing decisions.

Public edge option

Use the hosted public edge when you need stable external access, while keeping private routers and provider credentials on trusted machines.

Next steps

Read the hosted/local quickstart, read the local-first routing guide, browse route families, or compare hosted plans.