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

# LLM

### `builtin__infer`

Generic LLM inference — the `prompt`[ tool kind](/tools/user-defined) exposed as one callable tool, so a plan can add an inference step without authoring a tool YAML first. Plain text out by default; pass an `output_schema` and the result is structured JSON **validated against it** (with one repair pass), so every declared field is guaranteed present and downstream template references like `{{Ex.score}}` are safe. Read-only.

| Input           | Type   |                                                                                                                                                                                                                                                                                         |
| :-------------- | :----- | :-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `instruction`   | string | required — complete, self-contained instruction; interpolate the data to analyze with `{{Ex...}}` templates                                                                                                                                                                             |
| `output_schema` | object | optional — an object JSON Schema for the result (top-level `"type": "object"` plus a `properties` map); omit for `{ "text": ... }`                                                                                                                                                      |
| `model`         | string | optional — a [named model](/models/models-and-providers#named-models) (or role name) to run on; omit for the chat default. When named models are configured, the catalog advertises them on this input with their descriptions, steering the planner toward the smallest adequate model |

The `output_schema` must be an **object** schema — give it an explicit top-level `"type": "object"` and a `properties` map, e.g. `{"type":"object","properties":{"score":{"type":"number"}},"required":["score"]}`. A bare `{properties, required}` with the `type` omitted is coerced to an object rather than rejected, but write it out: the schema is also what the provider validates against.

To analyze each element of a list, call `infer` inside a `map` body with `{{item}}` interpolated per call rather than interpolating the whole list into one instruction — see [per-item inference](/plans/iteration#per-item-inference) for why and when not to.

For a *fixed* inference step you reuse across plans (a classifier, a reviewer), still prefer a dedicated `user__` prompt tool — its prompt and schema live in one reviewed file instead of being repeated in every plan.


## Related topics

- [Finish modes](/plans/finish-modes.md)
- [User-defined tools](/tools/user-defined.md)
- [Introducing Graph](/introduction.md)
- [Installation](/getting-started/installation.md)
- [config.toml](/reference/configuration.md)
