Skip to content

Model configuration

Dline connects to AI models through a provider. You can:

  • Bring your own API key for a cloud provider such as Anthropic, OpenAI, or OpenRouter.
  • Run models locally with Ollama or LM Studio on your own machine, with no API key.

Connections are stored as API Profiles. A Profile is a complete model connection: provider, model, API key, an optional base URL, and provider-specific settings. You can create several Profiles and use different models in different modes or subagents.

  1. Click the Settings button in the Dline panel title bar to open API Configuration.

  2. Click Add profile. A new Profile named New Model is added and expanded. If you already have one, you can expand its card with the button on the left and edit it instead.

  3. Choose a provider from the Provider dropdown.

  4. Authenticate:

    • Cloud provider: paste your key into the provider’s key field, such as OpenAI API Key.
    • Local runtime (Ollama / LM Studio): no key is needed; make sure the runtime is running.
  5. Choose an available model under Model. After you choose a provider and model, the Profile may be named automatically in the form provider:model; to rename it, edit Profile name, and the change is saved when you leave the field.

Creating a Profile, filling in provider settings, and selecting it in the model pickerCreating a Profile, filling in provider settings, and selecting it in the model picker

  • The available fields depend on the provider and model. For example, OpenAI offers Use custom base URL, a model picker or Use custom model ID, and options such as Thinking Mode. The setup guides under “Choosing a provider” below cover each provider’s settings.
  • Changing the provider clears the current API key, base URL, model selection, and provider-specific settings.
  • Drag the handle on the left of a card to reorder Profiles.
  • Click Manage to enter management mode, select the cards to delete, click Delete selected (n), then click Confirm delete (n) within 5 seconds. Click Done to leave management mode.
ProviderBest forSetup guide
OpenRouterMany vendors’ models with one keySetup
AnthropicDirect Claude accessSetup
Claude CodeClaude Max/Pro subscriptionSetup
OpenAIGPT modelsSetup
Google GeminiGemini modelsSetup
AWS BedrockModels billed through your AWS accountSetup
DeepSeekGood valueSetup

Run models on your own hardware: data stays on your machine and there are no per-request charges.

RuntimeBest forSetup guide
OllamaCommand-line local runtimeSetup
LM StudioGUI local runtimeSetup

Local models need capable hardware, especially GPU memory. See Running models locally for requirements.

Each Profile has three Profile usage checkboxes, shown as badges on the card:

UsageBadgeEffect
ActACTCan be selected in Act mode
PlanPLANCan be selected in Plan mode
SubagentsSUBCan be selected explicitly by subagents

New Profiles have all three checked. Unchecking all of them means the Profile cannot be used for anything, not that it can be used everywhere.

Image generation is not a usage option; it is a separate Image source setting on the Profile. See Image generation.

Click the model selector in the input area to open the Available Models menu:

  • by default, the menu lists Profiles usable in Act or Plan, and the one you pick is used for both modes;
  • with Split Model on (tooltip “Use different models per mode”; off by default), Act and Plan tabs appear, each listing only Profiles with that usage checked, and your choice affects only that mode;
  • the gear button in the menu opens API Configuration; when there are no Profiles yet, the menu offers Create profile.

What a selection affects:

When you chooseEffect
No task is runningUpdates the global Plan/Act bindings, the defaults for new tasks
A task is runningChanges only the current task’s bindings; changing global settings does not replace a running task’s bindings

Turning Split Model off during a task binds both modes to the Profile the current mode is using.

Switching to a model with a smaller context window

Section titled “Switching to a model with a smaller context window”

Switching Profiles during a task usually takes effect immediately. If the context already in use is at least the target model’s context window, a Switch to a smaller context window? dialog appears with Cancel and Switch. Confirming does not compact right away; it only switches the model, and ordinary context compaction may still happen later as the task continues.

This differs from Compact & Switch when switching between Plan and Act; see Plan and Act.

A named subagent can name a Profile with profile in its YAML, or you can pick one in the Profile drop-down on the Subagents tab (only enabled Profiles with the Subagents usage are listed; Default (act profile) keeps the main task’s Act Profile). For fallback rules, see Subagents.

ContentLocation
Profile configuration<data-root>/settings/api_profiles.json
API keys<data-root>/secrets/api_keys.json, keyed by Profile ID and never written to the Profile configuration file
Other provider credentials<data-root>/secrets/provider_secrets.json

<data-root> defaults to ~/.dline/data, or <DLINE_DIR>/data when DLINE_DIR is set. When several VS Code windows change Profiles at the same time, Dline merges the changes under a file lock and syncs them to the other windows.

IssueFix
Requests return 401 or the key is rejectedPaste the key into the Profile’s key field again and make sure it belongs to the selected provider.
The model list is empty or requests time outCheck your network and proxy settings. See Networking and proxies.
Dline cannot reach a local modelMake sure Ollama or LM Studio is running and the address in settings matches the address the runtime listens on.
MessageMeaning
“No profiles configured. Add a profile to connect a provider and model.”No Profile exists yet
“No profiles for this mode.”No Profile has the current mode’s usage checked
“Failed to load API profiles. Existing profiles have not been replaced.”Loading failed and existing configuration was left untouched; click Retry
Profile not valid: …The Profile bound to the task was deleted, disabled, is incomplete, or lacks credentials