From 918ba6b5bfafc34c6ccc6b0660d746b82670008e Mon Sep 17 00:00:00 2001 From: Frank <97429702+tsubasakong@users.noreply.github.com> Date: Fri, 13 Mar 2026 07:12:30 -0700 Subject: [PATCH] docs: clarify OpenRouter configuration (#1123) Co-authored-by: Willem Jiang --- README.md | 11 ++++++++++- backend/docs/CONFIGURATION.md | 11 ++++++++++- config.example.yaml | 11 +++++++++++ 3 files changed, 31 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 36e8434..e8aca44 100644 --- a/README.md +++ b/README.md @@ -94,9 +94,17 @@ DeerFlow has newly integrated the intelligent search and crawling toolset indepe api_key: $OPENAI_API_KEY # API key (recommended: use env var) max_tokens: 4096 # Maximum tokens per request temperature: 0.7 # Sampling temperature + + - name: openrouter-gemini-2.5-flash + display_name: Gemini 2.5 Flash (OpenRouter) + use: langchain_openai:ChatOpenAI + model: google/gemini-2.5-flash-preview + api_key: $OPENAI_API_KEY # OpenRouter still uses the OpenAI-compatible field name here + base_url: https://openrouter.ai/api/v1 ``` - + OpenRouter and similar OpenAI-compatible gateways should be configured with `langchain_openai:ChatOpenAI` plus `base_url`. If you prefer a provider-specific environment variable name, point `api_key` at that variable explicitly (for example `api_key: $OPENROUTER_API_KEY`). + 4. **Set API keys for your configured model(s)** Choose one of the following methods: @@ -107,6 +115,7 @@ DeerFlow has newly integrated the intelligent search and crawling toolset indepe ```bash TAVILY_API_KEY=your-tavily-api-key OPENAI_API_KEY=your-openai-api-key + # OpenRouter also uses OPENAI_API_KEY when your config uses langchain_openai:ChatOpenAI + base_url. # Add other provider keys as needed INFOQUEST_API_KEY=your-infoquest-api-key ``` diff --git a/backend/docs/CONFIGURATION.md b/backend/docs/CONFIGURATION.md index f82d763..2961dc1 100644 --- a/backend/docs/CONFIGURATION.md +++ b/backend/docs/CONFIGURATION.md @@ -25,7 +25,7 @@ models: - DeepSeek (`langchain_deepseek:ChatDeepSeek`) - Any LangChain-compatible provider -For OpenAI-compatible gateways (for example Novita), keep using `langchain_openai:ChatOpenAI` and set `base_url`: +For OpenAI-compatible gateways (for example Novita or OpenRouter), keep using `langchain_openai:ChatOpenAI` and set `base_url`: ```yaml models: @@ -40,8 +40,17 @@ models: extra_body: thinking: type: enabled + + - name: openrouter-gemini-2.5-flash + display_name: Gemini 2.5 Flash (OpenRouter) + use: langchain_openai:ChatOpenAI + model: google/gemini-2.5-flash-preview + api_key: $OPENAI_API_KEY + base_url: https://openrouter.ai/api/v1 ``` +If your OpenRouter key lives in a different environment variable name, point `api_key` at that variable explicitly (for example `api_key: $OPENROUTER_API_KEY`). + **Thinking Models**: Some models support "thinking" mode for complex reasoning: diff --git a/config.example.yaml b/config.example.yaml index eb08898..ec77c6b 100644 --- a/config.example.yaml +++ b/config.example.yaml @@ -106,6 +106,17 @@ models: # thinking: # type: enabled + # Example: OpenRouter (OpenAI-compatible) + # OpenRouter models use the same ChatOpenAI + base_url pattern as other OpenAI-compatible gateways. + # - name: openrouter-gemini-2.5-flash + # display_name: Gemini 2.5 Flash (OpenRouter) + # use: langchain_openai:ChatOpenAI + # model: google/gemini-2.5-flash-preview + # api_key: $OPENAI_API_KEY + # base_url: https://openrouter.ai/api/v1 + # max_tokens: 8192 + # temperature: 0.7 + # ============================================================================ # Tool Groups Configuration # ============================================================================