Skip to content

Add embeddings cache #318

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

Merged
merged 7 commits into from
Apr 16, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@ We're excited to announce the support for **RedisVL Extensions**. These modules
Increase application throughput and reduce the cost of using LLM models in production by leveraging previously generated knowledge with the [`SemanticCache`](https://docs.redisvl.com/en/stable/api/cache.html#semanticcache).

```python
from redisvl.extensions.llmcache import SemanticCache
from redisvl.extensions.cache.llm import SemanticCache

# init cache with TTL and semantic distance threshold
llmcache = SemanticCache(
Expand Down
19 changes: 18 additions & 1 deletion docs/api/cache.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,26 @@ SemanticCache

.. _semantic_cache_api:

.. currentmodule:: redisvl.extensions.llmcache
.. currentmodule:: redisvl.extensions.cache.llm

.. autoclass:: SemanticCache
:show-inheritance:
:members:
:inherited-members:


****************
Embeddings Cache
****************

EmbeddingsCache
===============

.. _embeddings_cache_api:

.. currentmodule:: redisvl.extensions.cache.embeddings

.. autoclass:: EmbeddingsCache
:show-inheritance:
:members:
:inherited-members:
2 changes: 1 addition & 1 deletion docs/user_guide/03_llmcache.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@
}
],
"source": [
"from redisvl.extensions.llmcache import SemanticCache\n",
"from redisvl.extensions.cache.llm import SemanticCache\n",
"\n",
"llmcache = SemanticCache(\n",
" name=\"llmcache\", # underlying search index name\n",
Expand Down
2 changes: 1 addition & 1 deletion docs/user_guide/04_vectorizers.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -609,7 +609,7 @@
"metadata": {},
"outputs": [],
"source": [
"from redisvl.extensions.llmcache import SemanticCache\n",
"from redisvl.extensions.cache.llm import SemanticCache\n",
"\n",
"cache = SemanticCache(name=\"custom_cache\", vectorizer=custom_vectorizer)\n",
"\n",
Expand Down
2 changes: 1 addition & 1 deletion docs/user_guide/09_threshold_optimization.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
"metadata": {},
"outputs": [],
"source": [
"from redisvl.extensions.llmcache import SemanticCache\n",
"from redisvl.extensions.cache.llm import SemanticCache\n",
"\n",
"sem_cache = SemanticCache(\n",
" name=\"sem_cache\", # underlying search index name\n",
Expand Down
Loading
Loading