Skip to content
TopicTracker
From HackerNewsView original
TranslationTranslation

Khazad – Transparent Semantic Cache for LLM API Calls via Redis Vector Sets

Khazad is an open-source semantic cache for LLM API calls using Redis Vector Sets. It reduces latency and cost by caching semantically similar queries, automatically expiring old entries. The tool offers a FastAPI middleware plugin for transparent integration.

Background

- Khazad is an open-source semantic caching tool for LLM API calls. It stores past queries and their vector embeddings in Redis, so if a new query is semantically similar enough to a cached one, the cached response is returned instead of calling the LLM again — saving cost and latency. - Semantic caching differs from exact-match caching: it catches paraphrases and semantically equivalent questions, not just identical text. - The project targets developers using paid LLM APIs (OpenAI, Anthropic, etc.) where every request costs money and adds delay. By reducing redundant calls, Khazad lowers bills and speeds up applications. - "Vector sets" refer to Redis' vector search capabilities, which allow efficient similarity search over embeddings (numeric representations of text meaning).