Get startedGet started for free

Getting the model to think

DeepSeek V4-Pro reasons by default! For the chat-style tasks you've done so far, the model returns a clean final answer; for deeper tasks like data analysis, code debugging, math, or research, it works through the problem step-by-step before answering.

In this exercise, you'll send V4-Pro a typical math problem that might be presented to high-school math students and let its default reasoning do the work.

> math_problem

Calculate the area of a house in m^2 comprised of two rooms of sizes 3mx2m and 4mx5m.

This exercise is part of the course

Working with DeepSeek in Python

View Course

Exercise instructions

  • Create a request to send the math_problem prompt to the "deepseek-ai/DeepSeek-V4-Pro" model via the Chat Completions endpoint.

Hands-on interactive exercise

Have a go at this exercise by completing this sample code.

client = OpenAI(api_key="", base_url="https://api.together.xyz/v1")

# Create a request to the model — reasoning runs by default
response = client.chat.completions.____(
    model="deepseek-ai/____",
    max_tokens=400,
    messages=[
        {"role": "user", 
         "content": ____}]
)

print(response.choices[0].message.content)
Edit and Run Code