> For the complete documentation index, see [llms.txt](https://docs.rootcause.ai/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.rootcause.ai/more-details/applications/application-modules/callllm.md).

# Call LLM

> Generate text, JSON, or tabular data using a large language model.

Sends a prompt to a language model and emits what comes back.

`executionMode` decides whether the prompt runs once for the whole input or once per row; `outputMode` decides what the response port carries — free text, parsed JSON against `jsonSchema`, or a frame built to `outputSchema`. Durable by default: the call is a paid side effect that should be retried by the workflow, not re-run on every reactive tick.

## At a glance

|                          |                        |
| ------------------------ | ---------------------- |
| Module type              | `CallLLM`              |
| Category                 | Intelligence           |
| Default tier             | `durable`              |
| Runs on                  | `reactive`, `durable`  |
| Starts a flow            | no                     |
| Holds a body             | no                     |
| Keeps state between runs | no                     |
| Available in             | every application type |

## Parameters

### `provider`

`string` · required · defaults to `""`

Which model provider to call.

### `model`

`string` · required · defaults to `""`

The model id on that provider.

### `systemPrompt`

`string` · required · defaults to `""`

The system prompt, sent unchanged on every call.

### `userPromptTemplate`

`string` · required · defaults to `""`

The user prompt; `{{...}}` interpolates from the `context` port and, per row, the row.

### `executionMode`

`"once" | "perRow"` · required · defaults to `"once"`

Call once for the whole input, or once per row of it.

### `outputMode`

`"text" | "json" | "dataframe"` · required · defaults to `"text"`

What `response` carries: free text, JSON parsed against `jsonSchema`, or a frame.

### `dataframeMode`

`"generateTable" | "enrichRows"` · optional

In `dataframe` mode: build a new table, or add columns to the rows that went in.

### `outputSchema`

`SchemaEntryModel[]` · optional

The columns a `dataframe` response is built to.

### `jsonSchema`

`string` · optional

The JSON Schema a `json` response is validated against.

### `maxTokens`

`number` · optional

Cap on the response length.

### `credentialSlotId`

`string` · optional

The slot holding the provider key, when not using the platform's own.

## Inputs

| Port      | Kind    | Required | Description                                                                                                                           |
| --------- | ------- | -------- | ------------------------------------------------------------------------------------------------------------------------------------- |
| `on`      | `event` | no       | Implicit on every module that does not itself start a flow: wire an event here to make this module the start of what that event runs. |
| `context` | `json`  | no       | Values the prompt template interpolates; also the rows, in `perRow` mode.                                                             |

## Outputs

| Port       | Kind   | Connects to                | Description                                                                                                                                                                                                                                                   |
| ---------- | ------ | -------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `response` | `text` | `text`, `scalar`, `signal` | What the model returned, shaped by `outputMode`. The port stays `text` whatever `outputMode` is, so in `dataframe` mode the frame it carries cannot be wired to a dataframe in-port — a known mismatch between this handler and the wiring layer, not a rule. |

***

[← All application modules](/more-details/applications/application-modules.md)
