[BUG] LiteLLM provider sends max output = context window as max_tokens, with no way to override it

未關閉
#2,447 1 則留言 1 個 reaction 已指派 0 人 在 GitHub 檢視

維護者通常 3 天內回覆

還沒有人認領這個 Issue。

評估

難度
3/5
預估耗時
1-2 天
新手友好度
52/100
Issue 類型
缺陷
描述清晰度
基本清楚
活躍度
活躍
技術堆疊
typescript
領域
ai

研究方向

Reproduce through Settings → Providers → LiteLLM, then click Refresh Models and open the model panel, which shows Max output equal to Context Window. Find where the LiteLLM provider reads the max output value from the model info and sends it as the request's output limit. Done means the request no longer sends the full context window as the output budget, and the LiteLLM provider settings include a field to override the output limit.

由索引模型根據 Issue 內容生成。

描述

bug

Describe the bug
When a LiteLLM model reports a max output equal to its context window, the LiteLLM provider uses that value for the request's output limit. The request then fails because the output budget fills the whole context window. The LiteLLM provider settings have no field to override this value, so users can't work around it unless they can edit the proxy's config.

To Reproduce
In Settings → Providers, choose LiteLLM and enter the proxy's base URL and API key.
Click Refresh Models and select a model whose model_info has no separate output limit.
The model panel shows Context Window: 1,048,576 and Max output: 1,048,576.
Send any prompt.

Expected behavior
Describe what you expected to happen.
litellm.ContextWindowExceededError: This model's maximum context length is 1048576 tokens.
However, you requested 1048576 output tokens and your prompt contains 44727 characters

Screenshots
Add screenshots if they help.

Video
Add a video of the bug. A video helps us find the cause.

What version of zoo are you running
3.96.0 (2144b51b)

Additional context
Add any other facts about the problem. Include exact logs and error messages.

主要語言
TypeScript
星號
2k
分支
301
平均合併
3 天 14 小時
30 天內合併 PR
103

環境準備

從這裡開始

  1. 先讀完整個 Issue,再讀專案的貢獻指南。
  2. 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
  3. Fork 儲存庫,在一個分支上完成修改。
  4. 送出 Pull Request,並在描述裡引用這個 Issue 編號。

Zoo-Code-Org/Zoo-Code 的其他 Issue

查看 Zoo-Code-Org/Zoo-Code 的全部 Issue

相似的 Issue

更多 TypeScript Issue

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。