[go: nahoru, domu]

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

Estimate cost of request #81

Closed
tomsib2001 opened this issue Mar 20, 2023 · 2 comments
Closed

Estimate cost of request #81

tomsib2001 opened this issue Mar 20, 2023 · 2 comments

Comments

@tomsib2001
Copy link

Could there be away to estimate the cost of a request before making it? Apologies if this is already possible, I couldn't find it. I'm thinking of something similar to the -t option of https://github.com/npiv/chatblade

@sigoden
Copy link
Owner
sigoden commented Mar 20, 2023

#82 support inspect the token usage of request/prompt message.

actual_fee = prompt_tokens * prompt_price + completion_tokens * completion_price.
Usually completion_tokens has a greater impact. Merely evaluating the cost of request messages is not meaningful.

@sigoden sigoden closed this as completed Mar 20, 2023
@tomsib2001
Copy link
Author

For costly models such as GPT4 - 32K, it could be that the prompt cost is greater than the completion cost.

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

No branches or pull requests

2 participants