Skip to main content
DeerFlow supports multiple LLM providers through a flexible model configuration system. You can configure multiple models and switch between them based on your needs.

Configuration Structure

Models are configured in the models section of config.yaml:
config.yaml

Required Fields

string
required
Unique identifier for the model. Used in API calls and UI selection.
string
required
Import path to the LangChain chat model class. Format: module.path:ClassNameExamples:
  • langchain_openai:ChatOpenAI
  • langchain_anthropic:ChatAnthropic
  • langchain_google_genai:ChatGoogleGenerativeAI
  • src.models.patched_deepseek:PatchedChatDeepSeek
string
required
The model identifier expected by the provider (e.g., gpt-4, claude-3-5-sonnet-20241022)

Optional Fields

string
Human-readable name shown in the UI. Defaults to the name field if not specified.
string
Optional description of the model’s capabilities or use case.
string
API key for the provider. Always use environment variables (e.g., $OPENAI_API_KEY) to avoid committing secrets.
integer
Maximum number of tokens to generate in responses.
float
Sampling temperature (0.0 to 2.0). Lower values are more deterministic, higher values more creative.
string
Custom API endpoint URL. Required for OpenAI-compatible providers.Example: https://api.novita.ai/openai
string
Alternative field name for base URL (used by some providers like DeepSeek).

Advanced Features

Vision Support

boolean
default:"false"
Enable the model to process images. When enabled, the agent can use tools like view_image.

Thinking/Reasoning Support

boolean
default:"false"
Enable extended reasoning mode (for models like DeepSeek-R1, o1).
object
Additional parameters passed to the model when thinking mode is enabled.
The when_thinking_enabled configuration varies by provider. Check your provider’s documentation for the correct format.

Reasoning Effort

boolean
default:"false"
Enable adjustable reasoning effort levels (for models that support it).

Provider Examples

OpenAI

Anthropic Claude

Google Gemini

Google models use google_api_key instead of api_key

DeepSeek (with Thinking)

Novita AI (OpenAI-Compatible)

Volcengine Doubao

Moonshot Kimi

Model Selection

The first model in the models list is used as the default model for:
  • Conversation responses
  • Title generation (unless overridden)
  • Summarization (unless overridden)
  • Memory updates (unless overridden)

Programmatic Access

Access model configuration in Python:

Best Practices

Never hardcode API keys in configuration files. Always use environment variables:
Set up multiple models for different use cases:
  • Fast, cost-effective model as default
  • Powerful model for complex tasks
  • Vision-enabled model for image processing
  • Thinking model for reasoning tasks
Configure max_tokens based on your use case:
  • Lower values (1000-4000) for quick interactions
  • Higher values (8000+) for code generation and long documents
Not all models support vision. Test image processing capabilities before enabling:

Environment Variables Reference

Common environment variables for model configuration:

Troubleshooting

This error occurs when a referenced environment variable is not set:
Install the required LangChain provider package:
Check the provider’s documentation for supported features. Not all models support vision or extended reasoning.Set the flags correctly:

Next Steps

Sandbox Configuration

Configure execution environments

Tools Configuration

Set up tools and capabilities