LMCache is an extension layer for LLM serving engines that accelerates inference, especially with long contexts, by storing and reusing key-value (KV) attention caches across requests. Instead of rebuilding KV states for repeated or shared text segments, LMCache persists and retrieves them from multiple tiers—GPU memory, CPU DRAM, and local disk—then injects them into subsequent requests to reduce TTFT and increase throughput. Its design supports reuse beyond strict prefix matching and enables sharing across serving instances, improving efficiency under real multi-tenant traffic. The broader project includes examples, tests, a server component, and public posts describing cross-engine sharing and inter-GPU KV transfers. These capabilities aim to lower latency, cut GPU cycles, and stabilize performance for production workloads with overlapping prompts or retrieval-augmented contexts. The end result is a cache fabric for LLMs that complements engines rather than replacing them.

Features

  • KV cache reuse across queries to cut TTFT and boost throughput
  • Multi-tier storage across GPU, CPU, and local disk
  • Cross-engine sharing for interoperability between serving stacks
  • Non-prefix reuse to exploit any overlapping text segments
  • Inter-GPU KV transfer for advanced pipeline/disaggregated setups
  • Example suites, tests, and a server to ease integration

Project Samples

Project Activity

See All Activity >

License

Apache License V2.0

Follow LMCache

LMCache Web Site

You Might Also Like
Gen AI apps are built with MongoDB Atlas Icon
Gen AI apps are built with MongoDB Atlas

Build gen AI apps with an all-in-one modern database: MongoDB Atlas

MongoDB Atlas provides built-in vector search and a flexible document model so developers can build, scale, and run gen AI apps without stitching together multiple databases. From LLM integration to semantic search, Atlas simplifies your AI architecture—and it’s free to get started.
Start Free
Rate This Project
Login To Rate This Project

User Reviews

Be the first to post a review of LMCache!

Additional Project Details

Operating Systems

Linux

Programming Language

Python

Related Categories

Python Artificial Intelligence Software

Registered

2025-10-08