# Models

## Overview

Models in FLUX enable you to perform data transformations using different processing classes. Each model class requires specific formatting in the **Model data** field to define how data should be parsed and transformed.

You can validate your model's behavior by entering sample input in the **Test data** field and running a test to preview the output results.

---

## Model Classes

### CLI

Execute command-line instructions on a device.

**Model data format:** A command string that will be executed.

### Structured Text

Process text containing variables in a structured format.

**Model data format:** Structured text with embedded variables.

[![](https://docs.zequenze.com/uploads/images/gallery/2026-02/FqTAtat4fAdtxxZC-tmpalwm5agy.png)](https://docs.zequenze.com/uploads/images/gallery/2023-07/T9JZRI73zHyEVb8o-image-1689618259179.png)

### Python

Execute Python code to transform data.

**Model data format:** Python code that uses a `data` variable, which will be populated with the content from the **Test data** input.

[![](https://docs.zequenze.com/uploads/images/gallery/2026-02/96ilxkHAwm9oK7aK-tmprd3siyrw.png)](https://docs.zequenze.com/uploads/images/gallery/2023-07/sS0pK3FZHytpCXSb-image-1689617564337.png)

### JSON & XML

Parse and transform JSON or XML data structures.

**Model data format:** JSON structure with variables.

[![](https://docs.zequenze.com/uploads/images/gallery/2026-02/jmpFMfIs7XB28VH2-tmpskrd5qdu.png)](https://docs.zequenze.com/uploads/images/gallery/2023-07/LVMhYkror0fXTltm-image-1689618439782.png)

### Block

Parse block-formatted files using custom or predefined rules.

**Model data format:** YAML parser configuration with multiple parsing rules.

[![](https://docs.zequenze.com/uploads/images/gallery/2026-02/MNgY7zI0w3Gdxn35-tmprhd9whjk.png)](https://docs.zequenze.com/uploads/images/gallery/2023-07/bwF51Fi0t6wKWpjo-image-1689618767828.png)

**Using predefined rules:** Leave the **Model data** field empty to automatically detect the block type and parse it using FLUX's built-in rules.

[![](https://docs.zequenze.com/uploads/images/gallery/2026-02/vaFsi79UStGSoaww-tmpmus4f-cc.png)](https://docs.zequenze.com/uploads/images/gallery/2023-07/vEHxTey1qwyrqJMM-image-1689618689527.png)

---

## Testing Models

### Basic Model Testing

1. Navigate to the **Test model** tab
2. Fill the **Model data** input with the parsing configuration
3. Fill the **Test data** input with sample data
4. Run `test` in the CLI to perform the transformation

**Example:**

[![](https://docs.zequenze.com/uploads/images/gallery/2026-02/MWzXc9ReqWOYiLpo-tmpy-grjyus.png)](https://docs.zequenze.com/uploads/images/gallery/2023-07/yL4Gjtbu9E78VHbJ-image-1689617156754.png)

### Testing Against Element Context

You can test a model using the context of a specific element by entering the following in the **Test data** input:

```
id={x}
```

Replace `{x}` with the ID of the element whose context you want to use for testing.

---

## Creating Model Templates with OpenAI

FLUX can generate model templates automatically using OpenAI based on your test data.

### Prerequisites

1. Create an empty model with your desired class
2. Create an OpenAI helper element with the naming pattern: `openai-helper-{class}` (where `{class}` matches your model class)

### Steps

1. Navigate to the **Test model** tab
2. Fill the **Test data** input with your sample data
3. Leave the **Model data** input empty
4. Run `template.create` in the CLI terminal

The system will call the `openai-helper-{class}` element, query the OpenAI API, print the generated template, and automatically evaluate it against your test data.

---

## Dynamic Parameters

Models support dynamic variable substitution using element context data. Variables can be loaded in steps prior to model execution, allowing the model to replace them during transformation.

**Example configuration:**

[![](https://docs.zequenze.com/uploads/images/gallery/2026-02/BDZJJQCHxjKHh1Ls-tmpehwu0h3n.png)](https://docs.zequenze.com/uploads/images/gallery/2023-07/kX8zyNhZpjF2jLqE-image-1689564536623.png)

**Example usage:**

[![](https://docs.zequenze.com/uploads/images/gallery/2026-02/mdo776G5kq0gxyrO-tmp665o0a51.png)](https://docs.zequenze.com/uploads/images/gallery/2023-07/rjbQF1shgCQ5O7M9-image-1689564636799.png)