Providers

Providers Overview

Connect to any LLM provider

🔌

Provider logos grid placeholder

Providers

YourGPT Copilot SDK supports multiple LLM providers out of the box. Switch providers without changing your frontend code.

All providers use the same API. Change one line in your config to switch from OpenAI to Anthropic.


Supported Providers


Quick Start

1. Choose Your Provider

<YourGPTProvider
  runtimeUrl="/api/chat"
  llm={{
    provider: 'openai',    // or 'anthropic', 'google', 'groq', etc.
    model: 'gpt-4o',
  }}
>
  <CopilotChat />
</YourGPTProvider>

2. Add API Key

# .env.local
OPENAI_API_KEY=sk-...

3. That's It!

The runtime automatically detects and uses the correct provider.


Switching Providers

Change one line - everything else stays the same:

// OpenAI
llm={{ provider: 'openai', model: 'gpt-4o' }}

// Anthropic
llm={{ provider: 'anthropic', model: 'claude-3-5-sonnet-20241022' }}

// Google
llm={{ provider: 'google', model: 'gemini-1.5-pro' }}

// Groq (fastest)
llm={{ provider: 'groq', model: 'llama-3.1-70b-versatile' }}

Your tools, UI, and all frontend code remain unchanged. The SDK normalizes responses across providers.


Provider Comparison

ProviderSpeedQualityCostBest For
OpenAIFastExcellent$$General use
AnthropicMediumExcellent$$Long context, safety
GoogleFastVery Good$Multimodal
GroqUltra FastGood$Speed-critical apps
MistralFastVery Good$European compliance
OllamaVariesVariesFreeLocal/private

Need a Custom Provider?

On this page