cache
#
Warning
Beta Feature!
Cache provides an optional caching layer for LLMs.
Cache is useful for two reasons:
It can save you money by reducing the number of API calls you make to the LLM provider if you’re often requesting the same completion multiple times.
It can speed up your application by reducing the number of API calls you make to the LLM provider.
Cache directly competes with Memory. See documentation for Pros and Cons.
Class hierarchy:
BaseCache --> <name>Cache # Examples: InMemoryCache, RedisCache, GPTCache
Classes
|
Cache that uses Redis as a backend. |
|
Cache that uses Cosmos DB Mongo vCore vector-store backend |
|
Cache that uses Cassandra / Astra DB as a backend. |
|
Cache that uses Cassandra as a vector-store backend for semantic (i.e. similarity-based) lookup. |
|
SQLite table for full LLM Cache (all generations). |
|
SQLite table for full LLM Cache (all generations). |
|
Cache that uses GPTCache as a backend. |
Cache that stores things in memory. |
|
|
Cache that uses Memcached backend through pymemcache client lib |
|
Cache that uses Momento as a backend. |
|
Cache that uses OpenSearch vector store backend |
|
Cache that uses Redis as a backend. |
|
Cache that uses Redis as a vector-store backend. |
|
Cache that uses SQAlchemy as a backend. |
|
Cache that uses SQAlchemy as a backend. |
|
Cache that uses SQLite as a backend. |
|
Cache that uses SingleStore DB as a backend |
|
Cache that uses Upstash Redis as a backend. |
Deprecated classes
|
|
|