litellm/tests/unit/llms/nvidia_nim
linhqm 88240a6d9d
fix(nvidia_nim): forward logprobs and top_logprobs to NIM models that serve them (#54008)
* fix(nvidia_nim): forward logprobs and return them on chat and /v1/responses

NVIDIA NIM serves logprobs and top_logprobs, but nvidia_nim refused both with
UnsupportedParamsError. The Responses bridge also never asked chat for logprobs
when include requested message.output_text.logprobs, leaked top_logprobs on its
own, and dropped the logprobs the model returned. It now maps include to chat
logprobs and puts the tokens on output_text and the streaming events

* refactor(responses): leave the bridge logprobs to the open bridge PR and keep this change to nvidia_nim params

* fix(nvidia_nim): drop top_logprobs sent without logprobs under drop_params

* fix(nvidia_nim): gate logprobs on the cost map and refuse logprobs shapes NIM cannot take

* fix(nvidia_nim): read the logprobs flag for nvidia_nim/ prefixed models and name the proxy drop_params setting

---------

Co-authored-by: mateo-berri <277851410+mateo-berri@users.noreply.github.com>
2026-11-23 22:18:59 -08:00
..
passthrough test(unit): make every tests/unit directory a package so pytest collection is unique 2026-09-20 11:50:59 +00:00
rerank refactor(types): replace Any with proven types in 137 files (#44478) 2026-10-05 11:01:45 -07:00
__init__.py test(unit): make every tests/unit directory a package so pytest collection is unique 2026-09-20 11:50:59 +00:00
test_nvidia_nim.py fix(nvidia_nim): forward logprobs and top_logprobs to NIM models that serve them (#54008) 2026-11-23 22:18:59 -08:00