You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
`redisvl` is a versatile Python library with an integrated CLI, designed to enhance AI applications using Redis. This guide will walk you through the following steps:
Copy file name to clipboardExpand all lines: content/develop/ai/redisvl/0.8.2/user_guide/llmcache.md
+3-20Lines changed: 3 additions & 20 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,28 +1,11 @@
1
1
---
2
-
linkTitle: LLM caching
3
-
title: LLM Caching
4
-
aliases:
5
-
- /integrate/redisvl/user_guide/03_llmcache
2
+
linkTitle: First, we will import [openai](https://platform.openai.com) to use their API for responding to user prompts. we will also create a simple `ask_openai` helper method to assist.
3
+
title: First, we will import [OpenAI](https://platform.openai.com) to use their API for responding to user prompts. We will also create a simple `ask_openai` helper method to assist.
This notebook demonstrates how to use RedisVL's `SemanticCache` to cache LLM responses based on semantic similarity. Semantic caching can significantly reduce API costs and latency by retrieving cached responses for semantically similar prompts instead of making redundant API calls.
11
-
12
-
Key features covered:
13
-
- Basic cache operations (store, check, clear)
14
-
- Customizing semantic similarity thresholds
15
-
- TTL policies for cache expiration
16
-
- Performance benchmarking
17
-
- Access controls with tags and filters for multi-user scenarios
18
-
19
-
Prerequisites:
20
-
- Ensure `redisvl` is installed in your Python environment
21
-
- Have a running instance of [Redis Stack](https://redis.io/docs/install/install-stack/) or [Redis Cloud](https://redis.io/cloud)
22
-
- OpenAI API key for the examples
23
-
24
-
First, we will import [OpenAI](https://platform.openai.com) to use their API for responding to user prompts. We will also create a simple `ask_openai` helper method to assist.
0 commit comments