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

Use litellm Router for rate limiting and/or fallback LLMs #4056

Closed
enyst opened this issue Sep 25, 2024 · 2 comments
Closed

Use litellm Router for rate limiting and/or fallback LLMs #4056

enyst opened this issue Sep 25, 2024 · 2 comments
Labels
enhancement New feature or request Stale Inactive for 30 days

Comments

@enyst
Copy link
Collaborator

enyst commented Sep 25, 2024

Summary

Litellm has the Router class that encapsulates completion with rate limits handling. We can look into using it, because it should allow us to define a RetryPolicy hopefully based on how long the provider has left (though in my reading, it doesn't yet). It does allow to define a fall back LLM in case one provider runs out of tries. (#1263)

Rate limit headers for OpenAI:
https://platform.openai.com/docs/guides/rate-limits/rate-limits-in-headers

Rate limit headers for Anthropic:
https://docs.anthropic.com/en/api/rate-limits#response-headers

Technical Design

Replace completion direct call to litellm with Router.completion

Alternatives to Consider

Continue to do it ourselves. Various providers have different rate limits, so our options are:

  • don't get the remaining time, and think again of some sensible defaults, user-configurable; better documentation
  • get the remaining time from liteLLM

Fall back LLM:

  • do it ourselves
  • configure litellm
Copy link
Contributor

github-actions bot commented Nov 2, 2024

This issue is stale because it has been open for 30 days with no activity. Remove stale label or comment or this will be closed in 7 days.

@github-actions github-actions bot added the Stale Inactive for 30 days label Nov 2, 2024
Copy link
Contributor

This issue was closed because it has been stalled for over 30 days with no activity.

@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Nov 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request Stale Inactive for 30 days
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants