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

[Bug]: cost calculation from Azure openai is wrong for new version #1270

Closed
yiranwu0 opened this issue Jan 15, 2024 · 3 comments
Closed

[Bug]: cost calculation from Azure openai is wrong for new version #1270

yiranwu0 opened this issue Jan 15, 2024 · 3 comments
Labels
bug Something isn't working

Comments

@yiranwu0
Copy link
Collaborator

Describe the bug

Azure OpenAi completion returns the model without version information. The returned model is either 'gpt-35-turbo' or 'gpt-4'. From there, we are calculating the cost based on gpt-3.5-0613: ((0.0015, 0.002) per 1k prompt and completion tokens) and gpt-4-0613: (0.03,0.06). This means the cost is wrong if the user is using the 1106 version of the models from azure OpenAI.

Potential solution:
One way is to pass the model name specified by the user (instead of the model returned from completion) to calculation cost. However, self-created names (for example, gpt4-11) can result in fail at cost calculation.

Steps to reproduce

No response

Expected Behavior

No response

Screenshots and logs

No response

Additional Information

No response

@yiranwu0 yiranwu0 added the bug Something isn't working label Jan 15, 2024
@new4u
Copy link

new4u commented Jan 19, 2024

我也遇到了类似的错误,包括response.cost回复也是报错的,建议去掉cost的计算,或者使其成为一个非必选项I also encountered similar errors, including the error response.cost. It is recommended to remove the calculation of cost, or make it a non-required option.

@yiranwu0
Copy link
Collaborator Author

This is closed by #2902. User now can pass in custom prices.

@ghost
Copy link

ghost commented Jun 14, 2024 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants