What's Changed
[Feat] Proxy - Add Spend tracking logs by ishaan-jaff in https://github.com/BerriAI/litellm/pull/1498
New SpendTable when Using LiteLLM Virtual Keys - Logs API Key, CreatedAt Date + Time, Model, Spend, Messages, Response
Docs to get started: https://docs.litellm.ai/docs/proxy/virtual_keys
![Group 197](https://user-images.githubusercontent.com/29436595/297958409-230b76f6-e919-4a1f-b183-09084a0e568d.png)
[Feat] Proxy - Track Cost Per User (Using `user` passed to requests) by ishaan-jaff in https://github.com/BerriAI/litellm/pull/1509
- Proxy Server Track Cost Per User
Request:
shell
curl --location 'http://0.0.0.0:8000/chat/completions' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer sk-RwPq' \
--data ' {
"model": "BEDROCK_GROUP",
"user": "litellm-is-awesome-user",
"messages": [
{
"role": "user",
"content": "what llm are you-444"
}
],
}'
Cost Tracked in LiteLLM Spend Tracking DB
<img width="419" alt="Screenshot 2024-01-18 at 5 56 17 PM" src="https://github.com/BerriAI/litellm/assets/29436595/700732e1-868a-4cec-bd17-376d7d510bab">
Notes:
- If a `user` is passed to the request the proxy tracks cost for it
- If the `user` does not exist in the User Table, we make a new user with the spend
feat(parallel_request_limiter.py): add support for tpm/rpm rate limits for keys by krrishdholakia in https://github.com/BerriAI/litellm/pull/1501
**Full Changelog**: https://github.com/BerriAI/litellm/compare/v1.18.3...v1.18.4