Features How it works Docs Pricing Compare LeanCTX Discord

Providers

LeanCTL supports 7+ AI providers out of the box. Use local models for free, or connect your own cloud API keys with Pro.

Overview

ProviderTypeTierBest For
OllamaollamaFreeLocal, private, no API costs
LM StudiolmstudioFreeLocal with GUI model management
AnthropicanthropicProClaude models — best coding quality
OpenAIopenaiProGPT models — versatile, fast
DeepSeekdeepseekProAffordable, strong reasoning
GroqgroqProUltra-fast inference
OpenRouteropenrouterProAccess to 100+ models via one API
Bring your own key: LeanCTL does not provide AI — you connect your own API key. We charge $9/month for the compression engine that makes your API calls cheaper.

Local Providers (Free)

Ollama

The easiest way to get started for free. Install Ollama, pull a model, and go.

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

# Pull a model
ollama pull qwen3.5:27b       # recommended for coding
ollama pull gemma4:e2b         # Google's Gemma 4

# Configure via wizard
leanctl init

Or add directly to ~/.leanctl/config.toml:

[[providers]]
name = "local"
type = "ollama"
model = "qwen3.5:27b"
base_url = "http://localhost:11434"   # default

Remote Ollama

Connect to an Ollama instance running on another machine:

[[providers]]
name = "murat"
type = "ollama"
model = "qwen3.5:27b"
base_url = "http://192.168.1.100:11434"
Tip: Set local = true if your Ollama runs on a public server to bypass the Pro tier check.

LM Studio

LM Studio provides a GUI for downloading and running models. Start the local server, then configure:

[[providers]]
name = "lmstudio"
type = "lmstudio"
model = "qwen3.5-27b"
base_url = "http://localhost:1234"   # default

Cloud Providers (Pro)

Cloud providers require LeanCTL Pro ($9/month). You bring your own API key — LeanCTL does not proxy your requests.

Anthropic (Claude)

[[providers]]
name = "claude"
type = "anthropic"
model = "claude-sonnet-4-20250514"
api_key_env = "ANTHROPIC_API_KEY"

Supported models: claude-sonnet-4-20250514, claude-opus-4-20250514, and all Claude 3.x models.

Get your API key: console.anthropic.com

OpenAI (GPT)

[[providers]]
name = "gpt"
type = "openai"
model = "gpt-4.1"
api_key_env = "OPENAI_API_KEY"

Supported models: gpt-4.1, gpt-4.1-mini, o4-mini, and all OpenAI chat models.

Get your API key: platform.openai.com

DeepSeek

[[providers]]
name = "deepseek"
type = "deepseek"
model = "deepseek-chat"
api_key_env = "DEEPSEEK_API_KEY"
base_url = "https://api.deepseek.com/v1"

Get your API key: platform.deepseek.com

Groq

[[providers]]
name = "groq"
type = "groq"
model = "llama-3.3-70b-versatile"
api_key_env = "GROQ_API_KEY"
base_url = "https://api.groq.com/openai/v1"

Get your API key: console.groq.com

OpenRouter

[[providers]]
name = "openrouter"
type = "openrouter"
model = "anthropic/claude-sonnet-4"
api_key_env = "OPENROUTER_API_KEY"
base_url = "https://openrouter.ai/api/v1"

Access 100+ models through a single API. Get your key: openrouter.ai

Custom OpenAI-Compatible Endpoints

Any endpoint that implements the OpenAI chat completions API works with LeanCTL:

[[providers]]
name = "my-server"
type = "openai"
model = "my-model"
base_url = "https://my-server.com/v1"
api_key = "my-key"
local = true   # set true to bypass tier check for self-hosted

This works with: vLLM, text-generation-inference, LocalAI, llama.cpp server, and any other OpenAI-compatible API.

Switching Providers

Switch providers and models at any time:

In the TUI

/model                         # open model picker (Ctrl+L)
/model claude-sonnet-4-20250514    # switch model
/model claude/claude-sonnet-4  # switch provider + model
/connect list                  # show all configured providers
/connect test                  # test current connection

From the CLI

leanctl --model ollama/qwen3.5:27b
leanctl --model claude-sonnet-4-20250514
leanctl models

API Key Security

Best practices for managing API keys:

  1. Environment variables (recommended): Set keys in your shell profile and reference them with api_key_env.
  2. Config file: Store directly in config.toml with api_key. The file is in your home directory (~/.leanctl/), but is not encrypted.
  3. .env file: LeanCTL loads .env from your project root. Add .env to .gitignore.
Never commit API keys: If using api_key in the config file, ensure ~/.leanctl/config.toml has restricted permissions (chmod 600).

Free vs Pro

LeanCTL determines if a provider is "local" or "cloud" automatically:

  • Local (Free): ollama type, lmstudio type, or any provider with local = true, or a base_url pointing to localhost, 127.0.0.1, or private IP ranges.
  • Cloud (Pro): anthropic, openai, deepseek, groq, openrouter types without local override.

To upgrade to Pro:

leanctl register     # free beta registration
leanctl subscribe    # or subscribe at leanctl.com/#pricing
leanctl login        # enter your API key

Streaming & Usage Tracking

All providers support streaming responses. LeanCTL tracks token usage per turn:

ProviderStreamingUsage Tracking
AnthropicSSE (Server-Sent Events)Input, output, thinking, cache creation, cache read tokens
OpenAISSE streamingInput, output, reasoning tokens
OllamaNDJSON linesEval count (output tokens)
OthersOpenAI-compatible SSEStandard usage fields

View costs with /cost in the TUI or leanctl stats from the command line.

Context Windows

LeanCTL automatically detects the context window for known models:

Model FamilyContext Window
Claude (all)200,000 tokens
GPT-4.11,000,000 tokens
GPT-4o / GPT-4 Turbo128,000 tokens
o1 / o3 / o4200,000 tokens
DeepSeek128,000 tokens
Llama 3.x128,000 tokens
Qwen131,072 tokens
Gemma 4128,000–256,000 tokens
Mistral32,000 tokens
Default (unknown)128,000 tokens

Override with the context_window field in your provider definition if needed.