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

Cost computation for Gpt-4 is wrong. #37

Open
cthulahoops opened this issue Jun 13, 2023 · 4 comments
Open

Cost computation for Gpt-4 is wrong. #37

cthulahoops opened this issue Jun 13, 2023 · 4 comments
Labels
bug Something isn't working

Comments

@cthulahoops
Copy link
Collaborator

The cost of gpt-4 is:

(0.03 * prompt_tokens / 1000 + 0.06 * response_tokens / 1000)

@saulpw
Copy link
Owner

saulpw commented Jun 13, 2023

Yes, but how do you know how many response_tokens you'll get, for a --dry-run? We could come up with a more precise estimation function, but I figured 2prompt_tokens0.03 was almost reasonable for a first pass. (Could be commented, obviously :)

@cthulahoops
Copy link
Collaborator Author

I guess it's reasonable to estimate for a dry run - though I think that estimate is inaccurate enough that I'd rather not. We should be able to give the correct value for a real run though?

@dovinmu
Copy link
Collaborator

dovinmu commented Jun 13, 2023

looks like we've got a few other price adjustments we should make too:

https://openai.com/blog/function-calling-and-other-api-updates

gpt-3.5-turbo: $0.0015 per 1K input tokens and $0.002 per 1K output tokens

gpt-3.5-turbo-16k will be priced at $0.003 per 1K input tokens and $0.004 per 1K output tokens.

@dovinmu
Copy link
Collaborator

dovinmu commented Jun 13, 2023

we can at least compute the exact cost correctly for real calls since it's different for input/output tokens

@anjakefala anjakefala added the bug Something isn't working label Jun 20, 2023
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

4 participants