8 views
-/https://github.com/berriai/litellm/issues/29353
GitHub · issue

#29353 [Bug]: Cloudflare Workers AI returns empty content for OpenAI-style result.choices[0].message.content responses

  • State: open
  • Author: @piyushnirvana
  • Labels: bug, llm translation, SDK

### Check for existing issues

- [x] I have searched the existing issues and checked that my issue is not a duplicate.

### What happened?

## What happened?

I am using LiteLLM as the gateway layer in an AI Harness system.

While testing Cloudflare Workers AI models through LiteLLM, I found that some newer Cloudflare models return content in an OpenAI-compatible response shape:

```json { "result": { "choices": [ { "message": { "content": "..." } } ] } } ```

However, LiteLLM's Cloudflare response parser appears to read only the legacy Cloudflare shape:

```python completion_response["result"]["response"] ```

Because of this, models that return content through:

```python result["choices"][0]["message"]["content"] ```

do not get parsed correctly by LiteLLM. The direct Cloudflare API call returns valid content, but LiteLLM returns an empty response / no content.

## Affected models

I reproduced this with newer Cloudflare Workers AI models, including:

* Kimi K-2.6 * GLM * Gemma-4-26B

All three return content correctly when called directly through Cloudflare, but LiteLLM does not surface the content correctly.

## Expected behavi…

GitHub resolver

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

Refresh page
vote history (1 events)
#0 of 0 · 31d18h4m49s ago — entered · #import:https:::github.com:berriai:litellm post #2991
The right issue is substantially harder because it requires designing tenant-aware cache identity and configuration across multiple cache implementations, preserving backward compatibility, handling security-sensitive isolation semantics, and adding broad integration coverage. The left issue is a localized provider-response parsing adjustment with comparatively limited testing and regression risk.
discussed in #import:https:::github.com:berriai:litellm

ranked child groups

no voted pairs yet in this scope

cli
src
spread
search