Skip to main content

What are Reasoning Models?

Reasoning models are designed for:
  • Complex mathematics
  • Multi-step problem solving
  • Logical reasoning
  • Code debugging
  • Scientific analysis

Example

import os
from openai import OpenAI

client = OpenAI(
    api_key=os.environ["CHEAPESTINFERENCE_API_KEY"],
    base_url="https://api.cheapestinference.ai/v1",
)

response = client.chat.completions.create(
    model="deepseek/deepseek-r1",
    messages=[
        {
            "role": "user",
            "content": """
            Solve step by step:
            A train travels from City A to City B at 60 mph.
            It then travels from City B to City C at 40 mph.
            The distance from A to B is 180 miles.
            The distance from B to C is 120 miles.
            What is the average speed for the entire journey?
            """
        }
    ],
    temperature=0.7
)

print(response.choices[0].message.content)

Best Practices

  • Give models space to “think” by requesting step-by-step solutions
  • Use lower temperatures (0.3-0.7) for more focused reasoning
  • Provide clear problem statements
  • Allow for intermediate steps in responses