Skip to main content
Register a custom LLM provider in Python or as a pip plugin, and it works end-to-end — from the Agent(llm="myprovider/model") call, in YAML, and in every praisonai CLI command — without editing core.

Quick Start

1

Use a provider you registered in Python

Register an adapter, then point an agent at it with a provider/model string.
2

Ship it as a pip-installable plugin

Publish the adapter under the praisonai.providers entry-point group so any pip install makes it first-class.
The entry point can be:
  • An adapter instance: "my_pkg:ADAPTER_INSTANCE"
  • An adapter class: "my_pkg.adapter:MyCloudAdapter" (instantiated on load)
  • A zero-arg factory callable: "my_pkg.adapter:build_adapter" (called on load)
After pip install your-plugin:

How It Works

Discovery is lazy and idempotent: the first call to list_provider_adapters() or get_provider_adapter() scans the praisonai.providers entry-point group once per process.

Same provider, three surfaces

The same provider works identically from Python, YAML, and the CLI.

Choosing between the three plugin systems

PraisonAI has three separate provider-plugin systems — pick the one that matches what you are adding.

Public API

Import everything from praisonaiagents.llm.adapters.
The adapter object implements LLMProviderAdapterProtocol (in praisonaiagents/llm/protocols.py) with hooks like supports_prompt_caching(), supports_streaming(), format_tool_result_message(...), and get_default_settings(). Subclassing DefaultAdapter gives sensible defaults for all of them.

Common Patterns

Reuse DefaultAdapter as a base when your provider is OpenAI-compatible — same request/response shape, only credentials differ.
Let credentials auto-detect — setting MYCLOUD_API_KEY in the environment is enough for a first run, no auth login needed.
Avoid names that collide with built-ins (openai, anthropic, gemini, ollama, claude) — the loader skips those silently and your plugin will seem not to register.

Best Practices

Matching is case-insensitive and the registry stores names lowercase — register mycloud, not MyCloud.
The loader catches construction errors and skips, so a slow or raising adapter silently disappears from the picker — connect lazily on first request.
Users expect a default model row in auth list; if yours differs from the built-ins, mention it in your package’s README.
Shipping via the praisonai.providers entry point gives users picker, auth, and YAML support without any Python glue — favour it over runtime add_provider_adapter.

Custom Provider Registry

The different praisonai.llm_providers system (Python-only, structured completion).

Model Provider Plugins

The different praisonaiagents.model_providers system (bare-name → provider id matchers).

Auth

How a discovered provider’s <PROVIDER>_API_KEY is stored and surfaced.

Setup

The picker that enumerates discovered providers.