You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[DOCS] Model routing: logical aliases and round-robin upstream pools #464
The gateway now supports opt-in, gateway-native model routing (Phase 1 of inference-gateway/inference-gateway#397): a logical model alias (e.g. fast-chat) maps to a pool of upstream provider/model deployments, selected round-robin per replica. This needs a routing guide in the docs.
Enable with ROUTING_ENABLED=true and ROUTING_CONFIG_PATH=/path/to/routing.yaml (see Configurations.md).
Routing config file format (models: <alias>: strategy + deployments[{provider, model}]); strategy defaults to round_robin (the only Phase 1 strategy). Example lives at examples/routing.yaml in the gateway repo.
Selection is per request and pre-dispatch, so streaming and non-streaming both work; the upstream is fixed before the first streamed byte.
The gateway returns X-Selected-Provider and X-Selected-Model response headers naming the chosen upstream (no secrets).
Direct routing is unchanged: an explicit ?provider= query param or a provider/model prefix always bypasses routing.
ALLOWED_MODELS / DISALLOWED_MODELS are matched against the requested logical alias, not the resolved upstream model.
Affected pages: configuration reference, a new "Model routing / aliases" guide.
Acceptance Criteria
A routing guide explains enabling routing, the routing.yaml file format, and the round-robin (per-replica, best-effort) semantics.
A migration example: a client keeps calling a stable logical name while operators change the upstreams behind it.
An explicit note that gateway-replica load balancing (Kubernetes Service + HPA) and north-south ingress routing (operator spec.routing) remain the platform's/operator's responsibility, not this feature.
Documents the X-Selected-Provider / X-Selected-Model response headers and the ALLOWED_MODELS interaction.
Notes that weighted selection, retries, fallbacks, circuit breaking, and metrics are deferred to later phases.
Documented model routing (logical aliases + round-robin pools)
Read existing docs (configuration.md, config.ts, operator.md) and confirmed the exact env vars / headers against the gateway repo (config.go, routes.go, examples/routing.yaml)
Write new model-routing.md guide
Add ROUTING_ENABLED / ROUTING_CONFIG_PATH to the configuration reference + sidebar/nav entry
New model-routing.md guide covering every acceptance criterion:
Enabling routing (ROUTING_ENABLED, ROUTING_CONFIG_PATH) and the routing.yaml format (models.<alias>.strategy + deployments[{provider, model}], strategy defaulting to round_robin).
Round-robin per-replica, best-effort semantics; per-request, pre-dispatch selection so streaming and non-streaming both work.
The X-Selected-Provider / X-Selected-Model response headers.
ALLOWED_MODELS / DISALLOWED_MODELS matched against the logical alias, not the resolved upstream.
A migration example: clients keep calling fast-chat while operators swap the upstreams behind it.
Explicit "what routing is not" note - gateway-replica load balancing (Service + HPA) and north-south ingress (operator spec.routing, Gateway API) stay the platform's/operator's job.
Direct routing (?provider= / provider/model) still bypasses routing.
configuration.md: new ### Routing section with a ConfigTable, plus the two vars in the complete config example.
.vitepress/config.ts: page wired into the sidebar (Core Concepts) and the Guides nav.
Verified locally: bun run lint:md, bun run format:check, and bun run build all pass; the page SSRs into first-pass HTML (dist/model-routing/index.html).
Not done
No new dependency, component, or generated-region change was needed - ROUTING_* are hand-authored config, so the provider-docs generator is untouched.
Activity
edenreich commentedon Jul 22, 2026
@claude Can you document this? use /ponytail:ponytail
inference-gateway-maintainer commentedon Jul 22, 2026
Claude finished @edenreich's task in 5m 48s —— View job •
docs/issue-464-20260722-1933• [Create PR ➔](https://github.com/inference-gateway/docs/compare/main...docs/issue-464-20260722-1933?quick_pull=1&title=Issue%20%23464%3A%20Changes%20from%20Claude&body=This%20PR%20addresses%20issue%20%23464%0A%0AGenerated%20with%20%5BClaude%20Code%5D(https%3A%2F%2Fclaude.ai%2Fcode)Documented model routing (logical aliases + round-robin pools)
config.go,routes.go,examples/routing.yaml)model-routing.mdguideROUTING_ENABLED/ROUTING_CONFIG_PATHto the configuration reference + sidebar/nav entryPR: #466
What was added
model-routing.mdguide covering every acceptance criterion:ROUTING_ENABLED,ROUTING_CONFIG_PATH) and therouting.yamlformat (models.<alias>.strategy+deployments[{provider, model}],strategydefaulting toround_robin).X-Selected-Provider/X-Selected-Modelresponse headers.ALLOWED_MODELS/DISALLOWED_MODELSmatched against the logical alias, not the resolved upstream.fast-chatwhile operators swap the upstreams behind it.spec.routing, Gateway API) stay the platform's/operator's job.?provider=/provider/model) still bypasses routing.configuration.md: new### Routingsection with aConfigTable, plus the two vars in the complete config example..vitepress/config.ts: page wired into the sidebar (Core Concepts) and the Guides nav.Verified locally:
bun run lint:md,bun run format:check, andbun run buildall pass; the page SSRs into first-pass HTML (dist/model-routing/index.html).Not done
ROUTING_*are hand-authored config, so the provider-docs generator is untouched.gh projectreturnsunknown owner typefor the bot token (org-project access), independent of rate limits. Left for a maintainer to move to QA.docs/issue-464-20260722-1933inference-gateway-releaser commentedon Jul 22, 2026
🎉 This issue has been resolved in version 0.9.4 🎉
The release is available on GitHub release
Your semantic-release bot 📦🚀