> ## Documentation Index
> Fetch the complete documentation index at: https://langchain-5e9cc07a-preview-naomid-1774286607-a0b81f6.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Custom model providers

> Configure any LangChain-compatible model provider for the Deep Agents CLI

The Deep Agents CLI supports any [chat model provider compatible with LangChain](/oss/python/langchain/models), unlocking use for virtually any LLM that supports tool calling. Any service that exposes an OpenAI-compatible or Anthropic-compatible API also works out of the box—see [Compatible APIs](/oss/python/deepagents/cli/configuration#compatible-apis).

## Quick start

The CLI integrates automatically with the [following model providers](#provider-reference): no extra configuration needed beyond installing the relevant provider package.

1. **Install provider packages**

   Each model provider requires installing its corresponding LangChain integration package. These are available as optional extras when installing the CLI:

   ```bash theme={null}
   # Quick install with chosen providers (OpenAI included automatically)
   DEEPAGENTS_EXTRAS="anthropic,groq" curl -LsSf https://raw.githubusercontent.com/langchain-ai/deepagents/refs/heads/main/libs/cli/scripts/install.sh | bash

   # Or install directly with uv
   uv tool install 'deepagents-cli[anthropic,groq]'

   # Add additional packages at a later date
   uv tool upgrade deepagents-cli --with langchain-ollama

   # All providers
   uv tool install 'deepagents-cli[anthropic,baseten,bedrock,cohere,deepseek,fireworks,google-genai,groq,huggingface,ibm,litellm,mistralai,nvidia,ollama,openai,openrouter,perplexity,vertexai,xai]'
   ```

2. **Set credentials**

   Most providers require an API key. Set the appropriate environment variable listed in the table below. Some providers use other credentials (for example, Vertex AI uses `GOOGLE_CLOUD_PROJECT` plus ADC). Refer to each integration package's docs for details.

### Provider reference

Using a provider not listed here? See [Arbitrary providers](/oss/python/deepagents/cli/configuration#arbitrary-providers): any LangChain-compatible provider can be used in the CLI with some additional setup.

| Provider             | Package                                                                                       | Credential env var                                  | Model profiles |
| -------------------- | --------------------------------------------------------------------------------------------- | --------------------------------------------------- | -------------- |
| OpenAI               | [`langchain-openai`](/oss/python/integrations/chat/openai)                                    | `OPENAI_API_KEY`                                    | ✅              |
| Azure OpenAI         | [`langchain-openai`](/oss/python/integrations/chat/azure_chat_openai)                         | `AZURE_OPENAI_API_KEY`                              | ✅              |
| Anthropic            | [`langchain-anthropic`](/oss/python/integrations/chat/anthropic)                              | `ANTHROPIC_API_KEY`                                 | ✅              |
| Google Gemini API    | [`langchain-google-genai`](/oss/python/integrations/chat/google_generative_ai)                | `GOOGLE_API_KEY`                                    | ✅              |
| Google Vertex AI     | [`langchain-google-vertexai`](/oss/python/integrations/chat/google_generative_ai#credentials) | `GOOGLE_CLOUD_PROJECT`                              | ✅              |
| Baseten              | [`langchain-baseten`](https://github.com/basetenlabs/langchain-baseten)                       | `BASETEN_API_KEY`                                   | ✅              |
| AWS Bedrock          | [`langchain-aws`](/oss/python/integrations/chat/bedrock)                                      | `AWS_ACCESS_KEY_ID`, `AWS_SECRET_ACCESS_KEY`        | ✅              |
| AWS Bedrock Converse | [`langchain-aws`](/oss/python/integrations/chat/bedrock)                                      | `AWS_ACCESS_KEY_ID`, `AWS_SECRET_ACCESS_KEY`        | ✅              |
| Hugging Face         | [`langchain-huggingface`](/oss/python/integrations/chat/huggingface)                          | `HUGGINGFACEHUB_API_TOKEN`                          | ✅              |
| Ollama               | [`langchain-ollama`](/oss/python/integrations/chat/ollama)                                    | Optional                                            | ❌              |
| Groq                 | [`langchain-groq`](/oss/python/integrations/chat/groq)                                        | `GROQ_API_KEY`                                      | ✅              |
| Cohere               | [`langchain-cohere`](/oss/python/integrations/chat/cohere)                                    | `COHERE_API_KEY`                                    | ❌              |
| Fireworks            | [`langchain-fireworks`](/oss/python/integrations/chat/fireworks)                              | `FIREWORKS_API_KEY`                                 | ✅              |
| Together             | [`langchain-together`](/oss/python/integrations/chat/together)                                | `TOGETHER_API_KEY`                                  | ❌              |
| Mistral AI           | [`langchain-mistralai`](/oss/python/integrations/chat/mistralai)                              | `MISTRAL_API_KEY`                                   | ✅              |
| DeepSeek             | [`langchain-deepseek`](/oss/python/integrations/chat/deepseek)                                | `DEEPSEEK_API_KEY`                                  | ✅              |
| IBM (watsonx.ai)     | [`langchain-ibm`](/oss/python/integrations/chat/ibm_watsonx)                                  | `WATSONX_APIKEY`                                    | ❌              |
| Nvidia               | [`langchain-nvidia-ai-endpoints`](/oss/python/integrations/chat/nvidia_ai_endpoints)          | `NVIDIA_API_KEY`                                    | ✅              |
| xAI                  | [`langchain-xai`](/oss/python/integrations/chat/xai)                                          | `XAI_API_KEY`                                       | ✅              |
| Perplexity           | [`langchain-perplexity`](/oss/python/integrations/chat/perplexity)                            | `PPLX_API_KEY`                                      | ✅              |
| OpenRouter           | [`langchain-openrouter`](/oss/python/integrations/chat/openrouter)                            | `OPENROUTER_API_KEY`                                | ✅              |
| LiteLLM              | [`langchain-litellm`](/oss/python/integrations/chat/litellm)                                  | Per-provider (see [docs](https://docs.litellm.ai/)) | ❌              |

<Tip>
  A **[model profile](/oss/python/langchain/models#model-profiles)** is a bundle of metadata (model name, default parameters, capabilities, etc.) that ships with a provider package, largely powered by the [models.dev](https://models.dev/) project. Providers that include model profiles have their models listed automatically in the interactive `/model` switcher, subject to the [filtering criteria](#which-models-appear-in-the-switcher) (notably, `tool_calling` must be enabled). Providers without model profiles require you to specify the model name directly or add models via `config.toml`.
</Tip>

### Switching models

To switch models in the CLI, either:

1. **Use the interactive model switcher** with the `/model` command. This displays available models sourced from each installed LangChain provider package's [model profiles](/oss/python/langchain/models#model-profiles).

   <Note>
     These profiles are not an exhaustive list of available models. If the model you want isn't shown, use option 2 instead (useful for newly released models that haven't been added to the profiles yet). See [Which models appear in the switcher](#which-models-appear-in-the-switcher) for the full set of criteria.
   </Note>
2. **Specify a model name directly** as an argument, e.g. `/model openai:gpt-4o`. You can use any model supported by the chosen provider, regardless of whether it appears in the list from option 1. The model name will be passed to the API request.
3. **Specify the model at launch** via `--model`, e.g.

   ```txt theme={null}
   deepagents --model openai:gpt-4o
   ```

### Which models appear in the switcher

The interactive `/model` selector builds its list dynamically—it is not a hardcoded list baked into the CLI. A model appears in the switcher when **all** of the following are true:

1. **The provider package is installed.** Each provider (e.g. `langchain-anthropic`, `langchain-openai`) must be installed alongside `deepagents-cli`—either as an [install extra](/oss/python/deepagents/cli/providers#quick-start) (e.g. `uv tool install 'deepagents-cli[anthropic]'`) or added later with `uv tool upgrade deepagents-cli --with <package>`. If a package is missing, its entire provider section is absent from the switcher.
2. **The model has a profile with `tool_calling` enabled.** The CLI is a tool-calling agent, so it filters out models that don't support tool calling, as indicated in their profile data. This is the most common reason a model is missing from the list. For providers that don't bundle profiles (see the [Provider reference](#provider-reference) table), you can define one in `config.toml`:

   ```toml theme={null}
   [models.providers.ollama.profile."qwen3:4b"]
   tool_calling = true
   max_input_tokens = 32768
   max_output_tokens = 8192
   ```

   This is not strictly required for the model to appear in the switcher — adding it to the [`models` list](/oss/python/deepagents/cli/configuration#adding-models-to-the-interactive-switcher) also works and is simpler. A profile is useful when you want the CLI to know the model's context window and capabilities for features like auto-summarization. See [Profile overrides](/oss/python/deepagents/cli/configuration#profile-overrides) for all overridable fields.
3. **The model accepts and produces text.** Models whose profile explicitly sets `text_inputs` or `text_outputs` to `false` (e.g. embedding or image-generation models) are excluded.

Models defined in `config.toml` under [`[models.providers.<name>].models`](/oss/python/deepagents/cli/configuration#adding-models-to-the-interactive-switcher) bypass the profile filter—they always appear in the switcher regardless of profile metadata. This is the recommended way to add models that are missing from the list.

<Tip>
  Credential status does **not** affect whether a model is listed. The switcher shows all qualifying models and displays a credential indicator next to each provider header: a checkmark for confirmed credentials, a warning for missing credentials, or a question mark when credential status is unknown. You can still select a model with missing credentials—the provider will report an authentication error at request time.
</Tip>

#### Troubleshooting missing models

| Symptom                                   | Likely cause                                                 | Fix                                                                                                               |
| ----------------------------------------- | ------------------------------------------------------------ | ----------------------------------------------------------------------------------------------------------------- |
| Entire provider missing from switcher     | Provider package not installed                               | Install the package (e.g. `uv tool upgrade deepagents-cli --with langchain-groq`)                                 |
| Provider shown but specific model missing | Model profile has `tool_calling: false` or no profile exists | Add the model to `[models.providers.<name>].models` in `config.toml`, or use `/model <provider>:<model>` directly |
| Provider shows ⚠ "missing credentials"    | API key env var not set                                      | Set the credential env var from the [Provider reference](#provider-reference) table                               |
| Provider shows ? "credentials unknown"    | Provider uses non-standard auth that the CLI can't verify    | Credentials may still work—try switching to the model. If auth fails, check the provider's docs                   |

### Setting a default model

You can set a persistent default model that will be used for all future CLI launches:

* **Via model selector:** Open `/model`, navigate to the desired model, and press `Ctrl+S` to pin it as the default. Pressing `Ctrl+S` again on the current default clears it.
* **Via command:** `/model --default provider:model` (e.g., `/model --default anthropic:claude-opus-4-6`)
* **Via config file:** Set `[models].default` in `~/.deepagents/config.toml` (see [Configuration](/oss/python/deepagents/cli/configuration)).
* **From the shell:**

  ```bash theme={null}
  deepagents --default-model anthropic:claude-opus-4-6
  ```

To view the current default:

```bash theme={null}
deepagents --default-model
```

To clear the default:

* **From the shell:**

  ```bash theme={null}
  deepagents --clear-default-model
  ```

* **Via command:** `/model --default --clear`

* **Via model selector:** Press `Ctrl+S` on the currently pinned default model.

Without a default, the CLI will default to the most recently used model.

### Model resolution order

When the CLI launches, it resolves which model to use in the following order:

1. **`--model` flag** always wins when provided.
2. **`[models].default`** in `~/.deepagents/config.toml`—The user's intentional long-term preference.
3. **`[models].recent`** in `~/.deepagents/config.toml`—The last model switched to via `/model`. Written automatically; never overwrites `[models].default`.
4. **Environment auto-detection**: Falls back to the first available startup credential, checked in order: `OPENAI_API_KEY`, `ANTHROPIC_API_KEY`, `GOOGLE_API_KEY`, `GOOGLE_CLOUD_PROJECT` (Vertex AI).

This startup fallback intentionally checks only those four credentials. Other supported providers (for example, Groq) are still available via `--model`, `/model`, and saved defaults (`[models].default` / `[models].recent`).

### Model routers and proxies

Model routers like [OpenRouter](https://openrouter.ai/) and [LiteLLM](https://docs.litellm.ai/) provide access to models from multiple providers through a single endpoint.

Use the dedicated integration packages for these services:

| Router     | Package                                                            | Config                                                                         |
| ---------- | ------------------------------------------------------------------ | ------------------------------------------------------------------------------ |
| OpenRouter | [`langchain-openrouter`](/oss/python/integrations/chat/openrouter) | `openrouter:<model>` (built-in, see [Provider reference](#provider-reference)) |
| LiteLLM    | [`langchain-litellm`](/oss/python/integrations/chat/litellm)       | `litellm:<model>` (built-in, see [Provider reference](#provider-reference))    |

**OpenRouter** is a built-in provider—install the package and use it directly:

```bash theme={null}
uv tool install 'deepagents-cli[openrouter]'
```

**LiteLLM** is also a built-in provider:

```bash theme={null}
uv tool install 'deepagents-cli[litellm]'
```

***

## Advanced configuration

For detailed configuration of provider params, profile overrides, custom base URLs, compatible APIs, arbitrary providers, and lifecycle hooks, see [Configuration](/oss/python/deepagents/cli/configuration).

***

<div className="source-links">
  <Callout icon="edit">
    [Edit this page on GitHub](https://github.com/langchain-ai/docs/edit/main/src/oss/deepagents/cli/providers.mdx) or [file an issue](https://github.com/langchain-ai/docs/issues/new/choose).
  </Callout>

  <Callout icon="terminal-2">
    [Connect these docs](/use-these-docs) to Claude, VSCode, and more via MCP for real-time answers.
  </Callout>
</div>
