Skip to main content

ai_runtime_config/
lib.rs

1#![warn(missing_docs)]
2
3//! AI Runtime Config — configuration types for AI runtime providers.
4//!
5//! Defines how provider specs (models, endpoints, auth) are structured
6//! and how runtime configuration is resolved.
7//!
8//! ## Types
9//!
10//! - [`OpenAIProviderSpec`] — OpenAI-compatible provider definition
11//! - [`AiRuntimeConfig`] — top-level runtime config combining provider specs
12//! - `resolve_ai_runtime_config()` — resolves config from environment or file
13
14use serde::{Deserialize, Serialize};
15
16#[derive(Debug, Clone, Serialize, Deserialize)]
17pub struct OpenAIProviderSpec {
18    pub model_id: String,
19    pub endpoint: String,
20    pub payload_model: String,
21    pub api_keys: Vec<String>,
22    pub auth_header_name: String,
23    pub auth_header_prefix: String,
24}
25
26#[derive(Debug, Clone, Serialize, Deserialize)]
27pub struct AiRuntimeConfig {
28    pub openai_providers: Vec<OpenAIProviderSpec>,
29    pub active_model_ids: Vec<String>,
30    pub dev_model_ids: Vec<String>,
31    pub lane_model_policy: Option<String>,
32}
33
34pub fn resolve_ai_runtime_config() -> AiRuntimeConfig {
35    AiRuntimeConfig {
36        openai_providers: Vec::new(),
37        active_model_ids: Vec::new(),
38        dev_model_ids: Vec::new(),
39        lane_model_policy: None,
40    }
41}