Skip to content

feat: make static aliases visible in /v1/models and in the per-request routing log #1237

Backlog

Description

@Mazyod

🚀 Feature Description and Motivation

static_aliases rewrites the requested model to its target silently:

  • /v1/models lists only the target models, so clients can't discover which alias names they may send.
  • The per-request log line (Routing request <id> with session id ... to <backend>) records neither the name the client sent nor the routed model. When several aliases point at one backend, you can't attribute load to callers. We needed exactly that during an incident.

Proposal:

  1. List each alias in /v1/models as its own entry, with root set to the target model, so OpenAI-compatible clients can discover the names they may send.
  2. Add the requested model, the routed model, the stream flag and max_tokens (max_completion_tokens when set) to the per-request INFO line, for example:
    ... requested_model='alias-a' model='org/target' stream=False max_tokens=None.
    max_tokens=None makes requests with no generation limit easy to find. Client values are repr-quoted, so a crafted model name can't inject log lines.

Use Case

Several client-facing names, such as retired or disabled models, route to one served model. Operators need to see who sends which name, and clients need to know which names are valid.

Proposed Solution

Both changes run in our production fork (Mazyod/production-stack), with tests. We'd be glad to open PRs if you'd like either one.

Activity

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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions