feat: add local model gateway and console tabs

This commit is contained in:
lofyer
2026-10-12 14:21:13 +08:00
parent 9fa8f3e762
commit ec2c90d208
46 changed files with 3491 additions and 1120 deletions
+56
View File
@@ -0,0 +1,56 @@
export type GatewayUpstreamInput = {
name: string
baseUrl: string
protocol: 'openai-chat-completions'
authentication: 'api-key' | 'none'
enabled: boolean
credentialAction: 'keep' | 'replace' | 'clear'
apiKey?: string
}
export type GatewayUpstream = Omit<GatewayUpstreamInput, 'credentialAction' | 'apiKey'> & {
id: string
credentialConfigured: boolean
}
export type GatewayModelInput = {
alias: string
upstreamId: string
remoteModel: string
enabled: boolean
displayName?: string
}
export type GatewayModel = GatewayModelInput & { id: string }
export type GatewayAccessKey = {
id: string
name: string
modelIds: string[]
createdAt: string
revokedAt: string | null
}
export type GatewayAccessKeyInput = { name: string; modelIds: string[] }
export type GatewayAccessKeyCreated = { accessKey: GatewayAccessKey; key: string }
export type GatewayAudit = {
id: string
time: string
model: string
upstreamId: string | null
accessKeyId: string | null
stream: boolean
status: 'success' | 'failed' | 'cancelled'
httpStatus: number
durationMs: number
inputTokens: number | null
outputTokens: number | null
errorCode: string | null
}
export type GatewaySnapshot = {
upstreams: GatewayUpstream[]
models: GatewayModel[]
audits: GatewayAudit[]
gatewayBaseUrl: string | null
}