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

# Use a different AI model for each workflow step

> Route each workflow step to its own model: a fast tier for quick reads, a flagship that thinks hard for the step that must be right, and an exact model id.

By the end of this guide you have a workflow whose three agent steps run on three different models: a fast one for a quick read, a flagship that thinks hard for the step that has to be right, and one exact model for boilerplate. You also check which model answered each step.

Every agent step takes its own `model` value, so routing is declared per step in the workflow file. The value names a tier or a model, and can carry the thinking level that step runs at.

## Before you begin

* The `reliant` CLI, v1.21 or later (`reliant version`). Validating, linting and scenario runs need no account.
* For the live run: a signed-in CLI ([Sign in and tokens](https://docs.reliantlabs.io/cli/sign-in.md)), a connected machine ([connect your computer](https://docs.reliantlabs.io/guides/machines/connect-computer-as-machine.md)), and providers for the models you name ([AI providers](https://docs.reliantlabs.io/settings/api-keys.md)).
* [Write your first multi-agent workflow](https://docs.reliantlabs.io/guides/workflows/first-multi-agent-workflow.md) if you have not seen a workflow file before.

**1. Pick a model value for each step**

A step's `model` is one of these:

| Value | What runs |
| - | - |
| `tags: [fast]` | The first model in that tier you have a provider for, at the tier's own thinking level. The tags are `powerful`, `flagship`, `moderate`, `fast`, `cheap`, `reasoning` and `local`. |
| `tags: [flagship]` plus `thinking_level: high` | The same tier, with the thinking level you set instead of the tier's. |
| `id: gpt-6-luna` | Exactly that model, from the [models reference](https://docs.reliantlabs.io/reference/models.md). With no `thinking_level`, it runs at the model's default, `medium` for models that think. |
| `id: "qwen2.5:0.5b@local"` | A model served on your machine by Ollama or LM Studio ([use local models](https://docs.reliantlabs.io/guides/machines/use-local-models.md)). |

`thinking_level` is `low`, `medium`, `high`, `xhigh` or `max`, and is lowered to the highest level the chosen model supports. Prefer tags to ids: a tier keeps working when you change providers, and an id fails when you have no provider for it.

**2. Write the workflow**

```yaml .reliant/workflows/model-per-step.yaml theme={null}
name: model-per-step
description: Three agent steps, each on its own model and thinking level
entry: [spot]

nodes:
  # A quick read: the fast tier, at the tier's own thinking level.
  - id: spot
    type: workflow
    ref: builtin://agent
    args:
      model:
        tags: [fast]
      tools: []
      spawn_presets: []
    thread:
      mode: new
      inject:
        role: user
        content: |
          In one sentence, what is wrong with this Python function?

          def add(a, b):
              return a - b

  # The step that has to be right: the flagship tier, thinking hard.
  - id: fix
    type: workflow
    ref: builtin://agent
    args:
      model:
        tags: [flagship]
        thinking_level: high
      tools: []
      spawn_presets: []
    thread:
      mode: new
      inject:
        role: user
        content: |
          A reviewer said: {{nodes.spot.response_text}}
          Reply with only the corrected function, no prose.

          def add(a, b):
              return a - b

  # Boilerplate: one exact model, thinking as little as it can.
  - id: message
    type: workflow
    ref: builtin://agent
    args:
      model:
        id: gpt-6-luna
        thinking_level: low
      tools: []
      spawn_presets: []
    thread:
      mode: new
      inject:
        role: user
        content: |
          Write a one-line git commit message for this fix. Reply with the message only.

          Problem: {{nodes.spot.response_text}}
          Fix: {{nodes.fix.response_text}}

edges:
  - from: spot
    default: fix
  - from: fix
    default: message
```

The agents have no tools, so the run stays small. A real step keeps its tools and changes only `model`.

**3. Check it locally**

Add a scenario that mocks each step's answer, then validate, lint and run it. None of this calls a model.

```yaml .reliant/workflows/model-per-step/scenarios/answers_flow_through.yaml theme={null}
name: answers_flow_through
description: Each step's answer reaches the next step

events:
  - node: spot
    output:
      response_text: "It subtracts instead of adding."
  - node: fix
    output:
      response_text: "def add(a, b):\n    return a + b"
  - node: message
    output:
      response_text: "fix: make add() add instead of subtract"

expect:
  outcome: completed
  completed: [spot, fix, message]
```

```bash terminal theme={null}
reliant workflow validate .reliant/workflows/model-per-step.yaml
reliant workflow lint .reliant/workflows/model-per-step.yaml
reliant workflow scenario run .reliant/workflows/model-per-step.yaml
```

```text terminal theme={null}
✅ All workflows valid
1 workflow(s): 0 lint error(s), 0 warning(s)
  ✓ model-per-step/answers_flow_through (542ms)
✅ All scenarios passed
```

Validation checks the shape of each `model` value. Whether you have a provider for it is decided when the step runs.

**4. Run it and see which model answered each step**

```bash terminal theme={null}
reliant workflow run model-per-step --project-path "$PWD" --follow
```

```text terminal theme={null}
Workflow "model-per-step" triggered
  Chat/Execution ID: e24c30d4-adba-489b-90e1-ce7bbcc841cc
...
{"event":"workflow_completed",...,"workflow_name":"model-per-step","old_state":"running","new_state":"completed",...}
```

`reliant workflow status` shows each step's status and timing, not its model. Each saved reply records the model that produced it, after the tier was resolved. Read them with `ChatService/ListMessages`, one of the [public API's](https://docs.reliantlabs.io/sdk/reference.md) procedures, using an API token from `reliant auth token create`:

```bash terminal theme={null}
curl -s https://api.reliantapi.com/reliant.v1.ChatService/ListMessages \
  -H "Authorization: Bearer $RELIANT_TOKEN" -H 'Content-Type: application/json' \
  -d '{"chatId":"e24c30d4-adba-489b-90e1-ce7bbcc841cc"}' \
  | jq -r '.messages[] | select(.model) | "\(.model)\t\(.contentBlocks[0].content | gsub("\n"; " "))"'
```

````text terminal theme={null}
claude-4.5-haiku	The function subtracts instead of adds — it returns `a - b` when it should return `a + b`.
claude-5.5-opus	```python def add(a, b):     return a + b ```
gpt-6-luna	Fix add function to return the sum of its arguments
````

The replies come back in step order: `fast` resolved to Claude 4.5 Haiku, `flagship` to Claude 5.5 Opus, and the `id` ran as named. With other providers connected, the two tiers resolve to other models.

**5. Let a preset or the person running it choose**

A step can take its model from a [preset](https://docs.reliantlabs.io/workflows/presets.md) instead. The built-in `researcher` preset brings a flagship model at `low` thinking, with its tools and skills. Values in `args` override the preset's.

To let whoever runs the workflow pick the model, declare a `model` input. `merge()` keeps their choice but pins one setting, the way Get It Right always runs its reviewer at `high`:

```yaml .reliant/workflows/model-per-step-input.yaml theme={null}
name: model-per-step-input
description: The runner picks the model; the review step always thinks hard
entry: [research]

inputs:
  model:
    type: model
    description: Model for every step
    default:
      tags: [moderate]

nodes:
  # The researcher preset brings its own model (flagship, low thinking),
  # tools and skills.
  - id: research
    type: workflow
    ref: builtin://agent
    presets:
      default: researcher
    thread:
      mode: new
      inject:
        role: user
        content: Find where this project defines its HTTP routes.

  # The runner's model, with the thinking level pinned to high.
  - id: review
    type: workflow
    ref: builtin://agent
    args:
      model: "{{merge(inputs.model, {'thinking_level': 'high'})}}"
      tools: [view]
      spawn_presets: []
    thread:
      mode: new
      inject:
        role: user
        content: |
          Check this finding by reading the files it names:
          {{nodes.research.response_text}}

edges:
  - from: research
    default: review
```

In the app the input appears as a model picker. From the CLI, pass a model id with `--input model=<model id>`.

## What this does not do

* **It doesn't show the thinking level a step ran at.** The reply records the model, but no message, status or event records the effort. The level is lowered to what the model supports, so the value you set is an upper bound.
* **It doesn't fall back from an `id` to another model.** A step that names a model you have no provider for fails. Use tags when the workflow should run for people with different providers.
* **It doesn't change which tier a tag means.** The models behind `fast` or `flagship`, and the effort each runs at, are set per machine in `~/.reliant/config.yaml` ([model configuration](https://docs.reliantlabs.io/settings/model-config.md#customizing-tiers)).

## Next steps

> [card] [Run a local LLM coding agent](https://docs.reliantlabs.io/guides/machines/use-local-models.md)
>
> Put one step on a model served on your own hardware.

> [card] [Model configuration](https://docs.reliantlabs.io/settings/model-config.md)
>
> Reorder a tier, change its thinking level, add custom models.

> [card] [Presets](https://docs.reliantlabs.io/workflows/presets.md)
>
> Bundle a model, tools and a prompt, and choose a provider when one is rate-limited.

> [card] [How workflows run](https://docs.reliantlabs.io/deep-dives/how-workflows-run.md)
>
> What happens inside each agent step.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.