litellm icon indicating copy to clipboard operation
litellm copied to clipboard

feat(utils.py): emit response cost as part of logs

Open krrishdholakia opened this issue 1 year ago • 2 comments

Addresses - https://github.com/BerriAI/litellm/issues/1547

Changes:

  • New response_cost kwarg to the Logging object on success (sync + async).
  • Supports completion + embedding responses
  • Moves proxy spend tracking to use this (prev. if/else branch for streaming/non-streaming)

Needs further testing:

  • image generation support

krrishdholakia avatar Jan 22 '24 23:01 krrishdholakia

This PR is being deployed to Railway 🚅

litellm: ◻️ REMOVED

railway-app[bot] avatar Jan 22 '24 23:01 railway-app[bot]

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 Jan 23, 2024 4:40am

vercel[bot] avatar Jan 22 '24 23:01 vercel[bot]