# Reasoning Models NeuraAI's reasoning models are designed to tackle complex problems by thinking through solutions step-by-step before responding. These models excel at mathematical reasoning, advanced coding challenges, scientific analysis, and multi-stage planning. ## How Reasoning Works Unlike standard language models that generate responses immediately, reasoning models create an internal chain of thought, exploring different approaches and evaluating solutions before providing their final answer. ## Available Models * **o4-mini** - Fast reasoning for everyday complex tasks * **gemini-2.5-pro** - Advanced reasoning for challenging problems ## Basic Example ```python from openai import OpenAI client = OpenAI( base_url="https://api.neura-ai.app/v1" ) prompt = """ Write a bash script that accepts a matrix in the format '[1,2],[3,4],[5,6]' and outputs its transpose in the same format. """ response = client.chat.completions.create( model="o4-mini", reasoning_effort="medium", messages=[ { "role": "user", "content": prompt } ] ) print(response.choices[0].message.content) ``` ## Reasoning Effort Levels Control how deeply the model thinks with the `reasoning_effort` parameter: ### Low Effort * Faster responses * Lower token usage * Suitable for moderately complex problems ```python response = client.chat.completions.create( model="o4-mini", reasoning_effort="low", messages=[{"role": "user", "content": "Solve this algebra problem: 2x + 5 = 13"}] ) ``` ### Medium Effort (Default) * Balanced performance * Good for most use cases * Recommended starting point ```python response = client.chat.completions.create( model="o4-mini", reasoning_effort="medium", messages=[{"role": "user", "content": "Design an algorithm to find the shortest path in a weighted graph"}] ) ``` ### High Effort * Most thorough reasoning * Higher token consumption * Best for very complex problems ```python response = client.chat.completions.create( model="o4-mini", reasoning_effort="high", messages=[{"role": "user", "content": "Prove the Pythagorean theorem using multiple different approaches"}] ) ``` ## Ideal Use Cases ### Mathematical Problem Solving ```python response = client.chat.completions.create( model="gemini-2.5-pro", reasoning_effort="high", messages=[{ "role": "user", "content": "Solve this optimization problem: Minimize f(x,y) = x² + y² subject to x + 2y = 4" }] ) ``` ### Complex Coding Challenges ```python response = client.chat.completions.create( model="o4-mini", reasoning_effort="medium", messages=[{ "role": "user", "content": "Implement a balanced binary search tree with insert, delete, and search operations in Python" }] ) ``` ### Scientific Reasoning ```python response = client.chat.completions.create( model="gemini-2.5-pro", reasoning_effort="high", messages=[{ "role": "user", "content": "Explain the thermodynamic principles behind refrigeration and calculate the efficiency of a Carnot cycle" }] ) ``` ### Multi-Step Planning ```python response = client.chat.completions.create( model="o4-mini", reasoning_effort="medium", messages=[{ "role": "user", "content": "Design a complete system architecture for a real-time collaborative document editor" }] ) ``` ## Tips for Best Results * Clearly state the problem and any constraints * Ask for step-by-step explanations when helpful * Use higher reasoning effort for truly complex problems * Consider token costs when choosing effort levels * Break extremely complex problems into smaller sub-problems