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
Google 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)

  1. Open Cline settings (gear icon in the Cline panel)
  2. Select Anthropic as the API provider
  3. Paste your Anthropic API key
  4. Choose a model (Claude Sonnet 4 recommended for most tasks)
Settings
Provider:  Anthropic
API Key:   sk-ant-api03-xxxxxxxxxxxxx
Model:     claude-sonnet-4-20250514

OpenAI

  1. Select OpenAI as the API provider
  2. Paste your OpenAI API key
  3. Choose a model (GPT-4o recommended)

Google Gemini

  1. Select Google Gemini as the API provider
  2. Paste your Google AI Studio API key
  3. Choose a Gemini model

OpenRouter

  1. Select OpenRouter as the API provider
  2. Paste your OpenRouter API key
  3. Browse and select from all available models
OpenRouter Advantage: With OpenRouter, you can switch between any available model without changing API keys. This is perfect for comparing models on the same task or using cheaper models for simple tasks and premium models for complex ones.

Local Models (Ollama)

  1. Install Ollama on your machine
  2. Pull a model: ollama pull deepseek-coder-v2
  3. In Cline settings, select Ollama as the provider
  4. The model list will auto-populate from your installed models

Local Models (LM Studio)

  1. Install LM Studio
  2. Download a model from the LM Studio library
  3. Start the local server in LM Studio
  4. 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
Cost Control: You can set a maximum auto-approve spend limit in Cline's settings. When the task cost reaches this limit, Cline will pause and ask for confirmation before continuing. This prevents runaway costs on long-running tasks.

Custom API Endpoints

Cline supports custom API endpoints for organizations that run their own AI infrastructure or use API proxies:

Settings
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.