Are you an LLM? Read llms.txt for a summary of the docs, or llms-full.txt for the full context.
Skip to content

Providers

Amodal supports multiple LLM providers with a unified interface, built on the Vercel AI SDK. Switch providers by changing a field in amodal.json — no code changes needed.

Supported Providers

ProviderModelsAuth env varNotes
AnthropicClaude Opus 4, Sonnet 4, Haiku 4.5ANTHROPIC_API_KEYNative adapter, prompt caching supported
OpenAIGPT-4o, GPT-4, o1, o3OPENAI_API_KEYNative adapter
GoogleGemini 3.1 Pro, 3 Flash, 2.5 Pro/FlashGOOGLE_API_KEYNative adapter, same key as webTools
GroqLlama 3.3 70B, Kimi-K2GROQ_API_KEYOpenAI-compatible — ultra-low latency
DeepSeekdeepseek-chat, deepseek-reasonerDEEPSEEK_API_KEYOpenAI-compatible
xAIGrok-4, Grok-3XAI_API_KEYOpenAI-compatible
MistralMistral Large, SmallMISTRAL_API_KEYOpenAI-compatible
FireworksOpen-weight models (Llama, Qwen, etc.)FIREWORKS_API_KEYOpenAI-compatible hosting
TogetherOpen-weight modelsTOGETHER_API_KEYOpenAI-compatible hosting
BedrockClaude, Titan, Llama (AWS)AWS credentialsAvailable for eval judges; agent loop coming
Azure OpenAIGPT-4, GPT-4o on AzureAzure credsAvailable for eval judges; agent loop coming
CustomAny OpenAI-compatible endpointper-providerSet baseUrl to point at your own inference server

Recommended models by use case

Use caseModelInput/Output per 1MWhy
Production agentsgemini-3.1-pro-preview$2.00 / $12.00Best quality/cost ratio, strong tool-calling
Budget agentsgemini-3-flash-preview$0.50 / $3.00Fast, cheap, good for simple workflows
Maximum qualityclaude-opus-4-20250514$15.00 / $75.00Best reasoning, prompt caching cuts repeat costs
Fast + cheapgemini-3.1-flash-lite-preview$0.25 / $1.50Sub-agent dispatch, simple tasks
Low-latencygroq/llama-3.3-70b-versatile~$0.60 / $0.80Groq hardware, ~300 tok/s

OpenAI-compatible providers (Groq, DeepSeek, xAI, Mistral, Fireworks, Together) reuse the OpenAI adapter with a per-provider baseUrl. Any additional OpenAI-compatible endpoint works by setting baseUrl explicitly in amodal.json — no code changes needed.

Configuration

Auto-detection

Set the relevant environment variable and Amodal auto-detects the provider:

export ANTHROPIC_API_KEY=sk-ant-...
amodal dev   # uses Anthropic automatically

Explicit config

Specify under models.main in amodal.json:

{
  "models": {
    "main": {
      "provider": "anthropic",
      "model": "claude-sonnet-4-20250514"
    }
  }
}

For OpenAI-compatible providers, set provider to the provider name and optionally override baseUrl:

{
  "models": {
    "main": {
      "provider": "groq",
      "model": "llama-3.3-70b-versatile",
      "apiKey": "env:GROQ_API_KEY"
    }
  }
}

Failover

Every ModelConfig supports a fallback chain — another ModelConfig tried when the primary fails (5xx, 429, timeout, auth error):

{
  "models": {
    "main": {
      "provider": "anthropic",
      "model": "claude-sonnet-4-20250514",
      "fallback": {
        "provider": "openai",
        "model": "gpt-4o"
      }
    }
  }
}

Failover is per-request. If Anthropic recovers, the next request goes back to the primary. For programmatic use, the runtime also exports createFailoverProvider() with configurable retry count and backoff.

Streaming

All providers support streaming via the LLMProvider.streamText() interface. The streaming shape is unified — state handlers don't know which provider is active.

Multi-Model Comparison

Use amodal eval or amodal ops experiment to compare providers:

amodal eval --providers anthropic,openai,google

This runs the same eval suite against each provider and reports quality, latency, and cost differences.