Skip to main content
A ready-to-run example is available here!
Use the LLM registry to manage multiple LLM providers and dynamically switch between models.

Using the Registry

You can add LLMs to the registry using the .add method and retrieve them later using the .get() method.

Ready-to-run Example

This example is available on GitHub: examples/01_standalone_sdk/05_use_llm_registry.py
examples/01_standalone_sdk/05_use_llm_registry.py
You can run the example code as-is.
The model name should follow the LiteLLM convention: provider/model_name (e.g., anthropic/claude-sonnet-4-5-20250929, openai/gpt-4o). The LLM_API_KEY should be the API key for your chosen provider.
ChatGPT Plus/Pro subscribers: You can use LLM.subscription_login() to authenticate with your ChatGPT account and access Codex models without consuming API credits. See the LLM Subscriptions guide for details.

Next Steps