@acarmisc/backstage-plugin-litellm-backend 0.12.0 → 0.14.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/types.d.ts CHANGED
@@ -34,6 +34,16 @@ export interface TeamInfo {
34
34
  /** Spend-reset period for max_budget, e.g. "30d". */
35
35
  budget_duration?: string;
36
36
  spend: number;
37
+ /**
38
+ * Share of max_budget consumed (0-100), present only on redacted records.
39
+ * Set by the backend when litellm.display.hideTeamBudgetFor* is enabled so
40
+ * clients can render the consumption level without dollar amounts.
41
+ */
42
+ budget_pct?: number;
43
+ /** ok | near (>=80%) | over (>=100%), present only on redacted records. */
44
+ budget_status?: 'ok' | 'near' | 'over';
45
+ /** True when max_budget/spend were stripped by budget hiding. */
46
+ budget_hidden?: boolean;
37
47
  members_with_roles?: TeamMember[];
38
48
  models?: string[];
39
49
  tpm_limit?: number;
@@ -273,6 +283,42 @@ export interface PaginatedAuditLogs {
273
283
  page_size: number;
274
284
  total_pages: number;
275
285
  }
286
+ /** One row from LiteLLM's `/spend/logs` (per-request spend log entry). */
287
+ export interface SpendLogEntry {
288
+ request_id?: string;
289
+ /** ISO timestamp of the call. */
290
+ startTime?: string;
291
+ endTime?: string;
292
+ spend?: number;
293
+ total_tokens?: number;
294
+ prompt_tokens?: number;
295
+ completion_tokens?: number;
296
+ model?: string;
297
+ /** Virtual key alias or hash the request was billed to. */
298
+ api_key?: string;
299
+ user?: string;
300
+ team_id?: string;
301
+ /**
302
+ * Tags attached to the request (e.g. `channel:backstage`,
303
+ * `session:<thread>`, `invoked-by:<user>`). Shape varies across LiteLLM
304
+ * versions (array or object) and is normalised to a string[].
305
+ */
306
+ request_tags?: string[] | Record<string, string>;
307
+ /** LiteLLM `metadata` blob; carries trace ids and session grouping. */
308
+ metadata?: Record<string, unknown> | string | null;
309
+ }
310
+ export interface SpendLogsParams {
311
+ /** ISO date `YYYY-MM-DD` (inclusive). */
312
+ start_date: string;
313
+ /** ISO date `YYYY-MM-DD` (inclusive). */
314
+ end_date: string;
315
+ /** Restrict to the given virtual key. */
316
+ api_key?: string;
317
+ user_id?: string;
318
+ team_id?: string;
319
+ /** Max rows to return (LiteLLM caps at 1000 per page). */
320
+ page_size?: number;
321
+ }
276
322
  export interface AuditLogsParams {
277
323
  page?: number;
278
324
  page_size?: number;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@acarmisc/backstage-plugin-litellm-backend",
3
- "version": "0.12.0",
3
+ "version": "0.14.0",
4
4
  "description": "The Backstage backend plugin for LiteLLM governance",
5
5
  "backstage": {
6
6
  "role": "backend-plugin",