Model Configuration Intermediate
Cline supports a wide range of AI providers and models. This lesson covers how to configure each provider, compare models for different tasks, track costs, and use custom API endpoints.
Supported Providers
Cline works with all major AI providers and several local model solutions:
| Provider | Popular Models | Best For |
|---|---|---|
| Anthropic | Claude Sonnet 4, Claude Opus 4, Claude Haiku | Best overall coding quality, strong reasoning |
| OpenAI | GPT-4o, GPT-4 Turbo, o1, o3 | Great general-purpose, wide ecosystem |
| Gemini 2.5 Pro, Gemini 2.5 Flash | Large context window, competitive pricing | |
| OpenRouter | All of the above + dozens more | Model flexibility, single API key for everything |
| AWS Bedrock | Claude models via AWS | Enterprise environments, AWS integration |
| Ollama | Llama 3, CodeLlama, Mistral, DeepSeek | Free, private, runs locally |
| LM Studio | Any GGUF model | Easy local model management with GUI |
Configuring Each Provider
Anthropic (Direct)
- Open Cline settings (gear icon in the Cline panel)
- Select Anthropic as the API provider
- Paste your Anthropic API key
- Choose a model (Claude Sonnet 4 recommended for most tasks)
Provider: Anthropic API Key: sk-ant-api03-xxxxxxxxxxxxx Model: claude-sonnet-4-20250514
OpenAI
- Select OpenAI as the API provider
- Paste your OpenAI API key
- Choose a model (GPT-4o recommended)
Google Gemini
- Select Google Gemini as the API provider
- Paste your Google AI Studio API key
- Choose a Gemini model
OpenRouter
- Select OpenRouter as the API provider
- Paste your OpenRouter API key
- Browse and select from all available models
Local Models (Ollama)
- Install Ollama on your machine
- Pull a model:
ollama pull deepseek-coder-v2 - In Cline settings, select Ollama as the provider
- The model list will auto-populate from your installed models
Local Models (LM Studio)
- Install LM Studio
- Download a model from the LM Studio library
- Start the local server in LM Studio
- In Cline settings, select LM Studio as the provider
Model Comparison for Cline Tasks
Different models excel at different types of tasks. Here is a practical comparison for common Cline operations:
| Task Type | Best Model | Why |
|---|---|---|
| Complex refactoring | Claude Opus 4 / o3 | Best reasoning, handles multi-file changes accurately |
| General coding | Claude Sonnet 4 / GPT-4o | Great balance of quality and speed |
| Quick edits | Claude Haiku / Gemini Flash | Fast and cheap for simple changes |
| Large context | Gemini 2.5 Pro | 1M+ token context window |
| Cost-sensitive | DeepSeek Coder (local) | Free, runs locally, good coding performance |
Cost Tracking
Cline shows the running cost of each task in real time. The cost display appears at the bottom of the Cline panel and shows:
- Input tokens: How many tokens Cline sent to the API (your messages + file contents)
- Output tokens: How many tokens the model generated
- Estimated cost: Calculated based on the model's pricing
- Total session cost: Cumulative cost across all tasks in the session
Custom API Endpoints
Cline supports custom API endpoints for organizations that run their own AI infrastructure or use API proxies:
Provider: OpenAI Compatible Base URL: https://your-proxy.company.com/v1 API Key: your-internal-api-key Model ID: your-model-name
This is useful for:
- Corporate AI proxies and gateways
- Self-hosted models with OpenAI-compatible APIs
- Cost-tracking proxies that log API usage
- Regional API endpoints for data compliance
Switching Between Models
You can switch models at any time during a session. Common strategies include:
- Start cheap, escalate: Begin a task with a fast, cheap model (Haiku/Flash). If it struggles, switch to a more capable model (Sonnet/GPT-4o) mid-task.
- Model per task type: Use premium models for complex tasks and budget models for simple ones.
- Local for sensitive code: Switch to Ollama/LM Studio when working with proprietary code that shouldn't leave your machine.
Experiment with Models
Try the same task with two different models and compare the results. The next lesson covers practical workflows you can build with Cline.
Next: Workflows →Ready to Go Deeper?
Live instructor-led courses from our partners. Affiliate disclosure.
AI & ML Courses - 30% Off
Live instructor-led AI, machine learning, data science, and cloud courses for working professionals. Use code Limited30 at checkout.
EdurekaDataCamp - AI & Data Science
Hands-on Python, machine learning, and AI courses with interactive exercises and real projects.
DataCampedX - Top AI Courses
University-level AI courses from MIT, Harvard, Stanford. Earn certificates that employers recognize.
edX