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

The database for AI-powered applications.

MongoDB Atlas is the developer-friendly database used to build, scale, and run gen AI and LLM-powered apps—without needing a separate vector database. Atlas offers built-in vector search, global availability across 115+ regions, and flexible document modeling. Start building AI apps faster, all in one place.
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