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

# Models

> Configure model providers and parameters for Deep Agents

Deep Agents work with any [LangChain chat model](/oss/javascript/langchain/models) that supports [tool calling](/oss/javascript/langchain/models#tool-calling).

## Supported models

Specify models in `provider:model` format (for example, `google_genai:gemini-3.1-pro-preview`, `openai:gpt-5.4`, or `anthropic:claude-sonnet-4-6`). The provider prefix selects the LangChain integration, and everything after the colon is passed through to that provider as the model identifier. For valid provider strings, see the `model_provider` parameter of [`init_chat_model`](https://reference.langchain.com/javascript/langchain/chat_models/universal/initChatModel). For provider-specific configuration, see [chat model integrations](/oss/javascript/integrations/chat).

The model identifier must match the format expected by the provider. Some providers use simple names like `gpt-5.4`; others use namespaced IDs or deployment paths like `zai-org/GLM-5.1`, so the full Deep Agents string would be `baseten:zai-org/GLM-5.1`. Check the provider's model catalog or integration docs for the current identifiers.

### Suggested models

These models perform well on the [Deep Agents eval suite](https://github.com/langchain-ai/deepagents/tree/main/libs/evals#readme), which tests basic agent operations. Passing these evals is necessary but not sufficient for strong performance on longer, more complex tasks.

| Provider                                                      | Models                                                                                                                                   |
| ------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- |
| [Google](/oss/javascript/integrations/providers/google)       | `gemini-3.1-pro-preview`, `gemini-3-flash-preview`                                                                                       |
| [OpenAI](/oss/javascript/integrations/providers/openai)       | `gpt-5.4`, `gpt-4o`, `gpt-5.4`, `o4-mini`, `gpt-5.2-codex`, `gpt-4o-mini`, `o3`                                                          |
| [Anthropic](/oss/javascript/integrations/providers/anthropic) | `claude-opus-4-6`, `claude-opus-4-5`, `claude-sonnet-4-6`, `claude-sonnet-4`, `claude-sonnet-4-5`, `claude-haiku-4-5`, `claude-opus-4-1` |
| Open-weight                                                   | `GLM-5`, `Kimi-K2.5`, `MiniMax-M2.5`, `qwen3.5-397B-A17B`, `devstral-2-123B`                                                             |

Open-weight models are available through providers like [OpenRouter](/oss/javascript/integrations/chat/openrouter), [Fireworks](/oss/javascript/integrations/chat/fireworks) or [Ollama](/oss/javascript/integrations/chat/ollama).

### Model evaluations

The [Deep Agents eval suite](https://github.com/langchain-ai/deepagents/tree/main/libs/evals#readme) tests popular models:

<div className="deepagents-eval-category-matrix">
  | Model                                        |                                                                        File Ops |                                                                       Retrieval |                                                                       Tool Use |                                                                         Memory |                                                                   Conversation |                                                                   Summarization |
  | :------------------------------------------- | ------------------------------------------------------------------------------: | ------------------------------------------------------------------------------: | -----------------------------------------------------------------------------: | -----------------------------------------------------------------------------: | -----------------------------------------------------------------------------: | ------------------------------------------------------------------------------: |
  | google\_genai:gemini-3.1-pro-preview         | **[100%](https://github.com/langchain-ai/deepagents/actions/runs/25234719085)** | **[100%](https://github.com/langchain-ai/deepagents/actions/runs/25234686782)** |     [25%](https://github.com/langchain-ai/deepagents/actions/runs/25234699517) |     [54%](https://github.com/langchain-ai/deepagents/actions/runs/25290479270) |     [48%](https://github.com/langchain-ai/deepagents/actions/runs/24113831669) |      [80%](https://github.com/langchain-ai/deepagents/actions/runs/25235579950) |
  | openai:gpt-5.4                               | **[100%](https://github.com/langchain-ai/deepagents/actions/runs/24172638583)** | **[100%](https://github.com/langchain-ai/deepagents/actions/runs/24172638583)** |     [18%](https://github.com/langchain-ai/deepagents/actions/runs/24906955930) |     [51%](https://github.com/langchain-ai/deepagents/actions/runs/24172638583) |     [38%](https://github.com/langchain-ai/deepagents/actions/runs/24425363630) | **[100%](https://github.com/langchain-ai/deepagents/actions/runs/24172638583)** |
  | openai:gpt-5.5                               |      [92%](https://github.com/langchain-ai/deepagents/actions/runs/25234719085) | **[100%](https://github.com/langchain-ai/deepagents/actions/runs/25234686782)** |     [20%](https://github.com/langchain-ai/deepagents/actions/runs/25234699517) |     [64%](https://github.com/langchain-ai/deepagents/actions/runs/25232371743) | **[52%](https://github.com/langchain-ai/deepagents/actions/runs/25232371743)** |      [80%](https://github.com/langchain-ai/deepagents/actions/runs/25235579950) |
  | anthropic:claude-opus-4-6                    |      [92%](https://github.com/langchain-ai/deepagents/actions/runs/24172638583) | **[100%](https://github.com/langchain-ai/deepagents/actions/runs/24172638583)** |     [26%](https://github.com/langchain-ai/deepagents/actions/runs/24906955930) | **[69%](https://github.com/langchain-ai/deepagents/actions/runs/24172638583)** |     [22%](https://github.com/langchain-ai/deepagents/actions/runs/24363491527) | **[100%](https://github.com/langchain-ai/deepagents/actions/runs/24172638583)** |
  | anthropic:claude-opus-4-7                    | **[100%](https://github.com/langchain-ai/deepagents/actions/runs/25234719085)** | **[100%](https://github.com/langchain-ai/deepagents/actions/runs/25234686782)** |     [18%](https://github.com/langchain-ai/deepagents/actions/runs/25234699517) |                                                                              — | **[52%](https://github.com/langchain-ai/deepagents/actions/runs/24911513545)** | **[100%](https://github.com/langchain-ai/deepagents/actions/runs/25235579950)** |
  | baseten:moonshotai/Kimi-K2.6                 | **[100%](https://github.com/langchain-ai/deepagents/actions/runs/25234719085)** | **[100%](https://github.com/langchain-ai/deepagents/actions/runs/25234686782)** |     [20%](https://github.com/langchain-ai/deepagents/actions/runs/25234699517) |                                                                              — |                                                                              — |      [60%](https://github.com/langchain-ai/deepagents/actions/runs/25235579950) |
  | baseten:zai-org/GLM-5                        |      [92%](https://github.com/langchain-ai/deepagents/actions/runs/24106499785) | **[100%](https://github.com/langchain-ai/deepagents/actions/runs/24106499785)** | **[87%](https://github.com/langchain-ai/deepagents/actions/runs/24106499785)** |     [44%](https://github.com/langchain-ai/deepagents/actions/runs/23872647281) |     [29%](https://github.com/langchain-ai/deepagents/actions/runs/24106499785) |      [60%](https://github.com/langchain-ai/deepagents/actions/runs/24106499785) |
  | ollama:minimax-m2.7:cloud                    |      [92%](https://github.com/langchain-ai/deepagents/actions/runs/24106499785) |      [90%](https://github.com/langchain-ai/deepagents/actions/runs/24106499785) |     [82%](https://github.com/langchain-ai/deepagents/actions/runs/24106499785) |     [38%](https://github.com/langchain-ai/deepagents/actions/runs/23872647281) |     [29%](https://github.com/langchain-ai/deepagents/actions/runs/24106499785) |      [60%](https://github.com/langchain-ai/deepagents/actions/runs/24106499785) |
  | openrouter:deepseek/deepseek-v4-pro          | **[100%](https://github.com/langchain-ai/deepagents/actions/runs/25234719085)** | **[100%](https://github.com/langchain-ai/deepagents/actions/runs/25234686782)** |     [25%](https://github.com/langchain-ai/deepagents/actions/runs/25234699517) |                                                                              — |                                                                              — |      [80%](https://github.com/langchain-ai/deepagents/actions/runs/25235579950) |
  | openrouter:minimax/minimax-m2.7              |      [92%](https://github.com/langchain-ai/deepagents/actions/runs/25234719085) | **[100%](https://github.com/langchain-ai/deepagents/actions/runs/25234686782)** |     [20%](https://github.com/langchain-ai/deepagents/actions/runs/25234699517) |                                                                              — |                                                                              — |      [60%](https://github.com/langchain-ai/deepagents/actions/runs/25235579950) |
  | openrouter:nvidia/nemotron-3-super-120b-a12b |       [0%](https://github.com/langchain-ai/deepagents/actions/runs/23874487832) |       [0%](https://github.com/langchain-ai/deepagents/actions/runs/23874487832) |      [0%](https://github.com/langchain-ai/deepagents/actions/runs/23874487832) |      [0%](https://github.com/langchain-ai/deepagents/actions/runs/23874487832) |      [0%](https://github.com/langchain-ai/deepagents/actions/runs/23874487832) |       [0%](https://github.com/langchain-ai/deepagents/actions/runs/23874487832) |
  | openrouter:z-ai/glm-5.1                      |      [92%](https://github.com/langchain-ai/deepagents/actions/runs/25234719085) | **[100%](https://github.com/langchain-ai/deepagents/actions/runs/25234686782)** |     [25%](https://github.com/langchain-ai/deepagents/actions/runs/25234699517) |                                                                              — |     [33%](https://github.com/langchain-ai/deepagents/actions/runs/25225620506) |      [80%](https://github.com/langchain-ai/deepagents/actions/runs/25235579950) |
</div>

For more information, see the [Eval runs](https://github.com/langchain-ai/deepagents/actions/workflows/evals.yml).

## Configure model parameters

Pass a model string to [`createDeepAgent`](https://reference.langchain.com/javascript/deepagents/agent/createDeepAgent) in `provider:model` format, or pass a configured model instance for full control. Under the hood, model strings are resolved via [`init_chat_model`](https://reference.langchain.com/javascript/langchain/chat_models/universal/initChatModel).

To configure model-specific parameters, use [`init_chat_model`](https://reference.langchain.com/javascript/langchain/chat_models/universal/initChatModel) or instantiate a provider model class directly:

<CodeGroup>
  ```typescript initChatModel theme={"theme":{"light":"catppuccin-latte","dark":"catppuccin-mocha"}}
  import { initChatModel } from "langchain/chat_models/universal";
  import { createDeepAgent } from "deepagents";

  const model = await initChatModel("google_genai:gemini-3.1-pro-preview", {
      reasoningEffort: "medium",  // [!code highlight]
  });
  const agent = createDeepAgent({ model });
  ```

  ```typescript Provider package theme={"theme":{"light":"catppuccin-latte","dark":"catppuccin-mocha"}}
  import { ChatGoogle } from "@langchain/google";
  import { createDeepAgent } from "deepagents";

  const model = new ChatGoogle({
      model: "gemini-3.1-pro-preview",
      reasoningEffort: "medium",  // [!code highlight]
  });
  const agent = createDeepAgent({ model });
  ```
</CodeGroup>

<Note>
  Available parameters vary by provider. See the [chat model integrations](/oss/javascript/integrations/chat) page for provider-specific configuration options.
</Note>

### Provider profiles

A [`ProviderProfile`](/oss/javascript/deepagents/profiles#provider-profiles) packages initialization parameters that apply when you provide a `provider:model` string when creating the deep agent. It does not apply when you pass a preconfigured model with [`init_chat_model`](https://reference.langchain.com/javascript/langchain/chat_models/universal/initChatModel).

You can register at two levels, and both can coexist:

* **Provider level** — a bare provider key like `"openai"` applies to every model from the `openai` provider.
* **Model level** — a `provider:model` key like `"openai:gpt-5.4"` applies only to that specific model, and merges on top of any matching provider-level profile.

```python theme={"theme":{"light":"catppuccin-latte","dark":"catppuccin-mocha"}}
from deepagents import ProviderProfile, register_provider_profile

# Provider-wide default: every openai model gets temperature=0.
register_provider_profile(
    "openai",
    ProviderProfile(init_kwargs={"temperature": 0}),
)

# Model-level override: gpt-5.4 additionally gets a specific reasoning effort.
# Inherits temperature=0 from the provider-level profile above.
register_provider_profile(
    "openai:gpt-5.4",
    ProviderProfile(init_kwargs={"reasoning_effort": "medium"}),
)
```

See [Profiles](/oss/javascript/deepagents/profiles) for the full field list, merge semantics, and plugin packaging.

<Tip>
  For shaping how the *agent* behaves once the model is built, use a [harness profile](/oss/javascript/deepagents/profiles#harness-profiles).
</Tip>

## Select a model at runtime

If your application lets users choose a model (for example using a dropdown in the UI), use [middleware](/oss/javascript/langchain/middleware) to swap the model at runtime without rebuilding the agent.

```typescript theme={"theme":{"light":"catppuccin-latte","dark":"catppuccin-mocha"}}
import { initChatModel, createMiddleware } from "langchain";
import { createDeepAgent } from "deepagents";
import * as z from "zod";

const contextSchema = z.object({
  model: z.string(),
});

const configurableModel = createMiddleware({
  name: "ConfigurableModel",
  wrapModelCall: async (request, handler) => {
    const modelName = request.runtime.context.model;
    const model = await initChatModel(modelName);
    return handler({ ...request, model });
  },
});

const agent = await createDeepAgent({
  model: "google_genai:gemini-3.1-pro-preview",
  middleware: [configurableModel],
  contextSchema,
});

// Invoke with the user's model selection
const result = await agent.invoke(
  { messages: [{ role: "user", content: "Hello!" }] },
  { context: { model: "openai:gpt-5.4" } },
);
```

<Tip>
  For more dynamic model patterns (for example routing based on conversation complexity or cost optimization), see [Dynamic model](/oss/javascript/langchain/agents#dynamic-model) in the LangChain agents guide.
</Tip>

## Learn more

* [Models in LangChain](/oss/javascript/langchain/models): chat model features including tool calling, structured output, and multimodality

***

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

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