Skip to content

[Bug]: user_header_mappings does not work with OpenWebUI #14667

@cybergexl

Description

@cybergexl

What happened?

Hello,
I am desperately trying to retrieve the x-openwebui-user-email and x-openwebui-user-id as indicated in the documentation here: https://docs.litellm.ai/docs/tutorials/openweb_ui#32-tracking-usage--spend

I thought it was OpenWebUI that wasn't passing the values, but in fact it is, since we can see them in the extra tags.

Here is my config.yaml file

litellm_settings:
  extra_spend_tag_headers:
    - “x-openwebui-user-id”
    - “x-openwebui-user-email”
    - “x-openwebui-user-role”

general_settings:
  user_header_mappings:
    - header_name: x-openwebui-user-id
      litellm_user_role: internal_user
    - header_name: x-openwebui-user-email
      litellm_user_role: customer

I think there is a bug since I configured it as described in the documentation.

Quick question: does the user have to exist in LiteLLM's internal users for the mapping to work?

Thank you

Relevant log output

lite-llm             | 08:40:16 - LiteLLM Proxy:DEBUG: proxy_server.py:2893 - param_name=general_settings, param_value={'user_header_mappings': [{'header_name': 'x-openwebui-user-id', 'litellm_user_role': 'internal_user'}, {'header_name': 'x-openwebui-user-email', 'litellm_user_role': 'customer'}, {'header_name': 'x-openwebui-user-email', 'litellm_user_role': 'admin'}]}

Are you a ML Ops Team?

No

What LiteLLM version are you on ?

ghcr.io/berriai/litellm:main-stable (up to date)

Twitter / LinkedIn details

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions