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

[Feature Request]: llm_config with input_price and output_price #2435

Open
WebsheetPlugin opened this issue Apr 18, 2024 · 4 comments
Open
Labels
0.2 Issues which were filed before re-arch to 0.4 needs-triage

Comments

@WebsheetPlugin
Copy link

WebsheetPlugin commented Apr 18, 2024

Is your feature request related to a problem? Please describe.

#2424

As mentioned above, the issue is that Autogen has issues with new models. As all the model pricings are hardcoded. Curently you need to get the latest version to fix this. But you might not always want to get the latest version.

Describe the solution you'd like

Solution Idea A) Propose to allow setting prompt/completion
prices via llm_settings. See here:

{
"model": "gpt-3.5-turbo-1106",
"api_key": "sk-xxx",
"max_tokens": 4000,
"timeout": 100,
"max_retries": 2,
"input_cost" : 10, # USD per mil; alt naming prompt_tokens_cost
"output_cost" : 30 # USD per mil; alt naming completion_tokens_cost
}

It might make sense to also add vision pricing this way then:
image

Solution Idea B) It seems that curently Autogen is hardcoding the price for each model type
separately. But if it's not present, then you should simply compare the
prefix. So in this case, I believe the prefix "gpt-4-turbo" is enough to
understand what price range it is.

Additional context

No response

@WebsheetPlugin WebsheetPlugin changed the title [Feature Request]: llm_config with prompt and output tokens [Feature Request]: llm_config with input_price and output_price Apr 18, 2024
@Hk669
Copy link
Contributor

Hk669 commented Apr 18, 2024

Feel free to make a PR. Excited to see it! @WebsheetPlugin

@WebsheetPlugin
Copy link
Author

WebsheetPlugin commented Apr 18, 2024

@Hk669 I can do B) as it's very easy to do and in my opinion a better solution compared to how it's handled now, but @sonichi says it's a temporary or hacky solution. So not sure if I should proceed.

@Hk669
Copy link
Contributor

Hk669 commented Apr 18, 2024

@Hk669 I can do B) as it's very easy to do and in my opinion a better solution compared to how it's handled now, but @sonichi says it's a temporary or hacky solution. So not sure if I should proceed.

@WebsheetPlugin sure give it a try. we'll have support from @sonichi too.

@afourney
Copy link
Member

afourney commented Apr 18, 2024

So PR #1682 has a partial implementation of this. Can you have a look and see if it is useful here? Maybe revive it?

@rysweet rysweet added 0.2 Issues which were filed before re-arch to 0.4 needs-triage labels Oct 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
0.2 Issues which were filed before re-arch to 0.4 needs-triage
Projects
None yet
Development

No branches or pull requests

6 participants