> ## Documentation Index
> Fetch the complete documentation index at: https://docs.tensormesh.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Reasoning Controls

> Pass model-specific reasoning controls through the Tensormesh AI SDK provider.

Some Tensormesh serverless reasoning models expose reasoning controls through
chat template settings. The provider forwards model-specific options unchanged
through `providerOptions.tensormesh.chat_template_kwargs`.

## DeepSeek-V4-Flash

For the default non-thinking mode, omit reasoning controls:

```ts theme={null}
import { generateText } from "ai";
import { tensormesh } from "@tensormesh/ai-sdk-provider";

const { text } = await generateText({
  model: tensormesh("deepseek-ai/DeepSeek-V4-Flash"),
  prompt: "What is 17*19? Return only the final integer.",
  temperature: 1,
  topP: 1,
});
```

For thinking modes, pass `thinking: true` and the model's
`reasoning_effort` inside `chat_template_kwargs`:

```ts theme={null}
const { text } = await generateText({
  model: tensormesh("deepseek-ai/DeepSeek-V4-Flash"),
  prompt:
    "Find the three-digit lock code. The digits are all different. The digits sum to 14. The first digit is twice the third digit. The second digit is one less than the first digit. Return only the code.",
  temperature: 1,
  topP: 1,
  providerOptions: {
    tensormesh: {
      chat_template_kwargs: {
        thinking: true,
        reasoning_effort: "high",
      },
    },
  },
});
```

Use `reasoning_effort: "max"` when you specifically want DeepSeek-V4-Flash
Think Max.

## AI SDK Reasoning Fields

Use `providerOptions.tensormesh.chat_template_kwargs` for Tensormesh
chat-template reasoning controls.

The AI SDK/OpenAI-compatible `reasoning` and `reasoningEffort` settings are
standard request fields and are sent as top-level `reasoning_effort`, not inside
`chat_template_kwargs`.
