Skip to content

[DOCS] Model routing: logical aliases and round-robin upstream pools #464

Closed

Description

Summary

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.

Implementing PR: inference-gateway/inference-gateway#490

User-facing behavior to document:

  • 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.

Activity

  1. added
    documentation
    on Jul 22, 2026
  2. moved this to Todo in 2026on Jul 22, 2026
  3. added theissue type on Jul 22, 2026
  4. edenreich commented on Jul 22, 2026

    @edenreich
    Contributor

    @claude Can you document this? use /ponytail:ponytail

  5. inference-gateway-maintainer commented on Jul 22, 2026

    @inference-gateway-maintainer
    ContributorAuthor

    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)

    • 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
    • Lint + format + build check (all pass)
    • Commit + open PR

    PR: #466

    What was added

    • 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.
      • Deferred-to-later-phases list: weighted selection, retries, fallbacks, circuit breaking, metrics.
      • 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

  6. inference-gateway-releaser commented on Jul 22, 2026

    @inference-gateway-releaser
    Contributor

    🎉 This issue has been resolved in version 0.9.4 🎉

    The release is available on GitHub release

    Your semantic-release bot 📦🚀

  7. moved this from Todo to Done in 2026on Jul 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    documentationreleased

    Type

    Projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions