Skip to main content
Semantic caching (SCACHE.SET / SCACHE.GET) requires an embedding model to convert text into vectors that Cache-Pot can compare for meaning. Cache-Pot calls any OpenAI-compatible embeddings endpoint you point it at — whether that is OpenAI itself, a local model running in Ollama, or any other provider that speaks the same API.

Required environment variables

Embedding configuration is environment-only. There are no CLI flag equivalents for these three settings.
These three variables are environment-only — there are no --embed-* CLI flag equivalents. Set them before starting the cache-pot process.

OpenAI setup

Export your OpenAI credentials and start the server. Cache-Pot will log semantic cache embeddings enabled via CACHEPOT_EMBED_URL on startup to confirm the configuration was picked up.

Ollama (local) setup

Ollama provides a free, local embeddings server that is fully compatible with the OpenAI embeddings API. Pull a model first, then point Cache-Pot at the local endpoint. No API key is needed.
Use Ollama during development to avoid API costs entirely. Switch to OpenAI or another hosted provider in production for the best embedding quality and consistency.

Other OpenAI-compatible providers

Any provider that implements the OpenAI embeddings API works with Cache-Pot. Set CACHEPOT_EMBED_URL to the provider’s embeddings endpoint and adjust the model name to match what that provider expects.

Verifying the configuration

After starting the server with embedding variables set, run a quick round-trip using redis-cli (or any Redis client) to confirm that semantic caching is working end to end:
If SCACHE.SET returns an error such as embedding client not configured, double-check that CACHEPOT_EMBED_URL is exported in the same shell session (or container environment) where cache-pot is running.
The similarity threshold used by SCACHE.GET can be tuned per-call with the THRESHOLD option. A value of 0.9 requires a very close match; lower values (e.g. 0.75) allow fuzzier hits. See the commands reference for full details.