Skip to main content
The Provider Registry allows you to register custom LLM providers that can be used with createProvider(). This enables integration with any LLM provider beyond the built-in OpenAI, Anthropic, and Google providers.
Registered providers apply to both chat and embeddings. As of PraisonAI PR #4874, a provider registered via registerProvider(...) (or registerCustomProvider(...)) is resolved through the same createAISDKProvider(...) code path for embedding calls — agent.embed(...), embed(...), and embedMany(...) — as for chat. Embeddings used to be the lone exception; #4874 unified them.

Quick Start

1

Simple Usage

2

With Configuration

API Reference

registerProvider

Register a custom provider to the global registry.
Parameters:
  • name - Provider name (e.g., ‘cloudflare’, ‘ollama’)
  • provider - Provider class or factory function
  • options - Optional configuration
    • override - Allow overwriting existing registration (default: false)
    • aliases - Additional names that resolve to this provider
Example with aliases:
Providers registered on the default registry are visible to both the async (resolveBackend) and sync (resolveBackendSync) code paths. Prior to praisonai@1.7.5, native ESM callers of the sync path silently saw a second, empty registry — a registerProvider('stub', StubProvider) there was invisible to a following resolveBackendSync('stub/…'), which returned Unknown provider: 'stub'. Fixed by PraisonAI PR #4720.

createProvider

Create a provider instance from various input types.

getDefaultRegistry

Get the global provider registry instance.

createProviderRegistry

Create an isolated registry instance for multi-agent safety.

listProviders

List all registered provider names.

hasProvider

Check if a provider is registered.

unregisterProvider

Remove a provider from the registry.

Built-in Providers

The following providers are registered by default:

Creating a Custom Provider

Extend BaseProvider to create a custom provider:

Lazy Loading

Providers can be registered with lazy loading for better startup performance:

Multi-Agent Safety

Use isolated registries when running multiple agents that need different provider configurations:

Error Handling

The registry provides clear error messages:

TypeScript Types

Providers

Built-in LLM providers

Provider Registry CLI

CLI management