Categories
self-hosted api-gateway ai-gateway llm-routing guardrails openai-compatible load-balancingStars
Forks
Watchers
Developer links
Portkey Gateway
One OpenAI-compatible endpoint, 1,600+ models behind it: Portkey Gateway sits between your app and every major LLM provider, deciding in real time where each request should go. When a provider times out or returns errors, automatic retries with exponential backoff kick in, and fallback rules quietly move traffic to your second-choice model before users notice anything. Load balancing spreads calls across multiple API keys and providers by weight, conditional routing sends each request down a different path based on its content or metadata, and per-request timeouts cut off providers that hang. Guardrails inspect inputs and outputs as traffic passes through: block banned words, screen for sensitive content, and enforce the checks your compliance team asked for, with dozens of pre-built rules ready to attach. Text is only the start: the same API shape reaches vision models, speech-to-text, text-to-speech, image generation, and realtime websocket APIs, so multimodal features stop multiplying your integration work. Routing policies live in JSON configs you attach per request or per client, which means experiments, cost controls, and provider migrations ship as configuration changes, not redeploys. Running on a dedicated VPS on RepoCloud with guaranteed CPU, RAM, and SSD, full root SSH access, and a browser serial console. MIT licensed.
Benefits
- Outages become invisible blips
- Automatic retries with exponential backoff and provider fallbacks reroute failed requests in flight, so a single provider's bad afternoon stops surfacing as your application's error page.
- Every provider, one API shape
- An OpenAI-compatible interface fronts more than 1,600 models across providers, so switching or adding a model is a config edit instead of a new SDK integration.
- Guardrails on every request
- Input and output guardrails screen traffic as it passes through the gateway, blocking banned content and enforcing policy checks without scattering validation code through your application.
- Multimodal without extra integrations
- Vision, speech-to-text, text-to-speech, image generation, and realtime APIs all flow through the same gateway, so new modalities reuse your existing routing, keys, and policies.
Features
- Retries and provider fallbacks
- Failed requests retry automatically with exponential backoff, then fall back to alternate providers or models on the error codes you specify in config.
- Weighted load balancing
- Distribute traffic across multiple API keys or providers using weights, with conditional routing rules that steer requests by content, metadata, or user segment.
- Pre-built guardrail checks
- Attach from dozens of ready-made input and output guardrails, or bring your own, to block banned content and enforce accuracy and compliance policies.
- OpenAI-compatible unified API
- One familiar API signature reaches chat, vision, audio, image, and realtime models from every major provider, keeping client code unchanged when providers change.
- JSON config routing
- Retries, fallbacks, timeouts, and guardrails are declared in JSON configs attached per request or client, so routing policy ships without application redeploys.