Skip to content

Incorrect amount of reserved tokens for output on OpenRouter modelsΒ #3625

@daniel-lxs

Description

@daniel-lxs

App Version

3.17.0

API Provider

Anthropic

Model Used

Any OpenRouter model that has the same output tokens as the context window

πŸ” Steps to Reproduce

  1. Select Deepseek v3 0324 from OpenRouter
  2. Select the GMICloud provider or any provider that serves the model with the same amount of output tokens as the context window.
  3. The reserved tokens will equal to the tokens of the context window leaving 0 available tokens.

Image

πŸ’₯ Outcome Summary (Optional)

The reserved tokens should be a fraction of the total context window.

πŸ“„ Additional Context

I addressed this issue on #3430 by adding a condition where if the maxToken is equal to safeContextWindow then the reserved tokens should be 20% of the total context window.

Commit: 3296bd6

CC

@cte

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    Status

    Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions