omnicache-ai v0.2.0
What's New in v0.2.0
Bug Fixes
- FAISSBackend.delete(): switched
IndexFlatIP→IndexIDMap2— deleted vectors now actually removed (previously caused stale semantic matches) - EvictionPolicy: was exported but never used; now wired into
CacheManagerandInMemoryBackend - LangChainCacheAdapter.clear(): was a silent no-op; now calls
manager.clear()
New Features
- CacheMetrics: hit/miss/eviction/set counters +
hit_rate— access viamanager.metrics - Pluggable Serializer:
PickleSerializer(default) +JsonSerializer; all layers acceptserializer= - StampedeShield: per-key lock in
ResponseCache.get_or_generate()— prevents duplicate LLM calls under concurrency - TieredBackend: L1 memory + L2 Redis/disk with automatic promotion on read
- AsyncCacheBackend + AsyncInMemoryBackend: native async backends for FastAPI / async LangGraph
- OpenAICacheAdapter: wraps
client.chat.completions.create(sync + async) - AnthropicCacheAdapter: wraps
client.messages.create(sync + async) - GzipCompressor: optional compression wired into
CacheManager - StreamingResponseCache: buffers streaming LLM output, replays from cache as generator
- CLI:
python -m omnicache_ai stats|flush|inspect <key> - pre-commit: ruff + mypy + file checks on every commit
- Dockerfile: slim Python 3.12 image
Install
pip install omnicache-ai==0.2.0See CHANGELOG for full details.