We're sorry but this app doesn't work properly without JavaScript enabled. Please enable it to continue.

This lesson's interactive features are locked, please to keep using them

Reasoning Models

A bit before GPT-4 dropped, researchers figured out that if you tell a model to "explain your reasoning," it gets waaay better at hard problems. This showed up in early chain-of-thought prompting experiments and turned out to be weirdly effective for math, logic, and complex coding problems.

It's funny that this "breakthrough" was basically: "Hey, what if we let the model, you know, burn more tokens think longer out loud?" No new architecture, no fancy math – just let it ramble a bit before answering. While it's slower (and more expensive), it can also genuinely solve problems that it would fail on before.

It's Built Into APIs

At its core, chain-of-thought started as a prompting trick. The big providers have since turned that idea into a first-class API feature. You can set a "reasoning effort" level that tells the model how much thinking budget to spend before answering.

OpenCode exposes that tuning through variants. A variant is a named configuration for a given model that changes settings like reasoning effort, thinking budget, and "verbosity" (how detailed the responses are).

Variant names are model-specific, so low, high, or max may or may not exist for each model. OpenCode makes it easy by showing only the variants available for the model you've selected.

You can also define or override variants explicitly in your OpenCode config:

{
  "$schema": "https://opencode.ai/config.json",
  "providers": {
    "openai": {
      "models": {
        "gpt-5": {
          "variants": [
            {
              "id": "poindexter",
              "settings": {
                "reasoningEffort": "high",
                "textVerbosity": "high",
              },
            },
            {
              "id": "grug",
              "settings": {
                "reasoningEffort": "low",
              },
            },
          ],
        },
      },
    },
  },
}

Stick with the default variant most of the time. If you need to, you can use Ctrl+T to cycle through the available variants, or /thinking to select one from a list.

Fast Mode

OpenAI also offers a "fast mode," and Claude now has it too, which tells the provider to process tokens more quickly, but at a higher price per token.

If you're on some kind of subscription plan, and you're not using up your quota... use fast mode. Simple as.

Assignment

Use high reasoning (if your model supports it) to fix a bug with how Sloperator interprets negative division. This SlopLang code:

hallucinate(-7 / 2)✨

prints -4, but it should truncate toward zero and print -3 instead.

Tell OpenCode to run and submit the CLI tests from the project root.

After submitting, use Ctrl+T again (if needed) to return to your usual thinking variant. For DeepSeek V4.1 Flash Free, stick with high.