Skip to content

fix: map custom model_name to actual model in /spend/calculate for cost calculation #10051

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

HikaruEgashira
Copy link

@HikaruEgashira HikaruEgashira commented Apr 16, 2025

Title

Fix: Map custom model_name to actual model in /spend/calculate

Relevant issues

#10050

Pre-Submission checklist

  • I have added at least 1 test in the tests/litellm/ directory.
  • I have added a screenshot of my new test passing locally.
  • My PR passes all unit tests on (make test-unit).
  • My PR's scope is as isolated as possible, it only solves 1 specific problem.

Type

🐛 Bug Fix

Changes

  • Fixes a bug where /spend/calculate did not resolve custom model_name to the actual model for cost calculation.
  • Now, if a custom model_name is used in completion_response, it is mapped to the real model defined in the config before cost calculation.

Copy link

vercel bot commented Apr 16, 2025

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 Apr 16, 2025 10:01am

@CLAassistant
Copy link

CLAassistant commented Apr 22, 2025

CLA assistant check
All committers have signed the CLA.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants