Commit Graph
22 Commits
Author SHA1 Message Date
rin.kagamine f42a3247dc feat: Implement Cost Verification & Audit Engine (TASK-004) v1.3.2 2026-06-26 21:16:23 -04:00
captcouch 2bd50db173 Update README.md 2026-06-21 10:58:50 -04:00
rin.kagamine 34b64331bb feat: use IANA timezone names instead of numeric offset 2026-06-14 13:52:51 -04:00
rin.kagamine 1a6e06c2bd fix: add timezone_offset valve for local date resolution 2026-06-14 13:51:45 -04:00
rin.kagamine 097a29eaee feat: two-level zero-spend filtering with valve default
Adds default_hide_zero_spend valve (default True) that controls whether
models with sub-bash.001 spend are hidden by default. The per-call
hide_zero_spend parameter can explicitly override:

- hide_zero_spend=True → ALWAYS hide (explicit override)
- hide_zero_spend=False → use valve default (default_hide_zero_spend)

This defensive design prevents SLMs from accidentally exposing zero-spend
models unless the human has explicitly set default_hide_zero_spend=False.

- Added default_hide_zero_spend valve to Valves class
- Updated litellm_cost() with two-level logic
- Updated README and ARCHITECTURE.md with two-level design docs
- Reverted parameter name back to hide_zero_spend
2026-06-13 16:53:37 -04:00
rin.kagamine 091d44ab87 refactor: invert hide_zero_spend → show_zero_spend, default False
Changes the API from opt-in hiding (hide_zero_spend) to opt-in showing
(show_zero_spend). Default behavior now hides sub-bash.001 models and
shows the summary line — cleaner for the common case where free-tier
models dominate the breakdown.

- Renamed parameter: hide_zero_spend → show_zero_spend
- Inverted logic: default False means hide by default
- Updated docstrings, README, ARCHITECTURE.md
2026-06-13 16:48:13 -04:00
rin.kagamine 7ab17e03d7 docs: update ARCHITECTURE.md and README.md for v1.2.0
- ARCHITECTURE.md: Added natural language date resolution section,
  hide_zero_spend parameter docs, updated example output, changelog
- README.md: Added changelog section with v1.2.0 and v1.1.0 entries
- Updated version metadata and creation date
2026-06-13 16:46:21 -04:00
rin.kagamine d31a5cbbe3 fix: show resolved dates in cost report header
Previously showed raw input like "yesterday to today".
Now shows the resolved YYYY-MM-DD dates for clarity.
2026-06-13 16:43:56 -04:00
rin.kagamine 0fd8fcb742 feat: natural language date shortcuts for litellm_cost()
Adds _resolve_date() helper that converts natural language shortcuts
into YYYY-MM-DD before calling the LiteLLM API.

Supported shortcuts:
- today, yesterday, tomorrow
- N days ago (e.g. "two days ago")
- monday-sunday (most recent occurrence)
- last monday-last sunday
- this week, last week
- this month, last month

Falls back to passthrough for already-formatted YYYY-MM-DD strings.

Updated README with new parameter documentation.
2026-06-13 16:42:39 -04:00
rin.kagamine 67f79cfabe fix: hide_zero_spend now filters models with sub-$0.001 spend
Previously filtered only exact $0.00, which left models with tiny
fractional spend (e.g. $0.0001) visible. Now hides anything below
$0.001 threshold — statistically insignificant noise.

- Changed comparison from == 0 to < 0.001
- Updated docstring and summary text
- Updated README parameter description
2026-06-13 16:25:15 -04:00
rin.kagamine 6adcd79c1a feat: add hide_zero_spend parameter to litellm_cost()
Adds optional hide_zero_spend parameter (default False) to filter out
models with bash.00 spend from the per-model breakdown. Useful when
free-tier or subscription models (e.g. Ollama Cloud) dominate the
breakdown with high token counts but zero cost.

