llama-3.1-70b, claude-sonnet-4-6, custom-model) to its canonical provider id (groq, anthropic, β¦) so runtime and config resolution work for every vendor β not just three hard-coded ones.
providers.<name>.runtime_default applies automatically.
Quick Start
1
Resolve a built-in provider
2
Use it from YAML runtime config
How It Works
resolve_provider(model_name) returns the provider id in a fixed precedence.
Returns
None when nothing matches.
Built-in providers
Publish a Plugin
Register a vendor out-of-tree β pip-installable, no PraisonAI code changes.1
Declare the entry point
bedrock) is the provider id resolve_provider(...) returns on a match β it must equal the key you use under providers: in YAML.2
Write the matcher
bool.3
Use it
Registered matchers take precedence over built-ins. Register a matcher named
anthropic to override the built-in claude detection, for example.What Consumes This
praisonai_adapter._resolve_agent_runtime calls resolve_provider(agent_model) to pick providers.<name>.runtime_default. When no provider matches, a logger.debug line explains the miss and the provider-scoped default is not consulted:
Public API
Best Practices
Match the entry-point name to your provider key
Match the entry-point name to your provider key
resolve_provider(...) returns the entry-point name. Name it exactly what you use under providers: in YAML, or runtime_default wonβt apply.Accept the lowercased name
Accept the lowercased name
Matchers receive the model name already lowercased. Donβt re-lowercase or compare against mixed-case constants β write your checks in lowercase.
Keep matchers cheap and total
Keep matchers cheap and total
Matchers run on every unprefixed model name. Use simple
startswith / in checks and never raise β a raising matcher is skipped, and slow ones tax every resolution.Prefer explicit prefixes for one-offs
Prefer explicit prefixes for one-offs
For a single model,
provider/model in YAML (bedrock/claude-3) resolves without any plugin β reserve entry points for whole vendor families.Related
Runtime Selection
Choose which runtime executes each model, per provider or per agent
Integration Registry
Same static-map + entry-point + built-ins-win pattern for integrations

