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

# AI Providers

> Configure AI providers to use with cmd

## Overview

cmd connects to AI providers using your API keys, or use local inference with providers like Ollama. You can configure multiple providers and switch between them as needed. This gives you flexibility to:

* Use different providers for different tasks
* Run AI models locally for privacy and offline development
* Have backup options if one provider has issues
* Compare performance across providers
* Take advantage of different pricing models or eliminate API costs entirely

## Initial Setup

During the onboarding flow, you'll be prompted to configure at least one AI provider. You can always add more providers later through **Settings > AI Providers**.

## Adding a Provider

<Steps>
  <Step title="Open AI Providers Settings">
    Go to **Settings > AI Providers**
  </Step>

  <Step title="Add New Provider">
    Configure the desired provider (typically with an API key)
  </Step>

  <Step title="Save">
    Select which of the available models to enable
  </Step>
</Steps>

<Info>
  API keys are stored securely in your macOS Keychain and are never sent to cmd's servers.
</Info>

## Managing Providers

### Setting a Default Provider

When multiple providers offer the same model, you can set which provider to use by default. See [Models](/pages/models) for details.

### API Key Security

<CardGroup cols={2}>
  <Card title="Secure Storage" icon="lock">
    API keys are stored in macOS Keychain
  </Card>

  <Card title="Encrypted Transmission" icon="shield">
    All API calls use HTTPS for encrypted communication
  </Card>

  <Card title="No Key Sharing" icon="eye-slash">
    Keys are never shared with anyone
  </Card>

  <Card title="Easy Revocation" icon="rotate">
    Revoke keys anytime through your provider's console
  </Card>
</CardGroup>

### Local Inference

For complete data privacy and offline development, you can use [Ollama](/pages/ollama) to run AI models locally on your machine or on a private network server. This eliminates API costs and ensures your code never leaves your infrastructure.

See the [Ollama configuration guide](/pages/ollama) for setup instructions.

<Tip>
  Configure multiple providers to compare costs and performance. You can switch providers anytime from **Settings > Models**.
</Tip>
