{"record":{"id":"93abb7d92c3ea78d","repo":"BoundaryML/baml","slug":"invalid-strategy-client-provider-variant","errorCode":null,"errorMessage":"Invalid strategy client provider variant: {}","messagePattern":"Invalid strategy client provider variant: (.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"engine/baml-lib/llm-client/src/clientspec.rs","lineNumber":181,"sourceCode":"            \"openai-transcriptions\" => Ok(OpenAIClientProviderVariant::Transcriptions),\n            \"openai-generic\" => Ok(OpenAIClientProviderVariant::Generic),\n            \"openrouter\" => Ok(OpenAIClientProviderVariant::OpenRouter),\n            _ => Err(anyhow::anyhow!(\n                \"Invalid OpenAI client provider variant: {}\",\n                s\n            )),\n        }\n    }\n}\n\nimpl std::str::FromStr for StrategyClientProvider {\n    type Err = anyhow::Error;\n\n    fn from_str(s: &str) -> Result<Self, Self::Err> {\n        match s {\n            \"round-robin\" => Ok(StrategyClientProvider::RoundRobin),\n            \"fallback\" => Ok(StrategyClientProvider::Fallback),\n            _ => Err(anyhow::anyhow!(\n                \"Invalid strategy client provider variant: {}\",\n                s\n            )),\n        }\n    }\n}\n\nimpl ClientProvider {\n    pub fn allowed_providers() -> &'static [&'static str] {\n        &[\n            \"openai\",\n            \"openai-generic\",\n            \"azure-openai\",\n            \"openai-responses\",\n            \"openai-transcriptions\",\n            \"anthropic\",\n            \"ollama\",\n            \"openrouter\",","sourceCodeStart":163,"sourceCodeEnd":199,"githubUrl":"https://github.com/BoundaryML/baml/blob/bd85ce9dee1463ff04d27efd20531013a4ff46c1/engine/baml-lib/llm-client/src/clientspec.rs#L163-L199","documentation":"StrategyClientProvider::from_str parses strategy client names and accepts only \"round-robin\" and \"fallback\" (plus baml- aliases at the ClientProvider level). Any other string raises \"Invalid strategy client provider variant: {s}\".","triggerScenarios":"Parsing a strategy provider string like \"retry\", \"random\", or \"best-of\" that the strategy enum does not support.","commonSituations":"Expecting a retry strategy provider that doesn't exist; typos like \"roundrobin\" or \"Round-Robin\"; copying strategy names from other LLM frameworks.","solutions":["Use \"fallback\" or \"round-robin\" (or \"baml-fallback\"/\"baml-round-robin\") exactly.","Fix casing — variants are lowercase.","Implement custom strategies via BAML's other mechanisms instead of inventing a strategy name."],"exampleFix":"// before\nprovider \"RoundRobin\"\n// after\nprovider \"round-robin\"","handlingStrategy":"try-catch","validationCode":"if (![\"round-robin\",\"fallback\"].includes(s)) throw new Error(`unknown strategy: ${s}`);","typeGuard":null,"tryCatchPattern":"match s.parse::<StrategyClientProvider>() {\n    Ok(v) => v,\n    Err(e) => { eprintln!(\"{e}\"); StrategyClientProvider::Fallback }\n}","preventionTips":["Only round-robin and fallback strategies exist — validate against them.","Beware of names from other frameworks (\"retry\", \"random\" are not supported).","Spell strategies lowercase with hyphens."],"tags":["strategy","enum","parsing"],"backgroundTag":"invalid-enum-value","analyzedSha":"bd85ce9dee1463ff04d27efd20531013a4ff46c1","analyzedAt":"2026-09-12T03:38:25.718Z","contentChangedAt":"2026-09-12T03:38:25.718Z","schemaVersion":2},"datasetVersion":"2026-09-14T11:17:12.474Z"}