Moving From Portkey to Model Waygate
Model Waygate · Every source read on
How each of Portkey's config strategies (single, loadbalance, fallback, conditional, retry, cache and circuit breaker) maps onto Model Waygate's route node kinds, and where the two behave differently.
Model Waygate wrote this page, and it has an interest in how it reads: Model Waygate is one of the products compared. So every cell about another product cites that product's own documentation, pricing page or official repository, and every Model Waygate cell cites the code that makes it true. Each published cell has had its wording independently checked against those sources. A cell awaiting confirmation reads "Not verified".
"Not documented in the pages read" means the pages cited do not say. It does not mean the product lacks the feature. Products change, so each cell shows the date its sources were read.
If a cell is wrong or out of date, please email support@modelwaygate.com with the page that shows it, and we will check it again and correct it.
Portkey nests Config strategies; Model Waygate stores typed graph nodes with id, kind, position, and config, linked by source/target/order/optional label edges. The fragments below show only kind and config; add IDs, positions and edges before submission. Credential IDs refer to records created in the destination account, not Portkey virtual-key identifiers.
Sources: PK-1, PK-2, MW-1, MW-2 · Read
Config strategy to node kind
| 1. Root entry point | |
|---|---|
| Portkey JSON shape | Top-level Config referenced by Sources: PK-1 · Read |
| Model Waygate node kind |
Sources: MW-2 · Read |
| Migration notes and behavioural differences | Exactly one input and one outgoing edge to the root routing/output node. Sources: MW-2 · Read |
2. Single target (single) | |
| Portkey JSON shape |
Sources: PK-2 · Read |
| Model Waygate node kind |
Sources: MW-2 · Read |
| Migration notes and behavioural differences | Provider/host belong to the credential record; the graph fixes the credential and model. Optional |
3. Weighted load balance (loadbalance) | |
| Portkey JSON shape |
|
| Model Waygate node kind |
Sources: MW-8 · Read |
| Migration notes and behavioural differences | Round/rebalance positive weights to total exactly 10,000 and label each outgoing edge with its branch ID. Unset Portkey weights default to 1, so give them explicit equal shares; zero-weight targets receive no traffic, so remove them. Model Waygate uses a keyed deterministic assignment scoped to the route version, not a cached Portkey TTL assignment. |
4. Fallback (fallback) | |
| Portkey JSON shape |
|
| Model Waygate node kind |
Sources: MW-3 · Read |
| Migration notes and behavioural differences | Keep target order as ascending edge order. Status-to-category mapping loses precision: selecting |
5. Conditional routing (conditional) | |
| Portkey JSON shape |
Sources: PK-9 · Read |
| Model Waygate node kind |
|
| Migration notes and behavioural differences | Switch matches only API, stream, and trusted backend-created task-session customer/feature labels. Arbitrary Portkey params/regex/URL rules have no exact translation. A Decision node can classify content with an extra model call, but is not an equivalent deterministic regex rule. |
6. Retry (retry) | |
| Portkey JSON shape |
Sources: PK-5 · Read |
| Model Waygate node kind |
|
| Migration notes and behavioural differences | Portkey counts retries after the initial try; Waygate counts total tries (2–5). Thus three Portkey retries map to four tries, but five Portkey retries exceed Waygate's node limit. Waygate retries only fixed transient categories, not arbitrary status lists. Provider waits above |
7. Circuit breaker (cb_config) | |
| Portkey JSON shape |
Sources: PK-6 · Read |
| Model Waygate node kind |
|
| Migration notes and behavioural differences | Waygate breaker must directly guard an output; a Limit can wrap that breaker. Portkey supports count/percentage logic and bypasses the breaker when all targets are open. Waygate counts consecutive transient failures and admits one probe after cooldown. Thresholds/state transitions are not equivalent even when the numbers match. |
8. Response cache (cache) | |
| Portkey JSON shape |
|
| Model Waygate node kind | No Model Waygate response-cache node. Sources: MW-20 · Read |
| Migration notes and behavioural differences | Removing |
| 9. Parameter overrides/defaults/drop/passthrough | |
| Portkey JSON shape |
|
| Model Waygate node kind | Output fixes model; caller supplies other generation parameters. |
| Migration notes and behavioural differences | No general target-level replacement for Portkey defaults/drop/override/passthrough. Move such logic to the client or preserve it elsewhere. Native forwarding carries provider fields; translated paths retain only representable canonical features, not arbitrary provider parameters. |
| 10. Additional Waygate nodes | |
| Portkey JSON shape | Hedge or per-target concurrency strategies: Not documented in the pages read. |
| Model Waygate node kind |
|
| Migration notes and behavioural differences | Hedge races buffered calls only; a limit is immediate refusal with PostgreSQL-coordinated leases. “Not documented” does not establish that Portkey lacks an equivalent capability. |
An example translation
This schematic Portkey configuration weights Anthropic/OpenAI 80/20, applies three retries and a count-based breaker to the Anthropic target, and falls back to Gemini for selected HTTP statuses. Only the Anthropic target has retries/a breaker.
Sources: PK-2, PK-5, PK-6, PK-8 · Read
{
"strategy": {"mode": "fallback", "on_status_codes": [429, 500, 502, 503, 504]},
"targets": [
{
"strategy": {"mode": "loadbalance"},
"targets": [
{
"provider": "anthropic",
"virtual_key": "anth-key",
"override_params": {"model": "claude-sonnet-4-5"},
"weight": 80,
"retry": {"attempts": 3, "use_retry_after_headers": true},
"cb_config": {"failure_threshold": 5, "cooldown_interval": 30000}
},
{
"provider": "openai",
"virtual_key": "oa-key",
"override_params": {"model": "gpt-5"},
"weight": 20
}
]
},
{"provider": "google", "virtual_key": "gem-key", "override_params": {"model": "gemini-2.5-pro"}}
]
}A Model Waygate graph that approximates it, node by node:
- Input
in-1leads to Fallbackfb-1, config{"fallbackOn":["rate_limited","server_error","circuit_open"]}. fb-1edge order 0 leads to Weightedwt-1, config{"branches":[{"id":"anth","weight":8000},{"id":"oa","weight":2000}]}(saving supplies salt).wt-1edge labeledanthleads to Retryrt-1, config{"attempts":4,"backoff":"exponential","baseDelayMs":1000,"maxDelayMs":30000,"jitter":false}, then Breakerbr-1, config{"failureThreshold":5,"cooldownSeconds":30}, then the Anthropic output.wt-1edge labeledoaleads to the OpenAI output.fb-1edge order 1 leads to the Gemini output. Each output config contains its destination-accountcredentialID andmodel.
Sources: MW-2, MW-3, MW-4, MW-5, MW-8 · Read
See the whole comparison of Model Waygate with other gateways.
Draw Your First Route
Add a provider key, let the wizard start an endpoint, and point your SDK at it.
Sign In to Get StartedSources
Model Waygate's repository is not public, so its sources are named as files at trunk commit 0406fbd7 rather than linked.
- PK-1 Configs, read
- PK-2 Gateway Config Object, read
- MW-1 Editor, endpoint API and fixed-model routing, read
apps/model-waygate/CONTEXT.mdapps/model-waygate/client/src/Editor/View.hsapps/model-waygate/client/src/Editor/History.hsapps/model-waygate/client/src/Editor/Geometry.hsapps/model-waygate/app/Endpoint/RouteTest.hsapps/model-waygate/app/Api/Control.hsapps/model-waygate/app/Api/Control/Lifecycle.hsapps/model-waygate/app/Routing/GraphJson.hsapps/model-waygate/docs/adr/0030-control-api-v1-stable.mdapps/model-waygate/docs/control-api-v1.schema.json
- MW-2 Graph types, validation, wire encoding and execution, read
apps/model-waygate/shared/Gateway/Shared/Graph.hsapps/model-waygate/app/Routing/Graph.hsapps/model-waygate/app/Routing/GraphJson.hsapps/model-waygate/app/Routing/Run.hs
- PK-5 Automatic Retries, read
- PK-6 Circuit Breaker, read
- PK-8 Load Balancing, read
- MW-3 Failure categories and fallback policy, read
apps/model-waygate/shared/Gateway/Shared/Graph.hsapps/model-waygate/app/Gateway/Error.hsapps/model-waygate/docs/control-api-v1.schema.json
- MW-4 Retry attempts, transient failures and provider waits, read
apps/model-waygate/shared/Gateway/Shared/Graph.hsapps/model-waygate/app/Routing/Run.hsapps/model-waygate/app/Gateway/Error.hsapps/model-waygate/app/Upstream/Http.hsapps/model-waygate/app/Docs/Content.hs
- MW-5 Circuit breaker shape and shared state, read
apps/model-waygate/app/Routing/Graph.hsapps/model-waygate/app/Endpoint/Breaker.hsapps/model-waygate/app/Pipeline.hsapps/model-waygate/shared/Gateway/Shared/Graph.hsapps/model-waygate/app/Docs/Content.hs
- MW-8 Weighted branches and version-scoped assignment, read
apps/model-waygate/app/Routing/Weighted.hsapps/model-waygate/shared/Gateway/Shared/Graph.hsapps/model-waygate/app/Routing/GraphJson.hsapps/model-waygate/docs/control-api-v1.schema.json
- PK-27 Request timeouts, read
- PK-4 Fallbacks, read
- PK-9 Conditional Routing, read
- MW-9 Switch facts and decider routing, read
apps/model-waygate/shared/Gateway/Shared/Graph.hsapps/model-waygate/app/Routing/Run.hsapps/model-waygate/app/Routing/Graph.hsapps/model-waygate/app/Routing/GraphJson.hsapps/model-waygate/CONTEXT.mdapps/model-waygate/app/Gateway/Error.hsapps/model-waygate/app/Pipeline.hs
- MW-7 Concurrency leases and allowed wrapper shape, read
apps/model-waygate/app/Endpoint/Concurrency.hsapps/model-waygate/app/Routing/Graph.hsapps/model-waygate/shared/Gateway/Shared/Graph.hs
- PK-17 Cache (Simple & Semantic), read
- MW-20 No response caching, read
apps/model-waygate/CONTEXT.mdapps/model-waygate/app/Docs/Content.hsapps/model-waygate/app/Pipeline.hs
- MW-13 Cache marker forwarding, translation limits and usage, read
apps/model-waygate/docs/adr/0032-prompt-cache-markers-and-cached-tokens.mdapps/model-waygate/app/Pipeline.hslibs/llm-providers/src/LlmProviders/Adapter/OpenAICompatible.hslibs/llm-providers/src/LlmProviders/Adapter/OpenAIResponses.hslibs/llm-providers/src/LlmProviders/Adapter/Anthropic.hs
- MW-16 Payload non-storage and metadata retention, read
apps/model-waygate/CONTEXT.mdapps/model-waygate/app/Config.hsapps/model-waygate/app/Database/Schema/Request.hslibs/server-utils/src/ServerUtils/Privacy.hsapps/model-waygate/app/Pipeline.hs
- PK-22 Anthropic prompt caching and automatic cache control, read
- MW-10 Inference endpoints and forwarding/translation, read
apps/model-waygate/app/Api/Gateway.hsapps/model-waygate/app/Pipeline.hsapps/model-waygate/app/Format/OpenAIResponses.hsapps/model-waygate/app/Format/Embeddings.hsapps/model-waygate/CONTEXT.mdapps/model-waygate/app/Docs/Content.hs
- MW-6 Hedge restrictions and execution, read
apps/model-waygate/app/Routing/Graph.hsapps/model-waygate/app/Routing/Run.hsapps/model-waygate/app/Routing/GraphJson.hsapps/model-waygate/shared/Gateway/Shared/Graph.hsapps/model-waygate/app/Docs/Content.hs