Spaces:
Paused
Paused
Commit History
-
Retry bypasses the cache; only the final chosen version gets cached
G Rohit Sudarsen +1: Claude Sonnet 5Direct request: override the cache only for retries, and don't store anything until the user settles on a final version. Real bug this also fixes: retry previously called the same /predict path, which does a cache lookup BEFORE generating - retrying a cache-eligible question just returned the exact same cached answer again, making "Retry" silently a no-op for anything already cached. - main.py: AskRequest gains bypass_cache (set by the frontend's Retry). Gates both the lookup (force a fresh generation) and the automatic post-generation store (a retry attempt never auto-caches itself). AskResponse gains cache_eligible, computed the same way regardless of bypass_cache, so the frontend can tell a genuinely ineligible turn (smalltalk, doc-scoped) apart from one that's merely bypassing once. - cache.py: new cache_replace() - drops any existing entry for the exact question first (RedisVL's store() has no confirmed dedup-on- identical-prompt behaviour, checked directly against…3349053
-
Admin: fix cramped UI layout, make Policies genuinely editable
G Rohit Sudarsen +1: Claude Sonnet 5UI fix (the reported "bad UI"): Models/Policies rows used flex:1 on the label with no width cap on the card, so each row stretched across the full page width with a huge dead gap before the value. Replaced with a settings-panel layout capped at 620px (.admin-panel), tighter row/section spacing, and a real "Custom" badge for overridden values. Configurability (the "add something so it could be configured" ask): Policies are now genuinely live-editable, not just displayed - Grounding gate, daily token budget, context overflow limit, frontier benchmark rates, and the cache similarity threshold each get a real number input + Save + Reset-to-default. - db.py: new admin_config table (key/value overrides) + get_config/ set_config/delete_config. - main.py: new get_config(key) reads a real Postgres override first, falls back to the env-derived default - checked live per request, no caching, so a change takes effect on the very next request with no restart. Every call site that used to…d0af89d -
Add real self-hosted Redis semantic cache (RedisVL + Redis Stack), replacing the Postgres one
G Rohit Sudarsen +1: Claude Sonnet 5Chose self-hosted over Redis Cloud / Redis LangCache (a real, current, fully-managed REST product - confirmed live via redis.io, not assumed stale) after weighing it directly with the user: LangCache would send every cached question/answer (real Computacenter financial content) to an external managed service, is still public preview, and won't stay free. Self-hosted Redis Stack inside this same container gets the same real technical benefit (a real vector index instead of db.py's old linear cosine-similarity scan over the last 200 Postgres rows) without any of those three tradeoffs - at the real cost of the cache no longer surviving a container restart (same tradeoff main.py's own in-memory daily-usage tracker already accepts). - Dockerfile: installs redis-stack-server via Redis's own documented apt-repo steps (root, before the non-root `user` switch - apt-get needs root). CMD now runs start.sh instead of uvicorn directly. - start.sh (new): starts Redis Stack in the background, wa…706f331