- Updated litellm_cost() signature with hide_zero_spend parameter
- Added filtering logic in model line builder
- Added hidden model count summary line
- Updated README with parameter documentation
- Bumped version to 1.2.0
2026-06-13 16:21:49 -04:00
rin.kagamine 51da313e3f docs: update README and ARCHITECTURE for show_failed parameter
- README: add show_failed to litellm_history params
- ARCHITECTURE: update params line and add Filtering section explaining
  show_failed=False behavior and header indicator
2026-06-04 21:32:58 -04:00
rin.kagamine 8a8be608a0 feat: add show_failed parameter to litellm_history (default true)
When show_failed=False, filters out requests with metadata.exception
or metadata.status='failure' before applying the limit. Useful for
hiding auth probe noise and routing failures. Header shows
'(failed requests hidden)' when active.
2026-06-04 21:31:53 -04:00
rin.kagamine abc3b7b191 fix: surface error_information.error_message for failed requests without exception string
Entry 3 had metadata.status='failure' and no exception, but DID have
error_information.error_message='No api key passed in.' Now we surface
that actual error message instead of the generic 'status: failure'.
Priority: exception > error_message > generic status.
2026-06-04 21:28:09 -04:00
rin.kagamine 71e4210386 fix: detect status: failure in addition to exception for request history
Entry 3 in our logs had metadata.status='failure' but no exception string,
so it was incorrectly shown as ✅ OK. Now checks both exception AND
metadata.status == 'failure'. Also updates failed count in summary.
2026-06-04 21:26:35 -04:00
rin.kagamine 8d90c0c277 docs: update README and ARCHITECTURE for v1.1.0 — litellm_history function
- README: three functions, litellm_history params and cost awareness note
- ARCHITECTURE: full Function 3 section with endpoint, fields, output format,
  token display rules, error paths, and performance considerations
2026-06-04 21:24:41 -04:00
rin.kagamine fd449079be feat: add litellm_history — recent request history with model, cost, tokens, duration, cache hits
New function litellm_history(limit=20, show_cost=True) hits /spend/logs,
sorts by startTime descending, and shows the most recent N requests with:
- Model name (stripped of provider prefix)
- Call type (chat/embed/image)
- Status (✅/❌ based on exception)
- Duration
- Token counts (prompt→completion, compact format)
- Cache hit percentage (💾 indicator)
- Per-request cost (optional)

Limit capped at 50. Bumps version to 1.1.0.
2026-06-04 21:17:35 -04:00
rin.kagamine 4dd10fab80 docs: add ARCHITECTURE.md from Palace doc, cross-reference from README 2026-06-04 19:03:00 -04:00
rin.kagamine 3d4230ccb4 Replace hardcoded model name abbreviations with dynamic truncation
- Strip common provider prefixes (gemini/, openai/, anthropic/, mistral/, cohere/)
- Truncate names > 24 chars with ellipsis (…) instead of hardcoded abbreviations
- Works generically for any LiteLLM model, not just our Gemini config
2026-06-04 17:08:51 -04:00
rin.kagamine c92dd9cf20 Add MIT license, abbreviate long model names in cost table
- 3.1-pro-preview-customtools → 3.1-pro-ct
- 3.1-flash-image-preview → 3.1-flash-img
- 3.1-flash-lite-preview → 3.1-flash-lite
- 3-flash-preview → 3-flash-prev
- Narrowed model column from 30 to 20 chars
2026-06-04 16:17:37 -04:00
rin.kagamine d642df3e03 Add .gitignore, remove pycache from tracking 2026-06-04 15:47:35 -04:00
rin.kagamine 98a1b3c546 LiteLLM Dashboard Tool v1.0.0 — two-function OWI Tool
- litellm_health: proxy health + auth check (strips litellm_metadata)
- litellm_cost: cost breakdown by date range (per-model, per-day, cache hit rate)
- Valves: litellm_url, litellm_master_key (password field, no hardcoded keys)
- Tested against mon-rin1:4000 Gemini proxy — all green
- Error handling: auth failure, connection failure, timeout
- Architecture doc: Memory Palace KB #596
2026-06-04 15:47:29 -04:00