> ## Documentation Index
> Fetch the complete documentation index at: https://docs.getcmd.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Models

> Select and configure AI models in cmd

## Overview

After configuring your [AI providers](/pages/ai-providers), you need to enable which models you want to use. cmd provides fine-grained control over:

* Which models are available in the model selector
* Which provider to use when a model is available from multiple sources
* Default model preferences
* Local models from [Ollama](/pages/ollama) for private, offline inference

You can configure models during onboarding or anytime through **Settings > Models** or **Settings > AI Providers**.

## Enabling Models

<Steps>
  <Step title="Open Model Settings">
    Go to **Settings > Models**
  </Step>

  <Step title="Browse Available Models">
    You'll see all models available from your configured providers
  </Step>

  <Step title="Enable Models">
    Toggle on the models you want to use. Enabled models will appear in the model selector when using cmd.
  </Step>

  <Step title="Set Preferences">
    If a model is available from multiple providers, select your preferred provider
  </Step>
</Steps>

<Info>
  You need at least one provider configured before you can enable models. See [AI Providers](/pages/ai-providers) to set up providers.
</Info>

## Managing Multiple Providers for the Same Model

Some models may be available from multiple providers. For example:

* **Claude Sonnet** from both Anthropic and OpenRouter
* **GPT-4** from both OpenAI and Azure OpenAI
* Popular models from both direct providers and aggregators
* Local models from Ollama vs. cloud providers

### Setting Provider Preference

<Steps>
  <Step title="Open Model Settings">
    Navigate to **Settings > Models**
  </Step>

  <Step title="Find the Model">
    Locate the model that's available from multiple providers
  </Step>

  <Step title="Select Provider">
    Choose which provider to use from the dropdown:

    * Anthropic
    * OpenRouter
    * OpenAI
    * etc.
  </Step>

  <Step title="Save Changes">
    Your preference is saved automatically
  </Step>
</Steps>

<Tip>
  You might choose different providers based on:

  * **Cost**: Compare pricing across providers
  * **Speed**: Some providers may have faster response times
  * **Reliability**: Use a backup provider if your primary is having issues
  * **Features**: Some providers offer additional features
</Tip>

## Switching Models During Use

Once you've enabled models, you can switch between them easily in the chat interface:

1. Click the **model selector** at the top of the chat
2. Choose from your enabled models
3. Continue your conversation with the new model

The model selector shows only the models you've enabled in settings.

<Warning>After changing model mid-conversation, the next message will not have a cached prompt</Warning>

## Local Models

For complete privacy and offline development, you can use local models through [Ollama](/pages/ollama). Once you've configured the Ollama provider, all models installed in your Ollama instance will automatically appear in the model list.

<Steps>
  <Step title="Install Models in Ollama">
    Use the Ollama CLI to install models:

    ```bash theme={null}
    ollama pull qwen2.5-coder:7b
    ```
  </Step>

  <Step title="Refresh Model List">
    If you've added new models to Ollama, refresh cmd's model list by disabling and re-enabling the Ollama provider in **Settings > AI Providers**
  </Step>

  <Step title="Enable Local Models">
    Go to **Settings > Models** and enable the Ollama models you want to use
  </Step>
</Steps>

<Tip>
  Local models run entirely on your machine, ensuring your code never leaves your infrastructure. This is ideal for sensitive projects or working offline.
</Tip>
