Skip to content

[BUG] LiteLLM provider sends max_tokens instead of max_completion_tokens for models that require the latter (400 BadRequest) #1865

Description

@TGDone

Version: 3.85.100536
Provider: LiteLLM (OpenAI-compatible proxy)
Model: gpt-6-sol (routed to an OpenAI model)

Steps to reproduce

  1. Configure the LiteLLM provider with a model that only accepts max_completion_tokens.
  2. Send any message (e.g. "what model are you?") in Ask mode.

Expected
The request succeeds.

Actual
400 error:
OpenAIException - Unsupported parameter: 'max_tokens' is not supported
with this model. Use 'max_completion_tokens' instead.

Analysis
The extension appears to always send max_tokens in requests to the LiteLLM
provider. LiteLLM cannot infer that this custom model alias is a reasoning /
new-generation model, so it does not convert the parameter.

Suggested fix

  • Send max_completion_tokens for LiteLLM, or
  • Add a setting to choose which parameter name is used (or omit it).

Logs
(redacted error JSON attached)

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

    bugSomething isn't working

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions