Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

max_tokens and best_of reject a value equal to their configured limit

オープン
#4,666 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 3 日以内に返信

@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++
スター
947
フォーク
280
平均マージ
3日 14時間
マージ済み PR(30日)
46

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

openvinotoolkit/model_server のほかの issue

openvinotoolkit/model_server の issue をすべて見る

似ている issue

C++ の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。