feat: semantic (embedding-based) response cache

- cache.rs: cosine-similarity store (threshold, TTL, ring buffer), partitioned by
  routing signature; tracks hit rate and model cost saved
- pipeline: embed routing text, look up before the model call (route_source=cache on
  hit), insert successful responses; stats record cache hits
- config [cache] + admin settings card; dashboard shows hit-rate and savings
- embedding model resolved from the pool (or first kind="embedding")

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
infosave2007
2026-06-30 17:04:53 +03:00
co-authored by Claude Opus 4.8
parent 7dbc39c6a6
commit a67564bc24
17 changed files with 492 additions and 5 deletions
+1
View File
@@ -9,6 +9,7 @@
#![allow(dead_code)]
mod admin;
mod cache;
mod config;
mod error;
mod model;