本页还没有译文
本页 35 段还没译成日本語,下面显示的是英文原文。Models
还没翻译译自英文(docs.langchain.com)本页 35 段都还没译
Deep Agents work with any LangChain chat model that supports tool calling.
Supported models
Specify models in provider:model format (for example, google:gemini-3.6-flash, 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 initChatModel. For provider-specific configuration, see chat model integrations.
The model identifier must match the format expected by the provider. Some providers use simple names like gpt-5.5; others use namespaced IDs or deployment paths like zai-org/GLM-5.2, so the full Deep Agents string would be baseten:zai-org/GLM-5.2. 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, which tests basic agent operations. Passing these evals is necessary but not sufficient for strong performance on longer, more complex tasks.
| Provider | Models |
|---|---|
gemini-3.1-pro-preview, gemini-3.6-flash | |
| OpenAI | gpt-5.5, gpt-5.4 |
| Anthropic | claude-opus-4-8, claude-opus-4-7, claude-opus-4-6 |
| Open-weight | GLM-5.2, Kimi-K2.7 Code, MiniMax-M3 |
Open-weight models are available through providers like OpenRouter and Ollama.
Model evaluations
The Deep Agents eval suite tests popular models:
| Model | Overall | File Ops | Retrieval | Tool Use | Memory | Conversation | Summarization |
|---|---|---|---|---|---|---|---|
| google_genai:gemini-3.6-flash | 82% | 100% | 100% | 90% | 54% | 38% | 80% |
| openai:gpt-5.4 | 18% | 100% | 100% | 18% | 51% | 38% | 100% |
| openai:gpt-5.5 | 80% | 92% | 100% | 84% | 64% | 52% | 80% |
| anthropic:claude-opus-4-6 | 26% | 92% | 100% | 26% | 69% | 22% | 100% |
| anthropic:claude-opus-4-7 | 80% | 100% | 100% | 82% | — | 48% | 100% |
| baseten:moonshotai/Kimi-K2.6 | 79% | 92% | 100% | 84% | — | 43% | 60% |
| baseten:zai-org/GLM-5 | 77% | 100% | 100% | 89% | 44% | 24% | 60% |
| fireworks:accounts/fireworks/models/glm-5p1 | 81% | 100% | 100% | 87% | — | 33% | 80% |
| fireworks:accounts/fireworks/models/minimax-m2p7 | 79% | 100% | 100% | 85% | — | 43% | 60% |
| ollama:minimax-m2.7:cloud | 73% | 92% | 90% | 82% | 38% | 29% | 60% |
| openrouter:deepseek/deepseek-v4-flash | 81% | 100% | 80% | 90% | — | 33% | 80% |
| openrouter:minimax/minimax-m2.7 | 80% | 92% | 100% | 89% | — | 43% | 60% |
| openrouter:z-ai/glm-5.1 | 89% | 92% | 100% | 89% | — | 33% | 80% |
For more information, see the Eval runs.
Configure model parameters
Pass a model string to 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.
To configure model-specific parameters, use init_chat_model or instantiate a provider model class directly:
import { initChatModel } from "langchain/chat_models/universal";
import { createDeepAgent } from "deepagents";
const model = await initChatModel("google:gemini-3.6-flash", {
reasoningEffort: "medium", // [!code highlight]
});
const agent = createDeepAgent({ model });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 });Note
Available parameters vary by provider. See the chat model integrations page for provider-specific configuration options.
Provider profiles
A ProviderProfile 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.
You can register at two levels, and both can coexist:
- Provider level: a bare provider key like
"openai"applies to every model from theopenaiprovider. - Model level: a
provider:modelkey like"openai:gpt-5.4"applies only to that specific model, and merges on top of any matching provider-level profile.
See 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.
OpenAI and the Responses API
When you pass an openai:... string as the model, Deep Agents uses the built-in OpenAI provider profile to enable the Responses API by default. That path supports OpenAI conversation state and related features; see the OpenAI provider and chat model docs for current API options.
Note
The built-in OpenAI provider profile applies only to model strings. To set kwargs such as use_responses_api, store, or include, pass a configured model instance, or, in Python, layer them through a provider profile init_kwargs. Build the instance with init_chat_model (Python) or initChatModel / ChatOpenAI (TypeScript).
Use the OpenAI chat integration to choose the Responses API versus Chat Completions (useResponsesApi, model kwargs, and any storage or output options your version exposes). Pass the resulting model instance to createDeepAgent({ model }) so those settings are preserved.
Select a model at runtime
If your application lets users choose a model (for example using a dropdown in the UI), use middleware to swap the model at runtime without rebuilding the agent.
import { createMiddleware, initChatModel } 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:gemini-3.6-flash",
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.5" } },
);Open a public LangSmith run for this example.
Tip
For more dynamic model patterns (for example routing based on conversation complexity or cost optimization), see Dynamic model in the LangChain agents guide.
Learn more
- Models in LangChain: chat model features including tool calling, structured output, and multimodality