From 51da313e3f1a59d696c0daa2e70773cec3df33dc Mon Sep 17 00:00:00 2001 From: Kagamine Rin Date: Thu, 4 Jun 2026 21:32:58 -0400 Subject: [PATCH] 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 --- ARCHITECTURE.md | 4 +++- README.md | 1 + 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/ARCHITECTURE.md b/ARCHITECTURE.md index 9ef5517..3d4b432 100644 --- a/ARCHITECTURE.md +++ b/ARCHITECTURE.md @@ -161,7 +161,7 @@ By Date: **LiteLLM Endpoint:** `GET {litellm_url}/spend/logs` **Auth:** `Authorization: Bearer {litellm_master_key}` -**Params:** `limit` (int, 1-50, default 20), `show_cost` (bool, default true) +**Params:** `limit` (int, 1-50, default 20), `show_cost` (bool, default true), `show_failed` (bool, default true) ### Response Processing @@ -169,6 +169,8 @@ The `/spend/logs` endpoint returns **all** historical request logs (no server-si **Performance note:** For large deployments (thousands of logs), this endpoint can be slow. The tool caps `limit` at 50 and uses a 30s timeout. +**Filtering:** When `show_failed=False`, requests with `metadata.exception` or `metadata.status="failure"` are filtered out before applying the `limit`. This hides auth probe noise, routing failures, and other non-essential errors. The header shows "(failed requests hidden)" when active. + ### Per-Request Fields | Field | Description | diff --git a/README.md b/README.md index 645750e..b631265 100644 --- a/README.md +++ b/README.md @@ -16,6 +16,7 @@ Get recent LiteLLM request history. Returns the most recent N requests with mode **Parameters:** - `limit` (int, 1-50, default 20): Number of recent requests to show - `show_cost` (bool, default true): Include per-request cost +- `show_failed` (bool, default true): Include failed requests. Set false to hide auth failures, routing errors, and probe noise. **Cost awareness:** This function hits `/spend/logs` which returns all historical logs. For large deployments, this can be a heavy query. Use reasonable `limit` values.