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

#34846 [Feature]: Option to override client-supplied 'user' field with authenticated user_id

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

## The Feature

Add a config option (e.g. `general_settings.override_user_param: true`) that makes the proxy always set `data["user"]` to the authenticated `user_api_key_dict.user_id`, ignoring any client-supplied value.

Currently, `proxy_server.py` only sets `data["user"]` when the client doesn't provide it:

```python # users can pass in 'user' param to /chat/completions. Don't override it if data.get("user", None) is None and user_api_key_dict.user_id is not None: data["user"] = user_api_key_dict.user_id ```

This is correct for deployments where a service account makes requests on behalf of multiple end users (the client is trusted to set `user`). But in deployments where LiteLLM is the authentication boundary, the client-supplied `user` should not be trusted; the proxy should override it with the identity it authenticated.

## Motivation

In multi-gateway corporate environments, there are typically multiple layers of LLM gateways. When LiteLLM handles end-user authentication (via API keys or JWT), the downstream gateway needs to know the authenticated identity for per-user rate limiting, budget enforcement, and audit logging. The `user` field in the OpenAI spec is the nat…

GitHub resolver

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

Refresh page
vote history (1 events)
#0 of 0 · 31d17h44m54s ago — entered · #import:https:::github.com:berriai:litellm post #3229
Adding a new opt-in configuration path requires integrating settings, enforcing precedence in request processing, preserving existing behavior, and adding broader regression coverage. The other change is primarily a localized consistency fix with focused tests.
discussed in #import:https:::github.com:berriai:litellm

ranked child groups

no voted pairs yet in this scope

cli
src
spread
search