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

Add tenacity as a dependency to support LM retries with LiteLLM #1731

Merged
merged 2 commits into from
Oct 31, 2024

Conversation

dbczumar
Copy link
Collaborator

Add tenacity as a dependency to support LiteLLM retries

Signed-off-by: dbczumar <[email protected]>
Signed-off-by: dbczumar <[email protected]>
@dbczumar dbczumar changed the title Add tenacity as a dependency to support LiteLLM retries Add tenacity as a dependency to support LM retries with LiteLLM Oct 31, 2024
@@ -43,7 +43,8 @@ dependencies = [
"magicattr~=0.1.6",
"litellm",
"diskcache",
"json-repair"
"json-repair",
"tenacity>=8.2.3",
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LiteLLM uses tenacity==8.2.3 for testing: https://github.com/BerriAI/litellm/blob/b73039b28337c04ac87eea8e0be11186f142f38f/requirements.txt#L46.

I've confirmed that 8.2.3 and 9.0.0 appear to work just fine via the following script using an Azure OpenAI + Databricks endpoint with an aggressive rate limit of 1QPM:

import litellm
import uuid


litellm.set_verbose=True
for i in range(100):
    print(litellm.completion(
        model="databricks/coreyazureopenai",
        messages=[{"role": "user", "content": "You are a helpful assistant." + uuid.uuid4().hex}],
        retry_strategy="exponential_backoff_retry",
        num_retries=10,
    ))

Accordingly, >=8.2.3 appears appropriate

openai
optuna
pandas
pydantic~=2.0
regex
requests
structlog
tenacity>=8.2.3
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the only material change. Everything else is just linter formatting

@okhat okhat merged commit 1bab822 into stanfordnlp:main Oct 31, 2024
4 checks passed
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

Successfully merging this pull request may close these issues.

2 participants