@acarmisc/backstage-plugin-litellm 0.1.0 → 0.1.1

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 ADDED
@@ -0,0 +1,29 @@
1
+ import { FetchApi } from '@backstage/core-plugin-api';
2
+ import { UserInfo, VirtualKey, ModelInfo, UsageMetrics, GenerateKeyRequest, GenerateKeyResponse } from './types';
3
+ export interface LiteLlmApiInterface {
4
+ getUserInfo(userId?: string): Promise<UserInfo>;
5
+ listKeys(userId?: string): Promise<VirtualKey[]>;
6
+ generateKey(request: GenerateKeyRequest): Promise<GenerateKeyResponse>;
7
+ deleteKey(keyId: string): Promise<{
8
+ success: boolean;
9
+ }>;
10
+ listModels(): Promise<ModelInfo[]>;
11
+ getUsage(startDate: string, endDate: string, userId?: string): Promise<UsageMetrics>;
12
+ }
13
+ export declare const liteLlmApiRef: import("@backstage/core-plugin-api").ApiRef<LiteLlmApiInterface>;
14
+ export declare class LiteLlmApi implements LiteLlmApiInterface {
15
+ private fetchApi;
16
+ private basePath;
17
+ constructor(fetchApi: FetchApi, basePath?: string);
18
+ private get;
19
+ private post;
20
+ private del;
21
+ getUserInfo(userId?: string): Promise<UserInfo>;
22
+ listKeys(userId?: string): Promise<VirtualKey[]>;
23
+ generateKey(request: GenerateKeyRequest): Promise<GenerateKeyResponse>;
24
+ deleteKey(keyId: string): Promise<{
25
+ success: boolean;
26
+ }>;
27
+ listModels(): Promise<ModelInfo[]>;
28
+ getUsage(startDate: string, endDate: string, userId?: string): Promise<UsageMetrics>;
29
+ }
@@ -0,0 +1,8 @@
1
+ import React from 'react';
2
+ import { UserInfo } from '../types';
3
+ interface DashboardHeaderProps {
4
+ userInfo: UserInfo | null;
5
+ loading: boolean;
6
+ }
7
+ export declare const DashboardHeader: React.FC<DashboardHeaderProps>;
8
+ export {};
@@ -0,0 +1,11 @@
1
+ import React from 'react';
2
+ import { VirtualKey, ModelInfo, GenerateKeyRequest, GenerateKeyResponse } from '../types';
3
+ interface KeysTableProps {
4
+ keys: VirtualKey[];
5
+ models: ModelInfo[];
6
+ loading: boolean;
7
+ onGenerateKey: (request: GenerateKeyRequest) => Promise<GenerateKeyResponse>;
8
+ onDeleteKey: (keyId: string) => Promise<void>;
9
+ }
10
+ export declare const KeysTable: React.FC<KeysTableProps>;
11
+ export {};
@@ -0,0 +1,2 @@
1
+ import React from 'react';
2
+ export declare const LiteLLMPage: React.FC;
@@ -0,0 +1,11 @@
1
+ import React from 'react';
2
+ import { DateRange, UsageMetrics, ModelInfo } from '../types';
3
+ interface UsageStatsProps {
4
+ usage: UsageMetrics | null;
5
+ models: ModelInfo[];
6
+ dateRange: DateRange;
7
+ onDateRangeChange: (range: DateRange) => void;
8
+ loading: boolean;
9
+ }
10
+ export declare const UsageStats: React.FC<UsageStatsProps>;
11
+ export {};
@@ -0,0 +1,8 @@
1
+ export { litellmPlugin } from './plugin';
2
+ export { LiteLLMPage } from './components/LiteLLMPage';
3
+ export { DashboardHeader } from './components/DashboardHeader';
4
+ export { KeysTable } from './components/KeysTable';
5
+ export { UsageStats } from './components/UsageStats';
6
+ export { LiteLlmApi, liteLlmApiRef } from './api';
7
+ export type { LiteLlmApiInterface } from './api';
8
+ export * from './types';