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

#26707 [Bug]: user_config not JSON-decoded for multipart endpoints (e.g. /v1/images/edits)

  • State: open
  • Author: @amitkeinan9
  • Labels: bug, proxy, llm translation, stale

### Check for existing issues

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

### What happened?

When sending a request to a **multipart/form-data** endpoint (e.g. `POST /v1/images/edits`) with a `user_config` form field whose value is a JSON string, the proxy does **not** JSON-decode the field. As a result `user_config` arrives downstream as a `str` rather than a `dict`, which then either:

- crashes with `litellm.router.Router() argument after ** must be a mapping, not str` at `route_llm_request.py:200` (`Router(**user_config)`), or - gets silently dropped during request setup, after which `route_request` falls through to the catch-all and raises `ProxyModelNotFoundError("Invalid model name passed in model=...")` at `route_llm_request.py:324`,

depending on the exact request path.

The same `user_config` payload works correctly when sent on a JSON-bodied endpoint (e.g. `POST /v1/images/generations`), because `_read_request_body` parses the entire JSON body and `user_config` arrives as a `dict`.

**Root cause** — `litellm/proxy/common_utils/http_parsing_utils.py`, in the multipart branch of `_read_request_body`:

```python if "form" in co…

GitHub resolver

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

Refresh page
vote history (1 events)
#0 of 0 · 31d18h6m37s ago — entered · #import:https:::github.com:berriai:litellm post #2956
Issue 29575 is harder because it spans callback integration behavior, multiple response schemas, usage normalization, content extraction, and regression coverage across observability paths. Issue 26707 is comparatively localized to multipart request parsing and downstream validation, with a narrower implementation surface.
discussed in #import:https:::github.com:berriai:litellm

ranked child groups

no voted pairs yet in this scope

cli
src
spread
search