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

#25757 [Bug] Model-based file routing encoded file_id exceeds Azure OpenAI 64-char limit in Responses API

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

## Bug Description

When using model-based file routing (`extra_body={"model": "..."}`) with `POST /v1/files`, the returned `file.id` is encoded with routing metadata via `encode_file_id_with_model()`. This encoded ID is 67-80+ characters long, which exceeds Azure OpenAI's 64-character maximum for `file_ids` in the Responses API (`tools[0].container.file_ids[0]`).

The Responses API code path (`update_responses_tools_with_model_file_ids()`) does **not** decode these model-based encoded file IDs before forwarding to the provider. It only handles managed file ID mappings (`model_file_id_mapping`), not the base64-encoded model-routing IDs.

## Steps to Reproduce

```python from openai import OpenAI

client = OpenAI(base_url="http://litellm-proxy:4000/v1/", api_key="sk-...")

# 1. Upload file with model-based routing file = client.files.create( file=open("data.xlsx", "rb"), purpose="assistants", extra_body={"model": "gpt-4o"} # Triggers encode_file_id_with_model() ) print(f"file.id = {file.id}") # 76+ chars print(f"length = {len(file.id)}") # 76

# 2. Use file in Responses API with code_interpreter response = client.responses.create( model="gpt-4o", tools=[{ …

GitHub resolver

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

Refresh page
vote history (4 events)
#0 of 0 · 31d18h50m13s ago — entered · #import:https:::github.com:berriai:litellm post #2135
The right issue spans provider-specific endpoint discovery, authentication-derived configuration, model capability detection, and Responses API integration, creating broader compatibility and regression risk. The left issue appears more localized to identifier transformation and the associated request path, with narrower testing and implementation scope.
The left requires cross-cutting compatibility work across provider routing, streaming translation, structured content/tool handling, token accounting, and regression testing. The right appears comparatively localized to identifier encoding/decoding in one Responses API path, with narrower integration risk.
27470 requires broader behavioral design, configuration semantics, provider-specific classification, and regression coverage, while 25757 is a more localized identifier-handling fix across an existing request path.
#0 of 0 · 31d17h52m5s ago — current · #import:https:::github.com:berriai:litellm post #3104
The left requires coordinating callback, tool-execution, and multi-turn orchestration across endpoint and provider-specific paths, with broader regression risk. The right is comparatively localized to identifier normalization in one API translation path, with focused compatibility tests.
discussed in #import:https:::github.com:berriai:litellm

ranked child groups

no voted pairs yet in this scope

cli
src
spread
search