litellm - 💡(How to fix) Fix [Bug]: add_user_information_to_llm_headers not forwarded to /v1/files or /v1/batches endpoints [1 pull requests]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…

Fix Action

Fixed

Code Example

model_list:
  - model_name: mymodel
    litellm_params:
      api_base: http://batchserver/v1
      model: hosted_vllm/mymodel
      api_key: change-me

general_settings:
  add_user_information_to_llm_headers: true

---
RAW_BUFFERClick to expand / collapse

Check for existing issues

  • I have searched the existing issues and checked that my issue is not a duplicate.

What happened?

I am using LiteLLM Proxy to route requests to a custom server that simulates the OpenAI Batch/Files API. While add_user_information_to_llm_headers: true works perfectly for /v1/chat/completions (forwarding user and team metadata), these headers are missing when LiteLLM proxies requests to the /v1/files or /v1/batches endpoints.

Configuration

model_list:
  - model_name: mymodel
    litellm_params:
      api_base: http://batchserver/v1
      model: hosted_vllm/mymodel
      api_key: change-me

general_settings:
  add_user_information_to_llm_headers: true

Is this a current limitation of the middleware responsible for header forwarding? If so, would it be feasible to extend add_user_information_to_llm_headers to cover the File and Batch management endpoints?

Steps to Reproduce

  1. Start the LiteLLM Proxy with the config above.

  2. Make a request to /v1/chat/completions using a valid LiteLLM Key.

    • Result: The backend server receives headers like litellm-user-id or litellm-team-id. (Expected behavior).
  3. Make a request to /v1/files (uploading a file) or /v1/batches using the same key.

    • Result: The request is successfully proxied to http://batchserver/v1/files, but the user/team headers are missing.

Expected behavior

The headers containing user and team information should be forwarded to the api_base for all proxied OpenAI-compatible endpoints, including Files and Batches, to allow the backend to distinguish between different users or teams.

Relevant log output

What part of LiteLLM is this about?

Proxy

What LiteLLM version are you on ?

1.85.0

Twitter / LinkedIn details

No response

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

FAQ

Expected behavior

The headers containing user and team information should be forwarded to the api_base for all proxied OpenAI-compatible endpoints, including Files and Batches, to allow the backend to distinguish between different users or teams.

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

litellm - 💡(How to fix) Fix [Bug]: add_user_information_to_llm_headers not forwarded to /v1/files or /v1/batches endpoints [1 pull requests]