The chatbot uses a singleDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/Wikedhart18/nextjs-ai-chatbot/llms.txt
Use this file to discover all available pages before exploring further.
myProvider object defined in lib/ai/models.ts to manage all language and image models. Adding a new model means registering it in that provider and adding a display entry to the chatModels array — the model selector UI reads from that array automatically.
Install the provider package
The Vercel AI SDK publishes a package for each supported provider. Install the one you need.
- Anthropic
- Google
- Mistral
Set the provider’s API key as an environment variable (for example,
ANTHROPIC_API_KEY). Check the provider’s SDK docs for the exact variable name.Register the model in myProvider
Open To add Anthropic Claude, import the provider and add a new key to The string key (
lib/ai/models.ts. The existing provider looks like this:lib/ai/models.ts
languageModels:lib/ai/models.ts
'chat-model-claude') is the internal model ID used throughout the codebase. Choose a key that is unique within the languageModels object.Add a display entry to chatModels
Still in The
lib/ai/models.ts, add an object to the chatModels array. This is what the model selector dropdown renders.lib/ai/models.ts
id field must exactly match the key you added to myProvider.languageModels in the previous step.Special model configurations
Reasoning models
The built-in reasoning model wraps DeepSeek R1 withextractReasoningMiddleware to parse <think> tags from the response. You can apply the same middleware to any model that emits reasoning tokens:
Internal-only models
title-model and artifact-model are registered in myProvider but intentionally excluded from chatModels. They are used internally for title generation and artifact content generation respectively. You can follow the same pattern to add models that are not user-selectable.