Implement ConfigContext for instance defaults

This commit is contained in:
2025-11-14 19:24:18 +01:00
parent 623e258a2a
commit 09605d07ab
5 changed files with 188 additions and 6 deletions

70
webui/src/types/config.ts Normal file
View File

@@ -0,0 +1,70 @@
export interface BackendSettings {
command: string
args: string[]
environment?: Record<string, string>
docker?: DockerSettings
response_headers?: Record<string, string>
}
export interface DockerSettings {
enabled: boolean
image: string
args: string[]
environment?: Record<string, string>
}
export interface BackendConfig {
'llama-cpp': BackendSettings
vllm: BackendSettings
mlx: BackendSettings
}
export interface ServerConfig {
host: string
port: number
allowed_origins: string[]
allowed_headers: string[]
enable_swagger: boolean
response_headers?: Record<string, string>
}
export interface InstancesConfig {
port_range: [number, number]
data_dir: string
configs_dir: string
logs_dir: string
auto_create_dirs: boolean
max_instances: number
max_running_instances: number
enable_lru_eviction: boolean
default_auto_restart: boolean
default_max_restarts: number
default_restart_delay: number
default_on_demand_start: boolean
on_demand_start_timeout: number
timeout_check_interval: number
}
export interface AuthConfig {
require_inference_auth: boolean
inference_keys: string[] // Will be empty in sanitized response
require_management_auth: boolean
management_keys: string[] // Will be empty in sanitized response
}
export interface NodeConfig {
address: string
api_key: string // Will be empty in sanitized response
}
export interface AppConfig {
server: ServerConfig
backends: BackendConfig
instances: InstancesConfig
auth: AuthConfig
local_node: string
nodes: Record<string, NodeConfig>
version?: string
commit_hash?: string
build_time?: string
}