Skip to content

[Feature] Use Batch Completion for LiteLLM #7998

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

Open
1 of 2 tasks
junkyul opened this issue Mar 23, 2025 · 3 comments
Open
1 of 2 tasks

[Feature] Use Batch Completion for LiteLLM #7998

junkyul opened this issue Mar 23, 2025 · 3 comments
Labels
enhancement New feature or request faq-undocumented

Comments

@junkyul
Copy link

junkyul commented Mar 23, 2025

What feature would you like to see?

I am using DSPY version 2.6.5.
I set up LM with the "other providers" approach, as shown in the getting started material.

One issue that I encounter is that there is a limit of the number of requests that can make per minute, like 1000 requests per minute. When I run optimizers or evalaution with multiple threads or even 1 thread, it easily goes over that limit and the whole program run stops due to the connection error.

Is there any way to resolve this issue?
For example, by sending a batch completion call or handling the number of requests explicitly?

If there's a way to resolve this issue already, it would be great to know.

Would you like to contribute?

  • Yes, I'd like to help implement this.
  • No, I just want to request it.

Additional Context

No response

@junkyul junkyul added the enhancement New feature or request label Mar 23, 2025
@christopher-hoernle
Copy link

Batch completion would also be great to reduce costs.

@okhat
Copy link
Collaborator

okhat commented Mar 23, 2025

Don’t batch APIs promise a turnaround time of up to 24 hours? How could that make sense for any multi-stage program or optimizer?

I think a better way to handle rate limits is indeed important. But please note you can start by reducing the number of threads you set.

@christopher-hoernle
Copy link

christopher-hoernle commented Mar 23, 2025

@okhat For optimizers I agree! For multi-stage programs that operate periodically + async it's very useful. Imagine classification tasks that require multiple steps that need to be carried out daily (e.g. in healthcare).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request faq-undocumented
Projects
None yet
Development

No branches or pull requests

3 participants