-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
Improve redis semantic cache implementation #5412
Improve redis semantic cache implementation #5412
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Generally LGTM had a question about the todo
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this missing async support @tylerhutcherson ?
If yes, can you add async support on this PR. Majority of users are trying to use this our llm gateway - which requires all async functions
Hey @ishaan-jaff @krrishdholakia see my comment here: Let me know what you think! |
Async Support is a hard requirement for LiteLLM. Majority of our users use async. If we merge this and users use this in prod their litellm service will go down. We have seen this before when a non-async function was used. We're happy to wait on this until redisvl add async support |
Understood -- thanks for the clarity. Will see what we can do, thanks! |
FYI redis/redis-vl-python#214 We are close to finalizing support. |
This PR introduces new async compliant methods to the semantic cache class using lazy index construction. Because the `AsyncSearchIndex` requires an async redis python client, we needed to construct that class lazily upon first usage within the semantic cache class. This PR fixes some unclosed connection errors and is also in support of BerriAI/litellm#5412 at LiteLLM.
Now that https://github.com/redis/redis-vl-python 0.3.3 is out with async sem cache support.... I have updated this branch to reflect that. Thanks! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks good - could you send a screenshot of your tests passing for you locally ? Happy to merge after that
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks good - could you send a screenshot of your tests passing for you locally ? Happy to merge after that @tylerhutcherson
Sure thing -- screenshot below. A few caveats:
|
2b181a7
into
BerriAI:litellm_stable_pr_merges
Improve Redis semantic caching
Relevant issues
Type
🆕 New Feature
🐛 Bug Fix
🧹 Refactoring
📖 Documentation
Changes
0.3.2
) and fix pydantic & schema version issuesSemanticCache
extension for cleaner code and processing