BerriAI / litellm

Call all LLM APIs using the OpenAI format. Use Bedrock, Azure, OpenAI, Cohere, Anthropic, Ollama, Sagemaker, HuggingFace, Replicate (100+ LLMs)
https://docs.litellm.ai/docs/
Other
10.12k stars 1.13k forks source link

[Bug]: Spend tags metadata storage in `v1.40.9-stable` is broken #4334

Closed rahulvbrahmal-sigtech closed 1 week ago

rahulvbrahmal-sigtech commented 1 week ago

What happened?

When you assign metadata to a completions request in v1.40.9-stable, it does not store the metadata spend tags in the DB. This can be validated by trying to query the /spend/tags endpoint after running several completions requests, where the response body comes in as [].

Relevant log output

No logs - it just doesn't save

Twitter / LinkedIn details

No response

krrishdholakia commented 1 week ago

@rahulvbrahmal-sigtech do you mean spend tags or spend metadata?

spend metadata is stored separately in the db.

can you share a sample completion request?

ishaan-jaff commented 1 week ago

@rahulvbrahmal-sigtech you're right, i'm able to repro this. Working on a fix

ishaan-jaff commented 1 week ago

fixed + added testing here: https://github.com/BerriAI/litellm/pull/4345