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

#27670 [Bug]: TypeError: 'async for' requires an object with aiter method, got NoneType when streaming models with reasoning field in delta

  • State: open
  • Author: @profoundvision
  • Labels: bug, proxy

### Check for existing issues

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

### What happened?

When using stream=True with Scaleway (or any provider returning a reasoning field within the delta object), LiteLLM crashes with a TypeError.

The issue occurs because the streaming parser/proxy fails to gracefully handle the non-standard reasoning key inside the delta object during an asynchronous iteration, resulting in the response object becoming None.

### Steps to Reproduce

1. Use LiteLLM to call a Scaleway model with stream=True. 2. The provider returns chunks where the delta contains a reasoning key (e.g., {"delta": {"reasoning": "..."}}). 3. The async iterator fails.

```py import litellm import asyncio

async def test_stream(): # This call triggers the error response = await litellm.acompletion( model="scaleway/gemma-4-26b-a4b-it", messages=[{"role": "user", "content": ""}], stream=True ) async for chunk in response: print(chunk)

asyncio.run(test_stream()) ```

**Expected** LiteLLM should either: Support the reasoning field in the delta object as part of the stream. Or, gracefully cat…

GitHub resolver

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

Refresh page
vote history (1 events)
#0 of 0 · 31d17h45m42s ago — entered · #import:https:::github.com:berriai:litellm post #3217
The right issue is harder because it requires safely relocating or redesigning CPU-heavy token accounting without harming streaming correctness, concurrency, and liveness behavior across providers. The left issue is more likely a contained async-stream normalization and error-handling fix with narrower regression coverage.
discussed in #import:https:::github.com:berriai:litellm

ranked child groups

no voted pairs yet in this scope

cli
src
spread
search