Hacktoberfest 2026: los issues que los mantenedores marcaron para octubre, abiertos y aptos para principiantes. Explorar issues de Hacktoberfest

max_tokens and best_of reject a value equal to their configured limit

Abierto
#4,666 0 comentarios 0 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 2 días

@Daksha1611 ya está trabajando en esto.

Desde el 17/10/2026.

  • #4667 de @Daksha1611 — abierto

Evaluación

Dificultad
2/5
Tiempo estimado
1-3 horas
Aptitud para principiantes
25/100
Tipo de issue
Error
Claridad
Bien especificado
Estado de actividad
Estancado
Stack tecnológico
cpp
Área
ai, backend

Línea de trabajo

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.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

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.

Lenguaje dominante
C++
Estrellas
952
Forks
285
Merge medio
3 d 5 h
PR fusionados (30 d)
45

Preparar el entorno

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de openvinotoolkit/model_server

Todos los issues de openvinotoolkit/model_server

Issues similares

Más issues de C++

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.