Models and Providers
Switch between different models and providers.
Chat SDK ships with xAI as the default model provider. Since Chat SDK is powered by the AI SDK, which supports multiple providers out of the box, you can always switch to a different provider of your choice, anytime.
To update the models, you will need to update the custom provider called myProvider
at /lib/ai/models.ts
shown below.
You can replace the xai
models with any other provider of your choice. You will need to install the provider library and switch the models accordingly.
For example, if you want to use Anthropic's claude-3-5-sonnet
model for chat-model-large
, you can replace the xai
model with the anthropic
model as shown below.
You can find the provider library and model names in the provider's documentation. Once you have updated the models, you should be able to use the new models in your chatbot.