Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

max_tokens and best_of reject a value equal to their configured limit

未关闭
#4,666 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 2 天内回复

@Daksha1611 已经在做这个了。

开始于 2026年10月17日。

  • #4667 来自 @Daksha1611 —— 未关闭

评估

难度
2/5
预计耗时
1-3 小时
新手友好度
25/100
Issue 类型
缺陷
描述清晰度
描述清楚
活跃度
停滞
技术栈
cpp
领域
ai, backend

调研方向

Inspect the validation checks in openai_api_handler.cpp for max_tokens and best_of, and compare them with openai_completions.cpp and openai_responses.cpp. Locate the existing limit-validation tests, then verify that all four fields accept values equal to their configured limits. The issue is already covered by an open pull request, so confirm its scope and test coverage before starting.

由索引模型根据 Issue 内容生成。

描述

Describe the bug

docs/llm/reference.md describes max_tokens_limit and best_of_limit as the maximum value
accepted by the endpoint. The check for max_tokens and best_of rejects a request that sends
exactly that value, while the other token-limit fields accept it:

field check accepts a value equal to the limit
max_tokens !(value < limit) (openai_api_handler.cpp) no
best_of !(value < limit) (openai_api_handler.cpp) no
max_completion_tokens value > limit (openai_completions.cpp) yes
max_output_tokens value > limit (openai_responses.cpp) yes

With max_tokens_limit: 1000 and the default best_of_limit: 20, running the validation code with
a value equal to the limit gives:

max_tokens             1000   -> max_tokens exceeds limit provided in graph config: 1000
max_completion_tokens  1000   -> accepted
max_output_tokens      1000   -> accepted
best_of                20     -> best_of exceeds limit provided in graph config: 20

When max_tokens is omitted the server fills in the limit itself (1000), a value that an explicit
request cannot send.

No test sends a value equal to either limit.

To Reproduce

  1. Graph with max_tokens_limit: 1000 (or the default best_of_limit of 20).
  2. POST /v3/chat/completions with "max_tokens": 1000, or "best_of": 20.
  3. 400 ... exceeds limit provided in graph config.

Expected behavior

A value equal to the configured limit is accepted, for all four fields.

Logs

None.

Configuration

  1. OVMS version: main @ eec7daac
  2. LLM servable with max_tokens_limit or best_of_limit
  3. N/A
  4. N/A
  5. N/A

Additional context

I have a patch with tests and will open a PR.

主要语言
C++
星标
952
派生
285
平均合并
3 天 12 小时
30 天内合并 PR
47

环境准备

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

openvinotoolkit/model_server 的其他 Issue

查看 openvinotoolkit/model_server 的全部 Issue

相似的 Issue

更多 C++ Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。