{
  "schema_version": 2,
  "id": "operate/iris/langcache",
  "title": "Semantic caching with LangCache on Redis Cloud",
  "url": "https://redis.io/docs/latest/operate/iris/langcache/",
  "summary": "Store LLM responses for AI applications in Redis Cloud.",
  "aliases": [
    "/operate/rc/langcache"
  ],
  "tags": [
    "docs",
    "operate",
    "iris"
  ],
  "last_updated": "2026-10-02T17:27:32-07:00",
  "children": [
    {
      "id": "operate/iris/langcache/create-service",
      "summary": "",
      "title": "Create a LangCache service",
      "url": "https://redis.io/docs/latest/operate/iris/langcache/create-service/"
    },
    {
      "id": "operate/iris/langcache/use-langcache",
      "summary": "",
      "title": "Use the LangCache API on Redis Cloud",
      "url": "https://redis.io/docs/latest/operate/iris/langcache/use-langcache/"
    },
    {
      "id": "operate/iris/langcache/view-edit-cache",
      "summary": "",
      "title": "View and edit LangCache service",
      "url": "https://redis.io/docs/latest/operate/iris/langcache/view-edit-cache/"
    },
    {
      "id": "operate/iris/langcache/monitor-cache",
      "summary": "",
      "title": "Monitor a LangCache service",
      "url": "https://redis.io/docs/latest/operate/iris/langcache/monitor-cache/"
    },
    {
      "id": "operate/iris/langcache/self-managed",
      "summary": "Deploy, configure, secure, and operate LangCache on a self-managed Kubernetes cluster.",
      "title": "Self-managed LangCache",
      "url": "https://redis.io/docs/latest/operate/iris/langcache/self-managed/"
    }
  ],
  "page_type": "content",
  "content_hash": "bd72e2096848f33bac22c6e185a403d3504e0e67a2215d11590ebe6469d94499",
  "sections": [
    {
      "id": "overview",
      "title": "Overview",
      "role": "overview",
      "text": "LangCache is a semantic caching service available as a REST API that stores LLM responses for fast and cheaper retrieval, built on the Redis vector database. By using semantic caching, you can significantly reduce API costs and lower the average latency of your generative AI applications.\n\n![The LangCache page in the Redis Cloud console, with Quick create and Create custom service options.](https://redis.io/docs/latest/images/rc/langcache-get-started.png)\n\nFor more information about how LangCache works, see the [LangCache overview](https://redis.io/docs/latest/develop/ai/context-engine/langcache)."
    },
    {
      "id": "get-started-with-langcache-on-redis-cloud",
      "title": "Get started with LangCache on Redis Cloud",
      "role": "content",
      "text": "To set up LangCache on Redis Cloud:\n\n1. [Create a database](https://redis.io/docs/latest/operate/rc/databases/create-database) on Redis Cloud.\n2. [Create a LangCache service](https://redis.io/docs/latest/operate/iris/langcache/create-service) for your database on Redis Cloud.\n3. [Use the LangCache API](https://redis.io/docs/latest/operate/iris/langcache/use-langcache) from your client app.\n\nAfter you set up LangCache, you can [view and edit the cache](https://redis.io/docs/latest/operate/iris/langcache/view-edit-cache) and [monitor the cache's performance](https://redis.io/docs/latest/operate/iris/langcache/monitor-cache).\n\nSee also our [Redis LangCache setup](https://www.youtube.com/watch?v=UOGhMZlZLko)\ntutorial video for advice on how to get started."
    },
    {
      "id": "get-started-with-self-managed-langcache",
      "title": "Get started with self-managed LangCache",
      "role": "content",
      "text": "To deploy LangCache on your own Kubernetes infrastructure instead of Redis Cloud, see [self-managed LangCache](https://redis.io/docs/latest/operate/iris/langcache/self-managed)."
    },
    {
      "id": "llm-cost-reduction-with-langcache",
      "title": "LLM cost reduction with LangCache",
      "role": "content",
      "text": "LangCache reduces your LLM costs by caching responses and avoiding repeated API calls. When a response is served from cache, you don’t pay for output tokens. Input token costs are typically offset by embedding and storage costs.\n\nFor every cached response, you'll save the output token cost. To calculate your monthly savings with LangCache, you can use the following formula:\n\n[code example]\n\nThe more requests you serve from LangCache, the more you save, because you’re not paying to regenerate the output.\n\nHere’s an example:\n- Monthly LLM spend: $200\n- Percentage of output tokens in your spend: 60%\n- Cost of output tokens: $200 × 60% = $120\n- Cache hit rate: 50%\n- Estimated savings: $120 × 50% = $60/month\n\n> [!NOTE]\n> The formula and numbers above provide a rough estimate of your monthly savings. Actual savings will vary depending on your usage.\n\nYou can also use the [LangCache savings calculator](https://redis.io/calculator/langcache/) to estimate your annual savings with LangCache."
    }
  ],
  "examples": [
    {
      "id": "llm-cost-reduction-with-langcache-ex0",
      "language": "bash",
      "code": "Est. monthly savings with LangCache = \n    (Monthly output token costs) × (Cache hit rate)",
      "section_id": "llm-cost-reduction-with-langcache"
    }
  ]
}
