mirror of
https://github.com/open-webui/open-webui.git
synced 2026-05-07 19:38:46 -05:00
[PR #9398] [CLOSED] Optional user metadata forwarding to LiteLLM for cost tracking #37999
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/open-webui/open-webui/pull/9398
Author: @elabbarw
Created: 2/5/2025
Status: ❌ Closed
Base:
dev← Head:forward_tags_litellm📝 Commits (8)
dc3b2f1Merge pull request #9190 from open-webui/devab94468Merge pull request #9387 from open-webui/deve30cfa9introduce ENABLE_FORWARD_USER_INFO_LITELLM_TAGS5eeefd8Send tags for embeddingsb0c36fcSend tags for audio806e1cesend tags for imagesef45c1fsend tags for chat and speech0941ed6remove unnecessary param📊 Changes
5 files changed (+106 additions, -29 deletions)
View changed files
📝
backend/open_webui/env.py(+11 -0)📝
backend/open_webui/retrieval/utils.py(+22 -20)📝
backend/open_webui/routers/audio.py(+15 -1)📝
backend/open_webui/routers/images.py(+8 -1)📝
backend/open_webui/routers/openai.py(+50 -7)📄 Description
feat: Optional user metadata forwarding to LiteLLM for cost tracking
Description
This PR introduces an opt-in feature to forward user metadata to LiteLLM for enhanced cost tracking. A new environment variable enables the inclusion of additional user information in the payload sent to LiteLLM Proxy.
Changes
ENABLE_FORWARD_USER_INFO_LITELLM_TAGSin env.pyrouters/openai.py,routers/audio.py,routers/image.py, andretrieval/utils.pyMetadata Details
When enabled, the following tags are included:
Implementation
metadataobject with a list of 'tags' when enabledTesting
Privacy Considerations
ENABLE_FORWARD_USER_INFO_LITELLM_TAGSis setScreenshots
Impact
This feature enhances cost tracking capabilities through LiteLLM while maintaining user privacy as an opt-in feature.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.