After setting up your caching DB, you are ready to start caching your queries. Depending on what client you are using, the process is the same.

Optimodel

Prerequisite Please see here to learn more about how to use Optimodel with Lytix.

To set a TTL for your query, just pass the extra cacheTTL parameter. This is a value in seconds

OpenAI Client

Prerequisite Please see here to learn more about how to use OpenAI with Lytix.

While using the OpenAI client, you can pass an extra cacheTTL header when making your request. This is a value in seconds.

Viewing Cache Hits

You can view the cache hits on the Lytix dashboard here

title