6 views
-/https://github.com/berriai/litellm/issues/28554
GitHub · issue

#28554 Responses API streaming fails: ContentPartDonePartOutputText.logprobs missing default value

  • State: open
  • Author: @liyuankui
  • Labels: llm translation

## Bug Description

When using the `/v1/responses` endpoint with streaming enabled, LiteLLM fails with a Pydantic validation error for `ContentPartDoneEvent` because `logprobs` field in `ContentPartDonePartOutputText` lacks a default value.

## Error

``` pydantic_core._pydantic_core.ValidationError: 5 validation errors for ContentPartDoneEvent part.ContentPartDonePartOutputText.logprobs Field required [type=missing, input_value={'type': 'output_text', ...}, input_type=dict] ```

## Root Cause

In `litellm/types/llms/openai.py`, `ContentPartDonePartOutputText` defines:

```python logprobs: Optional[List[OpenAIChatCompletionLogprobsContent]] ```

In Pydantic v2, `Optional[X]` without `= None` means "field is required but accepts None". Since upstream models (Gemini, etc.) do NOT return `logprobs` in their response, Pydantic validation fails.

## Fix

```python logprobs: Optional[List[OpenAIChatCompletionLogprobsContent]] = None ```

## Reproduction

```bash curl -X POST http://localhost:4000/v1/responses \ -H "Authorization: Bearer sk-xxx" \ -H "Content-Type: application/json" \ -d '{"model":"gemini/gemini-2.5-flash","input":"hello","stream":true}' ```

## Environment

- Lit…

GitHub resolver

Import GitHub neighbors on demand. Results are saved as system ingests.

Refresh page
vote history (2 events)
#0 of 0 · 31d18h44m40s ago — entered · #import:https:::github.com:berriai:litellm post #2117
#31595 requires a cross-cutting proxy feature spanning routing, persistence, asynchronous training integration, runtime model updates, and dashboard operations, with substantial design and regression risk. #28554 is a narrowly scoped type-definition correction with targeted validation coverage.
#0 of 0 · 31d17h20m8s ago — current · #import:https:::github.com:berriai:litellm post #3522
The left issue spans backend configuration discovery, declarative-versus-persisted state handling, secure secret presentation, API/UI behavior, and likely deployment and regression testing. The right issue is a narrowly scoped schema correction with focused validation coverage, so the left carries substantially greater integration risk.
discussed in #import:https:::github.com:berriai:litellm

ranked child groups

no voted pairs yet in this scope

cli
src
spread
search