pub struct CheapModelSection {
pub enabled: bool,
pub provider: String,
pub model: String,
pub api_key_env: String,
pub base_url_env: String,
pub region: Option<String>,
pub region_env: String,
}Expand description
S1.2: top-level cheap-model config. Same shape as DistillerSection
(provider / model / api_key_env / base_url_env / region / region_env) but
with provider now including "ollama" (S1.1).
Providers:
"anthropic"/"claude"— Anthropic API."openai"/"gpt"/"oai"— OpenAI-compatible API."ollama"— local Ollama server (OpenAI-compatible athttp://localhost:11434/v1). No API key required. Recommended small instruct models:qwen2.5:3b,llama3.2:3b. Override the endpoint withbase_url_env(default env varOLLAMA_BASE_URL)."bedrock"/"aws"— AWS Bedrock.
#[serde(default)] on the ProjectConfig field keeps all existing
project.toml files loading unchanged (cheap_model = None).
Fields§
§enabled: bool§provider: String§model: String§api_key_env: StringEnv-var name that holds the API key (not required for ollama).
base_url_env: StringEnv-var name that holds the base URL override. For ollama the
default resolved URL is http://localhost:11434/v1 when this env
var is absent or empty.
region: Option<String>AWS Bedrock: literal region. Takes precedence over region_env.
region_env: StringAWS Bedrock: env-var name that holds the region (default "AWS_REGION").
Implementations§
Source§impl CheapModelSection
impl CheapModelSection
Sourcepub const OLLAMA_DEFAULT_BASE_URL: &'static str = "http://localhost:11434/v1"
pub const OLLAMA_DEFAULT_BASE_URL: &'static str = "http://localhost:11434/v1"
S1.1: for provider = "ollama", return the default base URL
(http://localhost:11434/v1) when no override is configured.
Sourcepub fn from_distiller(d: &DistillerSection) -> Self
pub fn from_distiller(d: &DistillerSection) -> Self
Construct from a DistillerSection for back-compat resolution.
Trait Implementations§
Source§impl Clone for CheapModelSection
impl Clone for CheapModelSection
Source§fn clone(&self) -> CheapModelSection
fn clone(&self) -> CheapModelSection
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more