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

# infer

> Contract, placement, related fields and source examples for this Nika YAML field.

[Language reference](/reference/language/overview) / `infer`

## Meaning and placement

### task

The schema declares this field at the location below.

| Property        | Declaration                    |
| --------------- | ------------------------------ |
| Requirement     | Optional in this object        |
| Schema location | `/$defs/task/properties/infer` |
| \$ref           | "#/\$defs/infer"               |

**In the same object:** [after](/reference/language/words/after) · [agent](/reference/language/words/agent) · [exec](/reference/language/words/exec) · [extract](/reference/language/words/extract) · [for\_each](/reference/language/words/for_each) · [group](/reference/language/words/group) · [invoke](/reference/language/words/invoke) · [lift](/reference/language/words/lift) · [on\_error](/reference/language/words/on_error) · [retry](/reference/language/words/retry) · [returns](/reference/language/words/returns) · [timeout](/reference/language/words/timeout) · [when](/reference/language/words/when) · [with](/reference/language/words/with)

[Schema source (use the pointer above)](https://github.com/supernovae-st/nika-spec/blob/c5ebbb7b862b68bc6cf7235efba61173b844afc6/schemas/workflow.schema.json)

## In a source template

Excerpt from `templates/agent-loop.nika.yaml`, source lines 54–63. This is a fragment, not a runnable workflow.

```yaml illustration theme={"system"}

tasks:
  plan:
    infer:
      prompt: "Break '${{ inputs.goal }}' into at most 4 concrete steps."   # SLOT
      # SLOT: the spend ceiling for the planning call. Size it for the SEAT,
      # not for the answer: a reasoning model spends tokens thinking before
      # it emits the first brace, and a ceiling that cuts it off mid-thought
      # fails NIKA-INFER-002 ("no JSON value found · the reply was cut off at
      # the token limit"). Measured — 400 starves qwen3.5:4b on this prompt.
```

### Templates containing this field

| Template                                    | Source                                                                                                                                            |
| ------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- |
| `templates/agent-loop.nika.yaml`            | [Line 57](https://github.com/supernovae-st/nika-spec/blob/c5ebbb7b862b68bc6cf7235efba61173b844afc6/templates/agent-loop.nika.yaml#L57)            |
| `templates/chain.nika.yaml`                 | [Line 65](https://github.com/supernovae-st/nika-spec/blob/c5ebbb7b862b68bc6cf7235efba61173b844afc6/templates/chain.nika.yaml#L65)                 |
| `templates/classify-and-route.nika.yaml`    | [Line 78](https://github.com/supernovae-st/nika-spec/blob/c5ebbb7b862b68bc6cf7235efba61173b844afc6/templates/classify-and-route.nika.yaml#L78)    |
| `templates/corpus-qa.nika.yaml`             | [Line 98](https://github.com/supernovae-st/nika-spec/blob/c5ebbb7b862b68bc6cf7235efba61173b844afc6/templates/corpus-qa.nika.yaml#L98)             |
| `templates/docker-report.nika.yaml`         | [Line 72](https://github.com/supernovae-st/nika-spec/blob/c5ebbb7b862b68bc6cf7235efba61173b844afc6/templates/docker-report.nika.yaml#L72)         |
| `templates/document-to-fields.nika.yaml`    | [Line 59](https://github.com/supernovae-st/nika-spec/blob/c5ebbb7b862b68bc6cf7235efba61173b844afc6/templates/document-to-fields.nika.yaml#L59)    |
| `templates/evaluate-and-optimize.nika.yaml` | [Line 40](https://github.com/supernovae-st/nika-spec/blob/c5ebbb7b862b68bc6cf7235efba61173b844afc6/templates/evaluate-and-optimize.nika.yaml#L40) |
| `templates/fanout.nika.yaml`                | [Line 128](https://github.com/supernovae-st/nika-spec/blob/c5ebbb7b862b68bc6cf7235efba61173b844afc6/templates/fanout.nika.yaml#L128)              |
| `templates/media-asset-pack.nika.yaml`      | [Line 54](https://github.com/supernovae-st/nika-spec/blob/c5ebbb7b862b68bc6cf7235efba61173b844afc6/templates/media-asset-pack.nika.yaml#L54)      |
| `templates/website-brief.nika.yaml`         | [Line 64](https://github.com/supernovae-st/nika-spec/blob/c5ebbb7b862b68bc6cf7235efba61173b844afc6/templates/website-brief.nika.yaml#L64)         |

These are literal key occurrences in the source files, not an execution or conformance claim. [How to instantiate a template](/guides/templates).

## Contract and implementation

This page projects the named specification revision. Check [released engine status](/reference/status) and [the validation workflow](/guides/agent-authoring) before running a file. An optional field is not evidence that every engine supports every value.

Canonical identity: `language:word:infer`. Spec revision: [`c5ebbb7b862b`](https://github.com/supernovae-st/nika-spec/tree/c5ebbb7b862b68bc6cf7235efba61173b844afc6).

[How documentation stays connected](/reference/knowledge-system).
