Skip to content

fix(vllm): handle `logprobs=None´ and align logprob docs#5203

Open
LeonEricsson wants to merge 3 commits intohuggingface:mainfrom
LeonEricsson:fix/stale_logprob_docstrings
Open

fix(vllm): handle `logprobs=None´ and align logprob docs#5203
LeonEricsson wants to merge 3 commits intohuggingface:mainfrom
LeonEricsson:fix/stale_logprob_docstrings

Conversation

@LeonEricsson
Copy link
Collaborator

@LeonEricsson LeonEricsson commented Mar 2, 2026

This fixes logprob handling and aligns the related documentation.

trl/scripts/vllm_serve.py now accepts None for logprobs and logprob_token_ids in /generate/ and /chat/ responses, discussed here. This prevents server 500s when requests use logprobs=None and vLLM returns no logprob payload.

It also updates logprob docstrings in trl/generation/vllm_client.py, trl/scripts/vllm_serve.py, trl/generation/vllm_generation.py, and trl/trainer/grpo_trainer.py to reflect the actual behavior introduced in #5107 .

A regression test update in tests/test_vllm_client_server.py covers generate(..., logprobs=None) and chat(..., logprobs=None).

@LeonEricsson LeonEricsson changed the title fix: vllm logprob docstrings fix(vllm): handle `logprobs=None´ and align logprob docs Mar 2, 2026
@LeonEricsson LeonEricsson marked this pull request as ready for review March 2, 2026 20:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant