pub fn provider_for(slug: &str) -> Arc<dyn Provider> ⓘExpand description
Select the provider implementation for a model slug.
Why: The loop must stay backend-agnostic; this factory is the only place that
knows how to map a slug to a backend, so adding a backend touches one site.
What: Returns BedrockProvider for slugs beginning with bedrock/,
FireworksProvider for slugs beginning with fireworks/ (#2406),
TogetherProvider for slugs beginning with together/ (#2494),
AtlasCloudProvider for slugs beginning with atlascloud/ (#2536), and the
default OpenRouterProvider (carrying the slug for its
supports_native_tools decision) for everything else. The together/ and
atlascloud/ checks sit alongside fireworks/ — after bedrock/ — so no
together/* or atlascloud/* slug can fall through to the OpenRouter default.
Test: adapter::tests::provider_for_routes_*.