Amplify's model management system lets you switch models mid-conversation, configure thinking/reasoning per model, set rate limits, and persist all settings in localStorage.
Model management overview
Amplify combines static models (hardcoded per provider) with dynamic models (fetched at runtime from provider APIs) into a unified model list. Dynamic models override static models when they share the same name-provider key.
Default model: claude-3-5-sonnet-latest (defined in app/utils/constants.ts)
ModelInfo interface:
interface ModelInfo {
name: string; // Model ID (e.g., "gpt-4o", "claude-3-5-sonnet")
label: string; // Human-readable display name
provider: string; // Provider name (e.g., "OpenAI", "Anthropic")
maxTokenAllowed: number; // Maximum context window size
maxCompletionTokens?: number; // Maximum output tokens (optional)
tpm?: number; // Tokens per minute limit
rpm?: number; // Requests per minute limit
}
Provider categories
Models come from three provider categories:
Cloud providers (API key required):
- OpenAI, Anthropic, Google, Deepseek, Groq, Mistral, Cohere, Together, xAI, Perplexity, Moonshot, Z.ai, HuggingFace, Hyperbolic, Fireworks, Cerebras, Github, OpenRouter, AmazonBedrock
Local providers (baseUrl required, no API key):
- Ollama : Self-hosted models, base URL
http://127.0.0.1:11434 - LMStudio : Local model inference, base URL
http://127.0.0.1:1234 - OpenAILike : Any OpenAI-compatible endpoint
Routing/Meta providers:
- OpenRouter : Aggregates multiple providers, shows pricing in labels (
in:$X.XX out:$X.XX)
Per-model configuration
Each model can have individual configuration persisted in localStorage key amplify:model-config.
interface ModelConfig {
thinkingEnabled: boolean; // Master toggle for extended thinking
budgetTokens: number; // Token budget for thinking (default 4096)
effort: ReasoningEffort; // 'low' | 'medium' | 'high'
maxOutputTokens: number; // Hard cap on output tokens; 0 = use model default
}
interface ModelConfigStore extends ModelConfig {
perModel: Record<string, ModelConfig>; // Key = "Provider:ModelName"
}
Defaults: thinkingEnabled=true, budgetTokens=4096, effort='medium', maxOutputTokens=0
When you switch models, Amplify restores the per-model config from perModel["Provider:ModelName"]. This means your thinking/reasoning settings survive model switches.
Thinking and reasoning
Amplify supports extended thinking/reasoning for models that provide it. The thinking.ts module translates unified config into per-provider providerOptions.
| Provider | Models | Configuration |
| Anthropic | Claude 3.7, Opus 4, Sonnet 4 | { type: 'enabled', budgetTokens: >= 1024 } |
| Anthropic | Claude 4.6+ | { type: 'adaptive' } — no budget_tokens needed |
| Gemini 2.5 | thinkingBudget (0 = disabled) + includeThoughts | |
| Gemini 3.x | thinkingLevel ('minimal' | |
| OpenAI | o1, o3, GPT-5 | reasoningEffort + reasoningSummary: 'auto' |
| xAI | Grok 3 | reasoningEffort via providerOptions.openai |
| Mistral | Magistral | reasoningEffort: 'high' or 'none' |
| DeepSeek | Reasoner | Automatic — no providerOptions needed |
Reasoning model detection
The isReasoningModel() function uses regex: /^(o1|o3|gpt-5|gemini-2\.5|gemini-3|deepseek-r|qwen.*think|kimi-thinking|gemma)/i
For reasoning models, Amplify uses maxCompletionTokens instead of maxTokens in the AI SDK call. This ensures extended thinking output isn't truncated.
Rate limits
Amplify implements per-provider rate limiting to prevent API quota exhaustion.
interface RateLimitConfig {
rpm: number; // Requests per minute (0 = unlimited)
tpm: number; // Tokens per minute (0 = unlimited)
rpd: number; // Requests per day (0 = unlimited)
autoShrinkToTpm: boolean; // Auto-shrink context to fit TPM instead of erroring
}
Suggested defaults (from 2025-2026 official provider docs):
| Provider | RPM | TPM | RPD |
| 10 | 250,000 | 1,000 | |
| Anthropic | 50 | 80,000 | — |
| OpenAI | 500 | 200,000 | — |
| Deepseek | 60 | 100,000 | — |
| xAI | 60 | 16,000 | — |
| Groq | 30 | 30,000 | 14,400 |
| OpenRouter | 20 | 200,000 | 1,000 |
| Local (Ollama, LMStudio, OpenAILike) | 0 | 0 | 0 |
Rate limits are persisted in localStorage key amplify:rate-limits. The preFlightCheck() function estimates request tokens and can throttle, shrink context, or reject requests that exceed limits.
autoShrinkToTpm
When
autoShrinkToTpmis enabled, Amplify automatically reduces the context window (by summarizing older messages) to fit within the TPM limit instead of returning an error. This is useful for providers with strict TPM limits like xAI and Groq.
Notable static models
Key models available without dynamic fetching:
| Provider | Model | Context | Max Output |
| OpenAI | gpt-4o | 128K | 4K |
| OpenAI | gpt-4o-mini | 128K | 4K |
| OpenAI | o1-preview | 128K | 32K |
| Anthropic | claude-3-5-sonnet | 200K | 128K |
| Anthropic | claude-opus-4 | 200K | 32K |
| gemini-2.5-flash | 1M | 8K | |
| gemini-3-flash | 1M | 8K | |
| Deepseek | deepseek-v3.2 | 64K | 8K |
| xAI | grok-4 | 256K | — |
| Z.ai | glm-4.6 | 200K | 65K |
| Cerebras | qwen3-coder-480b | 262K | — |
| Github | gpt-4.1 | 1M | 32K |
Learn about MCP integration