@acarmisc/backstage-plugin-litellm 0.8.1 → 0.10.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/api.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import { FetchApi } from '@backstage/core-plugin-api';
2
- import { UserInfo, VirtualKey, ModelInfo, UsageMetrics, TeamInfo, GenerateKeyRequest, GenerateKeyResponse, UpdateKeyRequest, AuditLogsParams, PaginatedAuditLogs } from './types';
2
+ import { UserInfo, VirtualKey, ModelInfo, UsageMetrics, TeamInfo, GenerateKeyRequest, GenerateKeyResponse, UpdateKeyRequest, AuditLogsParams, PaginatedAuditLogs, LiteLlmConfig } from './types';
3
3
  export interface LiteLlmApiInterface {
4
4
  getUserInfo(): Promise<UserInfo>;
5
5
  listKeys(): Promise<VirtualKey[]>;
@@ -20,6 +20,7 @@ export interface LiteLlmApiInterface {
20
20
  getUsage(startDate: string, endDate: string): Promise<UsageMetrics>;
21
21
  getTeamUsage(teamId: string, startDate: string, endDate: string): Promise<UsageMetrics>;
22
22
  getAuditLogs(params: AuditLogsParams): Promise<PaginatedAuditLogs>;
23
+ getConfig(): Promise<LiteLlmConfig>;
23
24
  }
24
25
  export declare const liteLlmApiRef: import("@backstage/core-plugin-api").ApiRef<LiteLlmApiInterface>;
25
26
  export type ExpiryStatus = 'expired' | 'soon' | 'ok';
@@ -51,4 +52,5 @@ export declare class LiteLlmApi implements LiteLlmApiInterface {
51
52
  getTeams(): Promise<TeamInfo[]>;
52
53
  getUsage(startDate: string, endDate: string): Promise<UsageMetrics>;
53
54
  getTeamUsage(teamId: string, startDate: string, endDate: string): Promise<UsageMetrics>;
55
+ getConfig(): Promise<LiteLlmConfig>;
54
56
  }
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
- import { VirtualKey, ModelInfo, TeamInfo, GenerateKeyRequest, GenerateKeyResponse, UpdateKeyRequest } from '../types';
2
+ import { VirtualKey, ModelInfo, TeamInfo, GenerateKeyRequest, GenerateKeyResponse, UpdateKeyRequest, LiteLlmConfig } from '../types';
3
3
  interface KeysTableProps {
4
4
  keys: VirtualKey[];
5
5
  models: ModelInfo[];
@@ -15,6 +15,8 @@ interface KeysTableProps {
15
15
  onPruneExpiredKeys: () => Promise<{
16
16
  pruned: number;
17
17
  }>;
18
+ /** Resolve the public LiteLLM proxy URL, used for ready-to-paste snippets. */
19
+ onGetConfig: () => Promise<LiteLlmConfig>;
18
20
  }
19
21
  export declare const KeysTable: React.FC<KeysTableProps>;
20
22
  export {};
package/dist/format.d.ts CHANGED
@@ -1,2 +1,7 @@
1
1
  export declare const fmtUsd: (n: number) => string;
2
2
  export declare const fmtInt: (n: number) => string;
3
+ /**
4
+ * Estimate how many tokens a USD budget buys at a given per-token price.
5
+ * Returns null when the price is missing or non-positive.
6
+ */
7
+ export declare const estimateTokensFromBudget: (budget: number, pricePerToken?: number) => number | null;