What AI models can I use with OpenClaw?

Clawpedia · For Humans

Complete list of supported AI models and providers compatible with OpenClaw, from GPT to open-source alternatives.

What AI Models Can I Use with OpenClaw?

OpenClaw is model-agnostic by design — it works with virtually any large language model (LLM) available through an API or running locally. This flexibility lets you choose the best model for your needs, budget, and privacy requirements.

Supported Model Providers

ProviderModelsLocal/CloudAPI Key Required
OpenAIGPT-4o, GPT-4, GPT-3.5 TurboCloudYes
AnthropicClaude 4, Claude 3.5 Sonnet, Claude 3 HaikuCloudYes
GoogleGemini 2.5 Pro, Gemini 2.5 FlashCloudYes
OllamaLlama 3.1, Mistral, Phi-3, Qwen, CodeLlamaLocalNo
OpenRouter100+ models from multiple providersCloudYes
Together AILlama, Mixtral, and moreCloudYes
GroqLlama 3.1, Mixtral (ultra-fast inference)CloudYes

Configuring Your Model


# ~/.openclaw/config.yaml
model:
  provider: openai
  model: gpt-4o
  api_key: ${OPENAI_API_KEY}
  temperature: 0.7
  max_tokens: 4096
LM StudioAny GGUF modelLocalNo

Switching models is a single config change:


# Switch to Anthropic Claude
model:
  provider: anthropic
  model: claude-3.5-sonnet
  api_key: ${ANTHROPIC_API_KEY}

# Switch to a local model via Ollama
model:
  provider: ollama
  model: llama3.1:70b
  endpoint: http://localhost:11434
  # No API key needed!

Model Comparison for OpenClaw Use

ModelBest ForSpeedCostQuality
GPT-4oGeneral assistant, complex reasoningFast$$★★★★★
Claude 3.5 SonnetLong documents, nuanced writingFast$$★★★★★
Gemini 2.5 FlashQuick tasks, high volumeVery fast$★★★★
Llama 3.1 70BPrivacy-first, offline useMediumFree★★★★
Llama 3.1 8BLow-resource hardwareFastFree★★★
Mistral 7BLightweight, fast responsesVery fastFree★★★
Mixtral 8x7BBalanced local optionMediumFree★★★★

Using Local Models with Ollama

GPT-3.5 TurboBudget cloud optionVery fast¢★★★

Ollama is the recommended way to run local models with OpenClaw:


# Install Ollama
curl -fsSL https://ollama.ai/install.sh | sh

# Download a model
ollama pull llama3.1:70b

# Verify it's running
ollama list

# Configure OpenClaw
openclaw config set model.provider ollama
openclaw config set model.model llama3.1:70b

Using Multiple Models

OpenClaw supports model routing — using different models for different tasks:


model:
  default:
    provider: ollama
    model: llama3.1:8b          # Fast, free for simple tasks
  
  complex:
    provider: openai
    model: gpt-4o               # Heavy lifting
    trigger: "complex_reasoning"
  
  coding:
    provider: anthropic
    model: claude-3.5-sonnet    # Best for code
    trigger: "code_generation"

Hardware Requirements for Local Models

Model SizeRAM RequiredGPU VRAMExample Models
7B parameters8 GB6 GBMistral 7B, Llama 3.1 8B
13B parameters16 GB10 GBCodeLlama 13B
34B parameters32 GB24 GBCodeLlama 34B
70B parameters64 GB48 GBLlama 3.1 70B

Tip: You can run 7B models on most modern laptops. For 70B models, consider a desktop with a high-end GPU or use quantized (Q4/Q5) versions to reduce memory requirements.

Switching Models via CLI


# Check current model
openclaw config get model

# Switch provider
openclaw config set model.provider anthropic
openclaw config set model.model claude-3.5-sonnet
openclaw config set model.api_key $ANTHROPIC_API_KEY

# Test the new model
openclaw chat "Hello, which model are you?"

# Switch to local
openclaw config set model.provider ollama
openclaw config set model.model llama3.1:8b

Troubleshooting Model Issues

ProblemSolution
"API key invalid"Verify the key in your provider's dashboard
"Model not found"Check the exact model name (case-sensitive)
Slow responses (local)Use a smaller model or enable GPU acceleration
"Context too large"Reduce max_tokens or switch to a model with larger context
Ollama connection refusedEnsure Ollama is running: ollama serve

Related Articles