BerriAI / litellm

Python SDK, Proxy Server (LLM Gateway) to call 100+ LLM APIs in OpenAI format - [Bedrock, Azure, OpenAI, VertexAI, Cohere, Anthropic, Sagemaker, HuggingFace, Replicate, Groq]
https://docs.litellm.ai/docs/
Other
14.07k stars 1.66k forks source link

(fix) Pass `subject` with correct value to OpenMeter in OpenMeter integration #6816

Open togmund opened 2 days ago

togmund commented 2 days ago

Title

OpenMeter rejects requests from this logger here: https://github.com/BerriAI/litellm/blob/1890fde3f377b0896e7ca5908953ef948ec1c8a7/litellm/integrations/openmeter.py#L128-L135 Because the value of subject is not a string. See schema here.

This is because instead of assigning the subject property with the value of the user param in kwargs, it is instead wrapping that value in a tuple: https://github.com/BerriAI/litellm/blob/1890fde3f377b0896e7ca5908953ef948ec1c8a7/litellm/integrations/openmeter.py#L73

Relevant issues

N/A

Type

🐛 Bug Fix

Changes

[REQUIRED] Testing - Attach a screenshot of any new tests passing locally

If UI changes, send a screenshot/GIF of working UI fixes

vercel[bot] commented 2 days ago

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
litellm ✅ Ready (Inspect) Visit Preview 💬 Add feedback Nov 19, 2024 9:38pm