Skip to content

Bug: Explicit model seems to be ignored by Responses routing #577

Description

@NirvanaCh7

First of all, thank you for building FreeLLMAPI.

While reading responses.ts, I noticed what might be an unintended behavior.

Around lines 387, the router gets the sticky model and passes it into routeRequest:

const preferredModel = getStickyModel(messages, sessionIdHeader);
const requestedModelLabel = reqData.model ?? 'auto';

routeRequest(..., preferredModel, ...);
traceRouteEvent('Responses', {
  ...
  requestedModel: attempt === 0 ? requestedModelLabel : undefined,
 ...
});

However, the request's explicit model (reqData.model) doesn't appear to participate in routing—it seems to be used only for logging (requestedModelLabel).

This appears to have two side effects:

  1. Specifying "model": "xxx" in a Responses request has no effect on routing.
  2. If a sticky model already exists, it appears to take precedence over an explicitly requested model.

I may have missed something elsewhere in the routing logic. Maybe, perhaps the priority could be:

explicit model > sticky model > automatic routing

Thanks again

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions