Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

max_tokens and best_of reject a value equal to their configured limit

Đang mở
#4,666 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 3 ngày

@Daksha1611 đang làm issue này rồi.

Từ ngày 17/10/2026.

  • #4667 của @Daksha1611 — đang mở

Đánh giá

Độ khó
2/5
Thời gian dự kiến
1-3 giờ
Mức phù hợp với người mới
25/100
Loại issue
Lỗi
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Đình trệ
Công nghệ
cpp
Lĩnh vực
ai, backend

Hướng nghiên cứu

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.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

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.

Ngôn ngữ chính
C++
Star
947
Fork
280
Merge trung bình
3 ngày 14 giờ
Pull request đã merge (30 ngày)
46

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của openvinotoolkit/model_server

Tất cả issue của openvinotoolkit/model_server

Issue tương tự

Thêm issue về C++

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.