Spaces:
Running
Running
Commit History
-
feat(ai-usage): record the paper or query each AI call was for
siddhm11 +1: Claude Opus 5.5llm_calls gains a replicated subject column: the arXiv id for plain summaries, briefings and Ask, and the search query (whitespace collapsed, at most 200 characters) for the search rewrite and overview. A call that failed or found every model busy now says which paper or search it was for. Search queries are cleared after 90 days by the next commit's housekeeping. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>600f214 -
fix(ai-usage): give a rate-limit window's age, not its raw timestamp
siddhm11 +1: Claude Opus 5.5/healthz/ai listed both the raw 'at' timestamp and age_s for each model's window: the timestamp was removed from the original after the copy was made. Seen on the live page after the first real call. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>279a374
-
feat(health): /healthz/ai shows where the AI goes today
siddhm11 +1: Claude Opus 5.5Per feature: calls, ok, fallback (a model other than the primary answered), truncated, failed, unavailable, unparsable and over-budget calls, tokens in and out, average time, and the day's counts (cache hits, outcomes, drops, reports), including counts not yet written. Per model: calls, tokens and their share of the day's 200,000-token limit, and the newest rate-limit window Groq reported. Plus the briefing budget and 14 days of history. Groq's limits per model are now config (GROQ_REQUESTS_PER_DAY, GROQ_TOKENS_PER_DAY, GROQ_TOKENS_PER_MINUTE): no header reports tokens per day, so that limit has to be known to be compared against. Counts only: never a prompt, an answer or a reader. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>359b725 -
feat(ai-usage): count cache use and answer quality per feature, per day
siddhm11 +1: Claude Opus 5.5Calls alone don't say how well the AI did. ai_daily keeps one number per UTC day, feature and metric, replicated: explain cache_hit, cache_miss, written, trimmed, declined search_rewrite skipped (already academic), rewritten, unchanged, discarded search_overview shown, trimmed, empty briefing cache_hit, cache_miss, ok, insufficient, failed, busy, points_dropped (by the number and anchor checks) ask cache_hit, cache_miss (suggested questions), answer, unanswerable, nosupport, cap, busy, error, quotes_kept, quotes_dropped, cites_dropped any feature reported (Report a problem) ai_usage.count() only adds to a dict; a loop owned by the app lifespan writes the counts every minute and on shutdown, each row rewritten whole so turso_sync pushes it, and keeps them if a write fails. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>94b838e -
feat(ai-usage): log search rewrites, search overviews and plain summaries
siddhm11 +1: Claude Opus 5.5These three call Groq directly and logged nothing: no tokens, no failures, no sign of which model answered. groq_svc._run_logged now runs each one off the event loop and writes its llm_calls row, as search_rewrite, search_overview or explain, including calls that failed or found every model benched (status unavailable). Each feature still degrades exactly as before; a search that already looks academic makes no call and logs none. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>134608d -
feat(ai-usage): log each model call's tokens, fallback and rate-limit window
siddhm11 +1: Claude Opus 5.5llm_calls held characters and a status. Each row now also has tokens in and out from Groq's usage, the answering model's place in GROQ_MODELS (0 is the primary), whether the reply hit the token cap (still status failed, which the briefing and Ask already handle), and the requests left today and tokens left this minute that Groq reported. app/ai_usage.py writes every row; app/llm.py now goes through it. The six columns replicate; turso_sync adds them to the remote table with the duplicate-tolerant ALTER (trap T8). LLM_DAILY_CALLS keeps covering only the briefing and Ask, so search calls, logged next, can't switch them off. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>037c6f0