Skip to main content

Module engine_api

Module engine_api 

Source
Expand description

Engine API — LLM engine introspection + config writes + routing control.

Provides access to the oxi-sdk model catalog (providers, models, search) and write operations that persist to config.toml (model, API key, routing).

Routing statistics (RoutingStats) are shared between this API and AgentRuntime via an Arc, so model usage is recorded end-to-end.

Structs§

ConnectionCheckResult
Connection test result.
CustomProviderDef
Definition for a custom (user-defined) provider.
EngineApi
Engine API facade — model catalog introspection + config writes + routing.
EngineConfigResponse
Current engine configuration + credential status + routing.
FallbackEvent
Single fallback event record.
ModelInfo
Summary of a model from the catalog.
ModelListSettings
Model list configuration for a provider.
ProviderConfigResponse
Response for provider config endpoint.
ProviderInfo
Summary of an LLM provider.
ProviderSettings
Provider별 설정 (per-provider model list, sorting, custom endpoint).
RoutingConfigSnapshot
Snapshot of routing configuration (read-only API response).
RoutingStats
In-memory routing statistics, shared between EngineApi and AgentRuntime. Uses simple RwLock for thread-safe reads/writes.
RoutingStatsSnapshot
Model usage statistics.
RoutingUpdate
Request body for PUT /api/engine/routing.
ValidateKeyResult
Result of an API key validation attempt.

Enums§

InputModality
Input modality for a model.
ModelListMode
Model list filtering mode.
ProviderCategory
Provider category for UI grouping.
SdkType
SDK protocol type for custom providers.

Functions§

estimate_cost
Estimate cost in USD for a model given token usage. Uses oxi-sdk’s model_db for per-model pricing.
record_usage_to_stats