---
name: bijection-llm-cache
description: "Evaluate and integrate the Llm Cache component with Bijection."
---

# Llm Cache

LLM request/response caching with tiered TTL, time travel, and request normalization for Bijection.

- Package: @bijectionhq/llm-cache
- Category: AI & Agents
- Status: Reference
- License: Apache-2.0
- Bijection source (repository access required): https://github.com/bijectionhq/llm-cache/tree/b764f9330cc8d400c55752bad509505ebe56e24a
- Upstream: https://github.com/raymond-UI/llm-cache/tree/981f8f58cfad6541651236e7d8319c64da457668
- Documentation: https://docs.bijection.com/components/using
- Directory: https://bijection.com/components/llm-cache

## Get the source

Bijection repository access is required. Request access at https://bijection.com/contact.

```sh
git clone https://github.com/bijectionhq/llm-cache.git
cd llm-cache
git checkout b764f9330cc8d400c55752bad509505ebe56e24a
```

## Before using this component

Read the package README at the recorded revision for setup, dependencies, and API examples. Upstream documentation describes the original package and may differ from the Bijection adaptation. This is a source candidate for evaluation. Catalog inclusion does not establish npm availability or runtime qualification. Check compatibility with your SDK and deployment before adoption. External providers run their own compute.

## Integration workflow

1. Read the source README and package manifest at the recorded revision.
2. Confirm the required SDK, dependency availability, and runtime compatibility.
3. Follow the component's documented setup and configuration. Never invent an npm install command from a catalog package name.
4. Keep credentials in the project's existing secret store.
5. Follow the project's execution rules for verification and report what was actually checked.

## Original upstream skill

The following guidance describes @mzedstudio/llm-cache. Its installation commands and APIs refer to the upstream package. Evaluate compatibility with the Bijection source separately.


# @mzedstudio/llm-cache

## Instructions

Use @mzedstudio/llm-cache to cache llm api requests and responses in convex with tiered ttl, time travel debugging, and request normalization to reduce costs and latency. This Convex component integrates directly with your backend.

### Installation

```bash
npm install @mzedstudio/llm-cache
```

### Capabilities

- Reduce LLM API costs by caching identical or similar requests with intelligent normalization
- Improve application performance with configurable TTL caching layers for fast response times
- Debug LLM interactions using time travel features to inspect cached request/response pairs
- Scale LLM-powered features without hitting rate limits through efficient cache management

## Examples

### how to cache OpenAI API responses in Convex

The @mzedstudio/llm-cache component provides built-in caching for LLM API responses in your Convex backend. It automatically stores request/response pairs with configurable TTL and handles cache invalidation, reducing redundant API calls to OpenAI or other LLM providers.

### reduce LLM API costs with request caching

This component implements intelligent request normalization and tiered caching to minimize duplicate LLM API calls. It can identify similar requests and serve cached responses, significantly reducing your API usage costs while maintaining response quality.

### debug LLM requests with time travel

The time travel feature lets you inspect historical LLM request/response pairs stored in your Convex database. This enables debugging of LLM interactions, A/B testing different prompts, and analyzing response patterns over time.

## When NOT to use

- When a simpler built-in solution exists for your specific use case
- If you are not using Convex as your backend
- When the functionality provided by @mzedstudio/llm-cache is not needed

## Troubleshooting

**How does request normalization work in LLM caching?**

The @mzedstudio/llm-cache component normalizes LLM requests by standardizing parameters like whitespace, capitalization, and prompt formatting before checking the cache. This ensures that functionally identical requests hit the cache even with minor formatting differences, maximizing cache efficiency.

**What is tiered TTL in LLM caching?**

Tiered TTL allows you to set different expiration times for different types of cached LLM responses. For example, you might cache static prompt responses for 24 hours but dynamic user-specific responses for only 1 hour, optimizing both performance and data freshness.

**Can I use this component with any LLM provider?**

Yes, @mzedstudio/llm-cache is provider-agnostic and works with OpenAI, Anthropic, Google, or any other LLM API. It caches the request/response data structure regardless of the underlying LLM service, making it flexible for multi-provider setups.

**How does time travel debugging work for LLM requests?**

The time travel feature stores all cached LLM interactions with timestamps in your Convex database. You can query historical request/response pairs, replay specific interactions, and analyze how your LLM responses have changed over time, making it easier to debug and optimize prompts.

## Resources

- [npm package](https://www.npmjs.com/package/%40mzedstudio%2Fllm-cache)
- [GitHub repository](https://github.com/raymond-UI/llm-cache)
- [Live demo](https://prompt-workbench-tau.vercel.app/)
- [Convex Components Directory](https://www.convex.dev/components/mzedstudio/llm-cache)
- [Convex documentation](https://docs.convex.dev)