Skip to content
This repository was archived by the owner on May 15, 2026. It is now read-only.
This repository was archived by the owner on May 15, 2026. It is now read-only.

[ENHANCEMENT] Request to support DeepSeek V4 flash and V4 pro models #12173

Open
Zoo-Code-Org/Zoo-Code
#6

Description

@kavehsfv

Problem (one or two sentences)

Could you please add V4 flash and V4 pro models to DeepSeek provider as they released them today?

There are two options of thinking and non-thinking modes and suporting of 'high' and 'max' in thinking mode.
You may follow their official website guidance.
link: https://api-docs.deepseek.com/guides/thinking_mode

Context (who is affected and when)

All users

Desired behavior (conceptual, not technical)

,

Constraints / preferences (optional)

No response

Request checklist

  • I've searched existing Issues and Discussions for duplicates
  • This describes a specific problem with clear context and impact

Roo Code Task Links (optional)

No response

Acceptance criteria (optional)

No response

Proposed approach (optional)

No response

Trade-offs / risks (optional)

No response

Activity

  1. binggee9526 commented on Apr 24, 2026

    @binggee9526

    There are informations of DeepSeek V4 model. @roomote

    1. New model IDs are deepseek-v4-flash and deepseek-v4-pro.
    2. Yes.It's same thinking: { type: "enabled" } parameter as the current reasoner of V4 mode.The parameter reasoning can select high or max.It's deault as high. ref https://api-docs.deepseek.com/
    {
            "model": "deepseek-v4-pro",
            "messages": [
              {"role": "system", "content": "You are a helpful assistant."},
              {"role": "user", "content": "Hello!"}
            ],
            "thinking": {"type": "enabled"},
            "reasoning_effort": "high",
            "stream": false
          }

    3.about price and contex
    for deepseek-v4-flash :

    • pricing:1M INPUT TOKENS (CACHE HIT) | $0.028
      1M INPUT TOKENS (CACHE MISS) | $0.14
      1M OUTPUT TOKENS | $0.28
    • context window size: 1M
    • max output:384K

    for deepseek-v4-pro :

    • pricing:1M INPUT TOKENS (CACHE HIT) | $0.145
      1M INPUT TOKENS (CACHE MISS) | $1.74
      1M OUTPUT TOKENS | $3.48
    • context window size: 1M
    • max output:384K

    ref https://api-docs.deepseek.com/quick_start/pricing

  2. JiayunLi-3E8 commented on Apr 24, 2026

    @JiayunLi-3E8

    Opened PR #12175 with my attempt at adding deepseek-v4-flash and deepseek-v4-pro support, including optional thinking mode with reasoning_effort parameter. Feedback welcome! #12175

    It's important to note that the Thinking Mode is enabled by default in the Deepseek API. Therefore, you need to explicitly declare the Thinking Mode on/off switch and the thinking intensity in your request ({"thinking": {"type": "enabled/disabled"}}, {"reasoning_effort": "high/max"}).

    Also, please note that unlike rounds in Thinking Mode where no tool calls are made, rounds in which tool calls are made must return the complete reasoning_content to the API in all subsequent requests. If your code does not return reasoning_content correctly, the API will return a 400 error.

    Below is a simple example code for making tool calls in Thinking Mode:

    import os
    import json
    from openai import OpenAI
    from datetime import datetime
    
    # The definition of the tools
    tools = [
        {
            "type": "function",
            "function": {
                "name": "get_date",
                "description": "Get the current date",
                "parameters": { "type": "object", "properties": {} },
            }
        },
        {
            "type": "function",
            "function": {
                "name": "get_weather",
                "description": "Get weather of a location, the user should supply the location and date.",
                "parameters": {
                    "type": "object",
                    "properties": {
                        "location": { "type": "string", "description": "The city name" },
                        "date": { "type": "string", "description": "The date in format YYYY-mm-dd" },
                    },
                    "required": ["location", "date"]
                },
            }
        },
    ]
    
    # The mocked version of the tool calls
    def get_date_mock():
        return datetime.now().strftime("%Y-%m-%d")
    
    def get_weather_mock(location, date):
        return "Cloudy 7~13°C"
    
    TOOL_CALL_MAP = {
        "get_date": get_date_mock,
        "get_weather": get_weather_mock
    }
    
    def run_turn(turn, messages):
        sub_turn = 1
        while True:
            response = client.chat.completions.create(
                model='deepseek-v4-pro',
                messages=messages,
                tools=tools,
                reasoning_effort="high",
                extra_body={ "thinking": { "type": "enabled" } },
            )
            messages.append(response.choices[0].message)
            reasoning_content = response.choices[0].message.reasoning_content
            content = response.choices[0].message.content
            tool_calls = response.choices[0].message.tool_calls
            print(f"Turn {turn}.{sub_turn}\n{reasoning_content=}\n{content=}\n{tool_calls=}")
            # If there is no tool calls, then the model should get a final answer and we need to stop the loop
            if tool_calls is None:
                break
            for tool in tool_calls:
                tool_function = TOOL_CALL_MAP[tool.function.name]
                tool_result = tool_function(**json.loads(tool.function.arguments))
                print(f"tool result for {tool.function.name}: {tool_result}\n")
                messages.append({
                    "role": "tool",
                    "tool_call_id": tool.id,
                    "content": tool_result,
                })
            sub_turn += 1
        print()
    
    client = OpenAI(
        api_key=os.environ.get('DEEPSEEK_API_KEY'),
        base_url=os.environ.get('DEEPSEEK_BASE_URL'),
    )
    
    # The user starts a question
    turn = 1
    messages = [{
        "role": "user",
        "content": "How's the weather in Hangzhou Tomorrow"
    }]
    run_turn(turn, messages)
    
    # The user starts a new question
    turn = 2
    messages.append({
        "role": "user",
        "content": "How's the weather in Guangzhou Tomorrow"
    })
    run_turn(turn, messages)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    EnhancementNew feature or request

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions