Llama Proxy Cache (such as llama-proxy-cache / lpcache) is an OpenAI-compatible proxy that sits between chat or IDE clients and one or more llama.cpp (llama-server) backends to manage slot Key-Value (KV) caches and avoid full prompt re-prefill costs on long or repeating prompts.
Features
- OpenAI API Compatibility: It speaks the /v1/chat/completions API so your apps, agents, or frontends (like Open WebUI or custom scripts) can connect to it transparently.
- KV-Cache & Slot Management: It tracks and manages llama.cpp's slot Key-Value (KV) caches. When handling long, repeating, or similar system prompts (30k–60k+ tokens), it avoids paying the full re-prefill cost on every single turn.
- Prefix-Similarity Routing & Lookup: It inspects incoming prompts, checks for common prefixes (Longest Common Prefix / LCP lookups or hash matching), and coordinates slot locking, saving, and restoring (often interacting with llama.cpp's built-in slot/state APIs or disk-based cache mechanisms).
- Multi-Backend Coordination: If you run multiple llama.cpp instances, a proxy helps prevent sessions from losing their cached context when bouncing between different server nodes.
License
MIT LicenseFollow llama-proxy-cache
Other Useful Business Software
Our Free Plans just got better! | Auth0
You asked, we delivered! Auth0 is excited to expand our Free and Paid plans to include more options so you can focus on building, deploying, and scaling applications without having to worry about your security. Auth0 now, thank yourself later.
Rate This Project
Login To Rate This Project
User Reviews
Be the first to post a review of llama-proxy-cache!