A team can connect four model vendors and still have no reliable budget control, fallback policy, or data boundary.
Fastest answer: choose LiteLLM for a self-hosted general-purpose gateway, consider Switchyard for coding agents and open-model routing experiments, use OpenRouter when managed multi-provider access matters most, and evaluate Portkey when governance and observability must sit beside routing.
Who should read this:
- AI platform teams building one model entry point.
- Application developers reducing provider-specific integration code.
- Enterprise architects comparing self-hosted, managed, and hybrid LLM Gateway designs.
Last updated August 13, 2026. Feature and policy details were checked against the official project repositories and product documentation listed throughout this guide.
Start with the deployment model, not the feature list
The phrase “LLM proxy” hides two different products.
A self-hosted proxy runs inside infrastructure you control. LiteLLM and Switchyard fit this category most closely. You own the deployment, secrets, upgrades, monitoring, network path, and failure recovery.
A managed aggregation or gateway service removes much of that operational work. OpenRouter focuses on multi-provider model access and routing. Portkey combines gateway behavior with logs, guardrails, governance, and application observability.
That distinction changes the ranking.
A managed route may be faster to adopt, but your prompts still pass through another control plane. A self-hosted gateway gives you a stronger data boundary, but the proxy becomes another production system to secure and operate.
Three hidden costs appear repeatedly:
- Credential concentration. One proxy may hold keys for several providers. A leaked master credential can expose more models than a single application key.
- Routing opacity. A fallback can change provider, region, price, latency, or data policy without an application code change.
- Operational ownership. Retries, caching, rate limits, logs, and budgets only help if someone monitors them and tests their failure modes.
Warning: “OpenAI-compatible” does not mean “policy-compatible.” Confirm tool calling, structured output, streaming, image inputs, token accounting, and provider-specific parameters before switching a production workload.
Apply the first ranking: general-purpose self-hosted gateway
LiteLLM: the default choice for platform teams
LiteLLM is the strongest general-purpose choice when you want to operate the gateway yourself. Its official documentation describes a unified interface for more than 100 model providers, OpenAI-format translation, retries and fallbacks, spend tracking, project budgets, virtual keys, authentication, rate limiting, and observability callbacks. See the LiteLLM gateway documentation.
The important decision point is not the provider count. It is the control surface.
LiteLLM can give each project, service, or team a separate virtual key. That lets you attribute usage and apply budgets without distributing raw provider credentials to every application. The proxy also supports routing across multiple deployments, which is useful when one provider has a quota problem or a model endpoint becomes unavailable.
The trade-off is operational. A production LiteLLM deployment normally needs more than a process listening on a port. You should plan for:
- A durable database for configuration, keys, users, and usage records.
- A secret manager instead of plaintext environment files on shared hosts.
- A cache or coordination layer if your design needs distributed rate limits or shared state.
- Centralized logs and metrics.
- Health checks, backups, rollback procedures, and a second instance for availability.
LiteLLM is therefore the best default for a platform team, not necessarily for a solo developer who only needs to test two models for an afternoon.
Switchyard: narrower, sharper, and interesting for coding agents
Switchyard describes itself as a Python proxy for LLM traffic. Its repository documents protocol translation between OpenAI Chat, Anthropic Messages, and OpenAI Responses formats, multiple routing styles, request statistics, and launchers for coding tools such as Claude Code and Codex. It can point a coding agent at vLLM, NVIDIA NIM, Ollama, or another OpenAI-compatible endpoint while preserving the agent’s expected API style. See the Switchyard repository and current README.
That makes Switchyard attractive for a different audience:
- You are testing local or open models with an existing coding agent.
- You need explicit protocol translation.
- You want to compare several backends through one local entry point.
- You are comfortable reading the project source and hardening the deployment yourself.
Do not treat Switchyard as a proven replacement for every enterprise gateway requirement. The official project materials clearly explain routing and translation, but your team still needs to validate authentication, multi-tenant budgets, audit exports, secret rotation, access control, and high-availability behavior for its own workload.
For coding-agent experiments, that boundary may be acceptable. For a company-wide gateway, it should be a formal evaluation item.
Compare the four tools by control and responsibility
The following table is an editorial decision aid, not a throughput benchmark. Scores describe how directly each product matches the stated decision dimension based on its documented operating model.
| Tool | Primary deployment model | Routing and fallback | Key and budget control | Observability and governance | Best fit |
|---|---|---|---|---|---|
| LiteLLM | Self-hosted proxy or SDK | Strong, configurable across deployments | Strong through virtual keys, projects, and spend controls | Good, but you operate the surrounding stack | Platform teams running their own gateway |
| Switchyard | Self-hosted local proxy | Flexible profiles, translation, and agent-oriented routing | Needs deeper validation for enterprise policy controls | Request statistics are documented; broader governance is your responsibility | Coding agents and open-model experiments |
| OpenRouter | Managed multi-provider routing | Strong provider ordering, fallback, price, latency, and throughput controls | Managed account and key model; inspect organization-level controls | Provider and privacy controls are available, but the route remains external | Fast multi-provider access with low infrastructure work |
| Portkey | Managed platform plus open gateway component | Strong retries, fallbacks, conditional routing, and load balancing | Budgets, rate limits, and organization controls | Strongest combined gateway, logs, guardrails, and tracing story | Teams that need governance with operational convenience |
OpenRouter’s routing documentation exposes provider order, fallback permission, parameter compatibility, data collection preference, zero-data-retention filtering, price ceilings, latency preferences, and throughput preferences. That is more detailed than a simple “try provider A, then provider B” switch. See the OpenRouter provider routing guide.
Portkey documents a broader gateway surface that includes universal API access, caching, fallbacks, conditional routing, retries, circuit breakers, load balancing, budget limits, and rate limits. Its open gateway component can also be started locally, but that should not be confused with receiving every feature of the complete managed platform automatically. See the Portkey AI Gateway documentation.
Choose the managed route when adoption speed dominates
OpenRouter: the practical pick for fast multi-provider access
OpenRouter is the strongest option when your team wants to call many models and providers without building the provider-management layer first.
Its documented routing controls include provider ordering, fallback behavior, parameter matching, price-based sorting, throughput preferences, latency preferences, and data-collection filters. The service also documents automatic provider fallback when an upstream endpoint fails. Review the OpenRouter fallback and routing documentation.
This is valuable for:
- Product teams validating several models quickly.
- Small teams without an SRE rotation.
- Applications that need a common API while model choices change frequently.
- Developers who want provider-level routing without operating databases and gateway instances.
The cost is control over the complete request path. Even if the aggregator provides privacy controls, you still need to inspect the exact endpoint policy and the terms that apply to your workload.
OpenRouter documents Zero Data Retention controls that can restrict routing to endpoints with a ZDR policy. It also states that unclear provider policies are treated conservatively. That is useful, but it is not a substitute for reviewing your contract, regulated-data requirements, regional processing, and incident obligations. See the OpenRouter ZDR documentation.
Portkey: the governance-heavy managed option
Portkey is a better fit when “which provider should answer?” is only one part of your problem.
Its documentation covers gateway configs, retries, fallbacks, cache behavior, load balancing, guardrails, budgets, rate limits, request logs, and tracing. Portkey logs can expose the selected model, token counts, cost, cache status, retries, fallbacks, and load-balancing state. See the Portkey logs documentation.
The privacy control is also more granular than simply enabling or disabling logs. Portkey documents a full-logging mode and a metrics-only mode that records usage and operational metadata without storing request and response content. See the Portkey request logging guide.
That combination can reduce the amount of custom platform work required for:
- Prompt and response troubleshooting.
- Retry and fallback analysis.
- Team-level usage reporting.
- Guardrail enforcement.
- Application traces connected to model calls.
- Centralized policy administration.
The main qualification is architecture review. If your organization requires all payloads to remain inside its own network, a managed observability layer may still be unsuitable even when it offers metrics-only logging.
Use the audience ranking before selecting a winner
A single ranking would mix fundamentally different responsibilities. The following four rankings are more useful.
| Audience | Rank 1 | Rank 2 | Clear elimination condition |
|---|---|---|---|
| Individual developer or small prototype team | OpenRouter | Switchyard | Eliminate OpenRouter if external routing is prohibited; eliminate Switchyard if you do not want to operate a local service |
| Self-hosted platform team | LiteLLM | Switchyard | Eliminate LiteLLM if your team cannot own upgrades, secrets, monitoring, and failover |
| Managed routing team | OpenRouter | Portkey | Eliminate OpenRouter if you need integrated enterprise governance and application-level observability |
| Enterprise governance team | Portkey | LiteLLM | Eliminate Portkey if payloads cannot leave the approved control boundary; eliminate LiteLLM if you cannot build the missing governance layer |
Personal development and quick experiments
Start with OpenRouter if the main objective is model discovery and quick integration. You can spend less time maintaining provider adapters and more time evaluating application behavior.
Switchyard is the better experiment when the application is a coding agent and your priority is testing local or open-model endpoints. It is less attractive if you need ready-made organization budgets, a polished admin workflow, or a managed control plane.
Before sending real project data, create a test prompt containing no secrets and inspect:
- The API endpoint your application calls.
- The selected provider.
- The fallback behavior.
- The data retention setting.
- The usage record shown in your account or local logs.
Coding agents and local model teams
Choose Switchyard when protocol translation and agent compatibility are the central problems. Its documented launcher model is built around putting a proxy between the coding CLI and the backend model. That can shorten experiments with local inference servers and OpenAI-compatible endpoints.
Choose LiteLLM when the coding-agent experiment is becoming a shared internal service. The moment multiple engineers need separate keys, project budgets, usage attribution, and controlled provider access, LiteLLM’s gateway features become more relevant.
Do not judge either tool only by whether a first request succeeds. Test tool calls, streaming, long context, structured output, cancellation, timeout behavior, and error translation. A coding agent can appear healthy while silently losing a provider-specific capability.
Self-hosted platforms and multi-project teams
LiteLLM should be your first evaluation.
Run it behind your internal identity layer. Issue one virtual key per application or team. Define an approved model list. Set a budget policy. Store provider credentials in a secret manager. Then test what happens when:
- A provider returns a rate-limit error.
- A model name is wrong.
- The database is unavailable.
- The proxy restarts during a streamed response.
- A user exceeds the project budget.
- A log contains sensitive prompt content.
Your production design should also decide whether request bodies are logged. Token counts and cost records are not equivalent to full prompt retention. Treat them as separate data classes.
If your self-hosted environment runs on a remote Mac for development, keep the proxy separate from application credentials and document the network boundary. You can review VPSSpark’s service background before deciding whether a remote Mac is suitable for your test environment.
Teams that want managed provider routing
OpenRouter is the direct choice when you want provider selection, fallback, and consolidated access without operating the routing layer.
Use explicit provider preferences rather than relying blindly on defaults. For sensitive workloads, set the data policy at the request or account level. For latency-sensitive workloads, define acceptable performance thresholds and verify that fallback does not change the business requirement.
Remember that failover can alter more than availability. It can change model behavior, pricing, response formatting, tool reliability, and data location. Record the selected provider in your application telemetry when the decision matters.
Enterprises requiring governance and observability
Portkey deserves the first evaluation when the team needs routing plus an operational record of what happened.
Its observability documentation describes OpenTelemetry support and traces that group retries and fallbacks into a single request history. See the Portkey OpenTelemetry documentation.
That can help answer questions that a basic proxy often leaves to custom engineering:
- Which provider actually answered?
- How many retries occurred?
- Did the cache return the result?
- Which guardrail blocked the request?
- What was the final cost?
- Did a fallback change the model or region?
Still, governance is not a checkbox. Confirm administrator access, log export, deletion workflows, data residency, contract terms, retention configuration, and support access.
Follow this five-step evaluation before production
First step: draw the complete request path
Write down every hop:
Application → Proxy or Gateway → Cache and Logs → Provider Router → Model Endpoint
Mark where prompts, responses, keys, token counts, and metadata are stored. Do not approve a design that only documents the model vendor.
Second step: separate credentials by responsibility
Applications should receive scoped proxy keys, not unrestricted provider keys. Create separate identities for development, staging, production, and automation. Define who can create keys, rotate them, revoke them, and inspect usage.
Third step: create routing classes
Do not let every application choose every model. Define classes such as:
- Low-risk and low-cost classification.
- General user-facing generation.
- High-quality reasoning.
- Coding-agent traffic.
- Sensitive or regulated requests.
Assign allowed models, providers, regions, budget limits, and fallback rules to each class.
Fourth step: test failure and streaming behavior
Run controlled failures. Force a timeout. Disable a provider. Send an unsupported parameter. Interrupt a stream after the first token. Confirm whether the proxy retries, returns a partial response, changes provider, or charges the request.
OpenRouter’s documentation notes that failover is possible before streaming begins, but a provider cannot be silently replaced after partial content has already been delivered. See the OpenRouter error and streaming guidance.
Fifth step: validate cost and data records
Compare proxy records with provider invoices and application telemetry. Check whether cached requests, failed requests, retries, and fallback calls are represented correctly. Review a sample log manually. Confirm that sensitive payloads are either excluded or protected according to policy.
For a temporary test node, you can also compare a remote Mac environment with your existing Linux or cloud setup through VPSSpark’s US East Mac environment page, then contact VPSSpark support if the workload requires a different operating arrangement.
Make the final selection by elimination
Use this decision logic:
- If you need self-hosted, broad provider coverage, virtual keys, budgets, and platform controls, start with LiteLLM.
- If you need coding-agent compatibility, protocol translation, and open-model experiments, evaluate Switchyard first.
- If you need managed multi-provider routing with minimal infrastructure, start with OpenRouter.
- If you need routing, logs, guardrails, budgets, traces, and governance in one operating model, evaluate Portkey.
- If you handle highly sensitive data, reject any option until its full request path, retention settings, provider policies, and audit controls pass review.
- If you need physical interfaces, local network access, or a specific private model server, a managed aggregator may not be appropriate.
The ranking changes when the deployment mode changes. LiteLLM is not automatically better than OpenRouter. OpenRouter is not automatically safer than a self-hosted gateway. Portkey’s feature breadth does not remove contract review. Switchyard’s agent focus does not make it a complete enterprise control plane.
Your current setup may look cheaper because it sends API calls directly from each application, but that pattern creates duplicated provider integrations, scattered secrets, weak project-level budgets, and incomplete fallback records. A cloud-only setup can also make data paths and regional controls harder to reason about. For temporary gateway testing, isolated coding-agent work, or a short-lived self-hosted evaluation, renting a remote Mac from VPSSpark can give you a cleaner environment than modifying a shared workstation or committing to new hardware. Use it as a controlled test environment, not as a substitute for production gateway architecture.
Start by eliminating the deployment models you cannot govern. Then run the five-step test against the remaining candidates before moving real prompts or customer traffic.
Run Your LLM Proxy Workloads on a Dedicated Mac
Deploy your proxy, coding agents, and AI development tools on a dedicated Mac from VPSSpark.
Choose Mac mini M4 resources with 16GB or 24GB unified memory, dedicated IPv4, and 1 Gbps bandwidth.