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
This commit is contained in:
1 parent
7ab17e03d7
commit
091d44ab87
3 files changed
+10
-8
No files matched your search
+6
-4
@@ -93,7 +93,7 @@ Healthy: 8 | Unhealthy: 0
|
||||
|
||||
**LiteLLM Endpoint:** `GET {litellm_url}/user/daily/activity`
|
||||
**Auth:** `Authorization: Bearer {litellm_master_key}`
|
||||
**Params:** `start_date` (YYYY-MM-DD or natural language shortcut), `end_date` (YYYY-MM-DD or natural language shortcut), `hide_zero_spend` (bool, default False)
|
||||
**Params:** `start_date` (YYYY-MM-DD or natural language shortcut), `end_date` (YYYY-MM-DD or natural language shortcut), `show_zero_spend` (bool, default False)
|
||||
|
||||
### Natural Language Date Resolution
|
||||
|
||||
@@ -109,9 +109,11 @@ The `_resolve_date()` helper converts natural language shortcuts to YYYY-MM-DD b
|
||||
|
||||
Already-formatted YYYY-MM-DD strings pass through unchanged. Unrecognized strings are passed to the API, which will reject them with a clear error.
|
||||
|
||||
### hide_zero_spend Parameter
|
||||
### show_zero_spend Parameter
|
||||
|
||||
When `hide_zero_spend=True`, models with sub-$0.001 spend are filtered from the per-model breakdown. This is useful when free-tier or subscription models (e.g., Ollama Cloud) dominate the report with high token counts but negligible cost. Hidden models are summarized as `... (N model(s) with sub-$0.001 spend hidden)`.
|
||||
When `show_zero_spend=False` (the default), models with sub-$0.001 spend are hidden from the per-model breakdown and summarized as `... (N model(s) with sub-$0.001 spend hidden)`. This is the recommended default because free-tier or subscription models (e.g., Ollama Cloud) often dominate the report with high token counts but negligible cost, drowning out the models that actually cost money.
|
||||
|
||||
Set `show_zero_spend=True` to see all models, including those with zero or near-zero spend.
|
||||
|
||||
### Response Processing
|
||||
|
||||
@@ -256,7 +258,7 @@ These are documented but not in scope for v1. The two-function design is the rig
|
||||
|
||||
### v1.2.0 (2026-06-13)
|
||||
- **feat:** Natural language date shortcuts for `litellm_cost()` — `today`, `yesterday`, `monday`, `last week`, etc.
|
||||
- **feat:** `hide_zero_spend` parameter for `litellm_cost()` — filters sub-$0.001 models from breakdown
|
||||
- **feat:** `show_zero_spend` parameter for `litellm_cost()` — default False hides sub-$0.001 models with summary line
|
||||
- **fix:** Cost report header shows resolved YYYY-MM-DD dates instead of raw shortcuts
|
||||
|
||||
### v1.1.0 (2026-06-13)
|
||||
|
||||
Reference in new issue
Block a user