feat: Add llms to support the latest Open Source SOTA models (#497)

* fix: update README and configuration guide for new model support and reasoning capabilities

* fix: format code for consistency in agent and node files

* fix: update test cases for environment variable handling in llm configuration

* fix: refactor message chunk conversion functions for improved clarity and maintainability

* refactor: remove enable_thinking parameter from LLM configuration functions

* chore: update agent-LLM mapping for consistency

* chore: update LLM configuration handling for improved clarity

* test: add unit tests for Dashscope message chunk conversion and LLM configuration

* test: add unit tests for message chunk conversion in Dashscope

* test: add unit tests for message chunk conversion in Dashscope

* chore: remove unused imports from test_dashscope.py

---------

Co-authored-by: Willem Jiang <willem.jiang@gmail.com>
This commit is contained in:
CHANGXUBO
2025-08-13 22:29:22 +08:00
committed by GitHub
parent ea17e82514
commit d65b8f8fcc
6 changed files with 684 additions and 9 deletions

View File

@@ -15,7 +15,7 @@ In DeerFlow, we currently only support non-reasoning models. This means models l
### Supported Models
`doubao-1.5-pro-32k-250115`, `gpt-4o`, `qwen-max-latest`, `gemini-2.0-flash`, `deepseek-v3`, and theoretically any other non-reasoning chat models that implement the OpenAI API specification.
`doubao-1.5-pro-32k-250115`, `gpt-4o`, `qwen-max-latest`,`qwen3-235b-a22b`,`qwen3-coder`, `gemini-2.0-flash`, `deepseek-v3`, and theoretically any other non-reasoning chat models that implement the OpenAI API specification.
> [!NOTE]
> The Deep Research process requires the model to have a **longer context window**, which is not supported by all models.
@@ -57,7 +57,47 @@ BASIC_MODEL:
model: "gemini-2.0-flash"
api_key: YOUR_API_KEY
```
The following is a configuration example of `conf.yaml` for using best opensource OpenAI-Compatible models:
```yaml
# Use latest deepseek-v3 to handle basic tasks, the open source SOTA model for basic tasks
BASIC_MODEL:
base_url: https://api.deepseek.com
model: "deepseek-v3"
api_key: YOUR_API_KEY
temperature: 0.6
top_p: 0.90
# Use qwen3-235b-a22b to handle reasoning tasks, the open source SOTA model for reasoning
REASONING_MODEL:
base_url: https://dashscope.aliyuncs.com/compatible-mode/v1
model: "qwen3-235b-a22b-thinking-2507"
api_key: YOUR_API_KEY
temperature: 0.6
top_p: 0.90
# Use qwen3-coder-480b-a35b-instruct to handle coding tasks, the open source SOTA model for coding
CODE_MODEL:
base_url: https://dashscope.aliyuncs.com/compatible-mode/v1
model: "qwen3-coder-480b-a35b-instruct"
api_key: YOUR_API_KEY
temperature: 0.6
top_p: 0.90
```
In addition, you need to set the `AGENT_LLM_MAP` in `src/config/agents.py` to use the correct model for each agent. For example:
```python
# Define agent-LLM mapping
AGENT_LLM_MAP: dict[str, LLMType] = {
"coordinator": "reasoning",
"planner": "reasoning",
"researcher": "reasoning",
"coder": "basic",
"reporter": "basic",
"podcast_script_writer": "basic",
"ppt_composer": "basic",
"prose_writer": "basic",
"prompt_enhancer": "basic",
}
```
### How to use models with self-signed SSL certificates?
If your LLM server uses self-signed SSL certificates, you can disable SSL certificate verification by adding the `verify_ssl: false` parameter to your model configuration: