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

# generate

> Generate structured predictions from images and documents

The `vlmrun generate` command extracts structured data from files using pre-defined domains.

## Image Generation

```bash theme={"theme":{"light":"github-light","dark":"dark-plus"}}
vlmrun generate image photo.jpg --domain document.invoice
```

| Argument/Option | Description                                                      |
| --------------- | ---------------------------------------------------------------- |
| `IMAGE`         | Path to the input image (required)                               |
| `--domain`      | Domain to use for generation, e.g. `document.invoice` (required) |

## Document Generation

```bash theme={"theme":{"light":"github-light","dark":"dark-plus"}}
vlmrun generate document report.pdf --domain document.form
```

| Argument/Option | Description                                                   |
| --------------- | ------------------------------------------------------------- |
| `PATH`          | Path to the document file (required)                          |
| `--domain`      | Domain to use for generation, e.g. `document.form` (required) |

## Examples

```bash theme={"theme":{"light":"github-light","dark":"dark-plus"}}
# Extract invoice data from an image
vlmrun generate image invoice.jpg --domain document.invoice

# Parse a PDF form
vlmrun generate document form.pdf --domain document.form
```

<Tip>
  For more flexible extraction with custom prompts and schemas, use [`vlmrun chat`](/cli/chat) with [skills](/cli/skills) instead of the `generate` command.
</Tip>
