lmcache is a Python library that provides an LLM serving engine extension. It aims to reduce Time To First Token (TTFT) and increase throughput, particularly in scenarios involving long contexts. The current version is 0.4.3, and it appears to have an active development cadence.
pip install lmcacheVerified import paths — ran on the pinned version, not inferred.
This quickstart demonstrates how to use the lmcache client to interact with a running lmcache server. It sends a chat completion request similar to the OpenAI API. Please ensure that an lmcache server is running independently before executing this client code.
Update client code to use `lmcache.client.Client` and schema objects like `ChatCompletionRequest` from `lmcache.schemas`. Replace old methods like `complete` with `chat_completion`.
Ensure the lmcache server (e.g., via `lmcache serve`) is running and accessible at the host and port specified by the client. Check network configurations if running remotely.
Allocate sufficient GPU memory and CPU resources. Consult lmcache documentation for hardware recommendations and model-specific resource requirements.
Verify the model name and configuration on the lmcache server. Ensure required model weights are available to the server and that the client requests a compatible model.