Amplify supports 22+ LLM providers through a plugin registry architecture. Every provider extends the BaseProvider abstract class and is auto-discovered by the LLMManager singleton.
Provider overview
Amplify's provider system is designed for maximum flexibility — you can swap between providers freely, add custom OpenAI-compatible endpoints, and use both cloud and local models simultaneously.
Providers are classified into three categories:
| Category | Providers | Key feature |
| Cloud (API key) | OpenAI, Anthropic, Google, Deepseek, Groq, Mistral, Cohere, Together, xAI, Perplexity, Moonshot, Z.ai, HuggingFace, Hyperbolic, Fireworks, Cerebras, Github, OpenRouter, AmazonBedrock | Remote API with per-request billing |
| Local (baseUrl) | Ollama, LMStudio, OpenAILike | Self-hosted models, no API key needed |
| Routing/Meta | OpenRouter | Aggregates multiple providers, shows pricing |
All 22 registered providers
| # | Provider | API Key Env Var | Base URL Env Var | Dynamic Models? | SDK |
| 1 | Anthropic | ANTHROPIC_API_KEY | — | Yes | @ai-sdk/anthropic |
| 2 | AmazonBedrock | AWS_BEDROCK_CONFIG (JSON) | — | No | @ai-sdk/amazon-bedrock |
| 3 | Cerebras | CEREBRAS_API_KEY | — | Yes | @ai-sdk/cerebras |
| 4 | Cohere | COHERE_API_KEY | — | No | @ai-sdk/cohere |
| 5 | Deepseek | DEEPSEEK_API_KEY | — | Yes | @ai-sdk/deepseek |
| 6 | Fireworks | FIREWORKS_API_KEY | — | Yes | @ai-sdk/fireworks |
| 7 | Github | GITHUB_API_KEY | — | Yes | @ai-sdk/openai (models.github.ai) |
| 8 | GOOGLE_GENERATIVE_AI_API_KEY | — | Yes | @ai-sdk/google | |
| 9 | Groq | GROQ_API_KEY | — | Yes | @ai-sdk/openai (api.groq.com) |
| 10 | HuggingFace | HuggingFace_API_KEY | — | No | @ai-sdk/openai |
| 11 | Hyperbolic | HYPERBOLIC_API_KEY | — | Yes | @ai-sdk/openai |
| 12 | LMStudio | — | LMSTUDIO_API_BASE_URL | Yes | @ai-sdk/openai |
| 13 | Mistral | MISTRAL_API_KEY | — | No | @ai-sdk/mistral |
| 14 | Moonshot | MOONSHOT_API_KEY | — | Yes | @ai-sdk/openai |
| 15 | Ollama | — | OLLAMA_API_BASE_URL | Yes | ollama-ai-sdk |
| 16 | OpenAI | OPENAI_API_KEY | — | Yes | @ai-sdk/openai |
| 17 | OpenAILike | OPENAI_LIKE_API_KEY | OPENAI_LIKE_API_BASE_URL | Yes | @ai-sdk/openai |
| 18 | OpenRouter | OPEN_ROUTER_API_KEY | — | Yes (public) | @openrouter/ai-sdk-provider |
| 19 | Perplexity | PERPLEXITY_API_KEY | — | No | @ai-sdk/openai |
| 20 | Together | TOGETHER_API_KEY | TOGETHER_API_BASE_URL | Yes | getOpenAILikeModel |
| 21 | xAI | XAI_API_KEY | — | No | @ai-sdk/openai |
| 22 | Z.ai | ZAI_API_KEY | ZAI_BASE_URL | Yes | @ai-sdk/openai + custom retry |
BaseProvider architecture
Every provider extends the BaseProvider abstract class which provides:
Required abstract fields:
name: string— Unique provider identifier (e.g., "OpenAI", "Anthropic")staticModels: ModelInfo[]— Hardcoded fallback model listconfig: ProviderConfig—{ baseUrlKey?, baseUrl?, apiTokenKey? }
Required abstract method:
getModelInstance(options)— Returns an AI SDKLanguageModelinstance
Optional fields:
getDynamicModels()— Fetches live model list from provider API at runtimegetApiKeyLink— URL for obtaining an API keylabelForGetApiKey— Label text for the "Get API Key" buttonicon— Provider icon SVG
Helper methods from BaseProvider:
getProviderBaseUrlAndKey()— Resolves API key via the priority chainresolveDockerUrl()— Rewrites localhost → host.docker.internal for DockercreateTimeoutSignal()— 5s timeout for model fetch API callsgetModelsFromCache()/storeDynamicModels()— Caching keyed by apiKeys+settings+env
API key resolution priority chain
When a provider needs an API key, it resolves through this priority chain:
providerSettings.baseUrl— From UI settings (cookieproviders)serverEnv[baseUrlKey]— Cloudflare environment bindingsprocess.env[baseUrlKey]— Node.js environment variables (.env.local)LLMManager.env[baseUrlKey]— Vite-parsed env varsconfig.baseUrl— Hardcoded default per provider
This means you can configure providers at any level — env vars for server-side defaults, cookies for per-browser customization.
Custom providers
You can add custom OpenAI-compatible endpoints via the "Add Provider" popup in the model selector.
CustomProvider interface:
interface CustomProvider {
id: string; // UUID
name: string; // User-chosen display name
baseUrl: string; // OpenAI-compatible endpoint URL
apiKey: string; // Bearer token
createdAt: string; // ISO timestamp
}
Custom providers are stored in localStorage key amplify_custom_providers with cross-tab sync via the storage event listener. Unlike built-in providers, custom provider API keys are NOT stored in cookies.
The AddProviderPopup has two modes:
- "Pick" mode : Select an existing built-in provider to configure
- "Custom" mode : Add any OpenAI-compatible endpoint with a test-connection feature
Test connection
The custom provider popup includes a test connection button that sends a request to the endpoint to verify it's accessible and returns model information. This helps catch misconfigured base URLs before you start chatting.
Model Selector UI
The ModelSelector component (app/components/chat/ModelSelector.tsx) provides:
- Fuzzy search : Levenshtein distance matching (threshold 0.6 similarity)
- Grouped display : Cloud providers first, then local providers (Ollama, LMStudio, OpenAILike)
- Custom providers : Dedicated "Custom" group section
- Free model filter : Toggle to show only free-tier models
- Local status detection : Shows connectivity status for local providers
- Inline API key popup : Add/manage keys without leaving the selector
- Context window display : Shows sizes like "128K", "1.0M"
- Keyboard navigation : Arrow keys, enter, escape support
Dynamic model fetching
Providers with getDynamicModels() fetch live model lists from provider-specific API endpoints:
| Provider | API Endpoint | Special |
| OpenAI | /v1/models | Filters gpt-*, o*, chatgpt-* |
| Anthropic | /v1/models | Requires anthropic-version: 2023-06-01 header |
/v1beta/models | Excludes exp models; caps at 2M tokens | |
| Ollama | /api/tags | Docker URL rewrite; 5s timeout |
| LMStudio | /v1/models | Docker URL rewrite; 5s timeout |
| OpenRouter | /api/v1/models | Public (no auth needed); shows pricing |
| Z.ai | /models | JWT auth mode; retry-aware fetch with exponential backoff |
Dynamic models are cached keyed by JSON(apiKeys+settings+relevantEnv). When API keys change, the cache invalidates and models are re-fetched.
Learn about model configuration