Models#

gptme is model-agnostic: it works with any LLM through a single --model flag, and you can pick a different model for every task. Use a small, fast model for quick questions and a powerful reasoning model for complex code — without changing tools, formats, or workflow.

This page helps you pick a model. To set up access to one — API keys, subscriptions, local servers — see Providers.

Pick a model per session#

Pass --model (-m) as <provider>/<model> to choose the model for a single run:

# Quick question — small, cheap, fast
gptme "what does this regex match?" -m openrouter/qwen/qwen3-max

# Complex coding — powerful reasoning model
gptme "refactor this module for testability" -m anthropic/claude-sonnet-5-5

# Use a provider default (no model specified)
gptme "hello" -m anthropic

List the models gptme knows about at any time:

gptme '/models' - '/exit'

The rule of thumb: match the model to the job. Triage, summarization, and quick lookups run fine on small models; multi-step coding and reasoning benefit from a frontier model. Picking per task keeps cost down without capping capability.

One key, many models: OpenRouter#

OpenRouter is the easiest way to reach many models without managing a separate API key for each provider. With one OPENROUTER_API_KEY you can route to 100+ models from Anthropic, OpenAI, Google, DeepSeek, xAI, and more:

gptme "hello" -m openrouter/anthropic/claude-sonnet-5.5
gptme "hello" -m openrouter/deepseek/deepseek-v4.1-flash
gptme "hello" -m openrouter/x-ai/grok-4.6

gptme applies privacy-first defaults for OpenRouter (data collection denied, provider routing requires full parameter support). See OpenRouter for configuration details, quantization controls, and provider pinning.

Data policy#

On gptme.ai, prompts are never routed to a provider that trains on them. The gptme.ai gateway forces OpenRouter’s no-training filter (data_collection: "deny") on every request, also excludes every provider OpenRouter lists as training on prompts, including DeepSeek’s first-party API, and serves the default DeepSeek V4.1 Flash only from a vetted allowlist of no-training, zero-data-retention hosts. A request pinned to a training provider is rejected rather than silently rerouted.

When self-hosting, gptme already sends data_collection: "deny" to OpenRouter by default (OPENROUTER_DATA_COLLECTION), which skips hosts that train on prompts, DeepSeek’s official endpoint among them. To go further:

  • Enforce it account-wide in OpenRouter’s privacy settings, so it holds for every client using your key: turn off providers that may train on inputs, optionally require Zero Data Retention endpoints, and add providers to the account-wide ignore list.

  • Restrict gptme to hosts you have vetted with an @ pin, or set OPENROUTER_PROVIDER_ORDER to apply the same allowlist to every request (see OpenRouter).

  • Keep in mind that a direct provider such as deepseek/... bypasses OpenRouter, so only that provider’s own data policy applies; DeepSeek’s allows training on API inputs.

Set a default model#

If you mostly use one model, set it once in your global config (~/.config/gptme/config.toml) instead of passing --model every time:

[models]
default = "openrouter/qwen/qwen3-max"

With a default configured, gptme "query" uses that model, and --model still overrides it per run when you need something stronger or cheaper.

See Configuration for the full config reference.

Per-agent models#

When you run multiple agents — for example a team of agents each handling a different role — each can have its own model. Set the model in the agent’s own config so a fast routing agent and a reasoning-heavy coding agent can coexist without per-call flags:

# router-agent/gptme.toml — cheap, fast, handles triage and dispatch
[env]
MODEL = "openrouter/qwen/qwen3-max"
# coder-agent/gptme.toml — frontier model for complex implementation
[env]
MODEL = "anthropic/claude-sonnet-5-5"

A model set this way wins over a global [models].default: the project’s gptme.toml is the more specific layer. To override it for a single run, pass --model in the command that runs the agent, or export MODEL for that command. See How model selection works for the full order.

This is how an agent “brain” pins its default model: configure it once in the agent’s config, override per session only when a specific task needs a different model. No vendor lock-in, no format changes.

See also#