Closed leehuwuj closed 3 months ago
Latest commit: 1a1d80706b0407f91c0d76913024984b4464d626
The changes in this PR will be included in the next version bump.
Not sure what this means? Click here to learn what changesets are.
Click here if you're a maintainer who wants to add another changeset to this PR
The recent changes introduce caching mechanisms to improve performance and reduce redundant object creation. Specifically, a global vector_store
variable is added to cache an instance of PGVectorStore
in vectordb.py
, and cachetools
is used to cache get_storage_context
in index.py
. Additionally, the cachetools
dependency is added to pyproject.toml
.
Files | Change Summary |
---|---|
.../vectordbs/python/pg/vectordb.py |
Introduced global vector_store variable and updated get_vector_store() function to use this cache. |
.../vectordbs/python/none/index.py |
Added caching to get_storage_context function using cachetools with a TTLCache. |
.../streaming/fastapi/pyproject.toml |
Added cachetools dependency version ^5.3.3 . |
Objective (Issue #43) | Addressed | Explanation |
---|---|---|
Optimize connection management to prevent Max client connections reached error. |
✅ | |
Handle connection pooling efficiently. | ✅ | |
Adjust PostgreSQL server configuration to accommodate required client connections. | ❓ | Code changes optimize connection usage but do not alter server configuration. |
In fields of code where bytes do play, A rabbit hops to save the day. With caches set and tools in hand, Connections thrive throughout the land. 🐇✨
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?
Fix: https://github.com/run-llama/create-llama/issues/43
Summary by CodeRabbit
New Features
get_storage_context
to enhance performance.Performance Improvements
PGVectorStore
instance, reducing redundant object creation.get_storage_context
usingcachetools
to improve efficiency.Dependencies
cachetools
version^5.3.3
to project dependencies.