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

#34228 [Bug]:

  • State: open
  • Author: @akshay183
  • Labels: bug, llm translation, SDK, potential-duplicate

### Check for existing issues

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

### What happened?

---

## ISSUE 1 — Bug (primary)

**Title:** `[Bug]: KeyError: 'message' on Mistral chat.multi_completion responses (hosted tools like image_generation)`

## Check for existing issues

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

## What happened?

`litellm.completion` / `litellm.acompletion` raises `KeyError: 'message'` whenever Mistral returns a `chat.multi_completion` response.

Mistral's server-side / hosted tools on the chat completions endpoint (e.g. `image_generation`, connectors, `web_search`) do **not** return the OpenAI-standard choice shape. Instead of `object: "chat.completion"` with `choices[].message` (singular), Mistral returns:

- `object: "chat.multi_completion"` - each choice carries `messages` (**plural** — an array of turn messages: assistant tool-call turn, tool-result turn, final assistant turn) instead of `message` (singular).

litellm's response converter assumes the singular OpenAI shape and dies with a bare `KeyError: 'message'`.

**Expected behavior:** litellm should parse th…

GitHub resolver

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

Refresh page
vote history (3 events)
#0 of 0 · 31d19h9m8s ago — entered · #import:https:::github.com:berriai:litellm post #1735
The left issue requires broader response-schema handling, compatibility decisions, and coverage for multi-turn/tool-result conversion paths; the right issue appears localized to request construction in one provider handler with a comparatively narrow regression test.
#26326 requires coordinated streaming and non-streaming translation changes, stateful tag parsing across chunk boundaries, provider-specific handler behavior, and compatibility tests. #34228 appears more localized to response-shape normalization, though it may require preserving multiple turns and tool-call semantics. The former carries greater cross-path regression risk.
#0 of 0 · 31d18h1m16s ago — current · #import:https:::github.com:berriai:litellm post #2847
The right issue is harder because it requires provider-specific response normalization, compatibility handling, and comprehensive regression coverage across synchronous and asynchronous SDK paths. The left issue is a narrowly scoped release-profile configuration change with limited runtime risk.
discussed in #import:https:::github.com:berriai:litellm

ranked child groups

no voted pairs yet in this scope

cli
src
spread
search