Skip to content

Conversation

@dbczumar
Copy link
Collaborator

Add tenacity as a dependency to support LiteLLM retries

Signed-off-by: dbczumar <corey.zumar@databricks.com>
Signed-off-by: dbczumar <corey.zumar@databricks.com>
@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
"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

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