Skip to content
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

fix: llm-proxy response_cost being 0 #6293

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open

fix: llm-proxy response_cost being 0 #6293

wants to merge 3 commits into from

Conversation

xingyaoww
Copy link
Collaborator

@xingyaoww xingyaoww commented Jan 15, 2025

End-user friendly description of the problem this fixes or functionality that this introduces

  • Include this change in the Release Notes. If checked, you must provide an end-user friendly description for your change below

Give a summary of what the PR does, explaining any non-trivial design decisions

Fix the issue where Litellm proxy cost wasn't correctly calculated: response_cost by default is 0 but not None (a bug from the LiteLLM side), which causes our cost calculation to mess up.

This PR fixes it by only looking at 'llm_provider-x-litellm-response-cost'


Link of any specific issues this addresses


To run this PR locally, use the following command:

docker run -it --rm   -p 3000:3000   -v /var/run/docker.sock:/var/run/docker.sock   --add-host host.docker.internal:host-gateway   -e SANDBOX_RUNTIME_CONTAINER_IMAGE=docker.all-hands.dev/all-hands-ai/runtime:0852fed-nikolaik   --name openhands-app-0852fed   docker.all-hands.dev/all-hands-ai/openhands:0852fed

@xingyaoww xingyaoww requested review from enyst and mamoodi January 15, 2025 17:28
@mamoodi
Copy link
Collaborator

mamoodi commented Jan 15, 2025

Would be nice if enyst can take a look but looks reasonable.

Copy link
Collaborator

@enyst enyst left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm good with the cost PR, please note that this branch also includes the revert that is subject to #6300

I think it would be good to keep them separate?

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.

3 participants