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

# Models and generation

> How fal Agent chooses models, validates inputs, runs batches, compares models, and repairs failed runs.

Every generation in fal Agent is a normal fal model run. The agent adds the parts that are usually manual: model choice, batching, and repair.

## The model catalog

The agent works from the live fal model registry. The catalog refreshes every few minutes, so new models are available soon after they launch. The catalog is filtered by your account's access policy. Restricted models are not visible to the agent and cannot be run by mention.

If a model is not in the catalog by name, the agent can search the registry for it.

## Auto model choice

When you do not pin a model, the composer shows an **Auto** chip and the agent chooses. The choice follows fal's current recommendations for the task, the media type, the resolution, and whether references are attached. The recommendations change as new models launch, so the agent stays current without a settings change on your side.

To pin a model, type `@` in the composer and pick one. You can also pin a model on one step of a [plan card](/docs/documentation/agent/plan-cards). A pinned model is final. The agent does not substitute another model for it.

## Batches

A batch is two or more runs submitted together. Batches render as one grid in the chat. The agent uses batches for:

* **Variations.** Several takes on one idea, spread across two or three aspect ratios.
* **Candidates.** The same prompt on several models to pick the best.
* **Sets.** A campaign with one output per format.

Each run in a batch can carry a name. The name becomes the `#` reference token in the composer and the folder path in an [export](/docs/documentation/agent/generations/export).

## Model comparison

Ask the agent to compare two or more models on one prompt. The result is a comparison card with one column per model. Each column shows the generation, the model name, and a spec line with latency, estimated price, resolution, and seed. **Fastest** and **cheapest** labels are computed from the results. The card does not give a verdict. You decide.

## Repair after failure

When a run fails after submission, the agent receives the failure and diagnoses it. Typical repairs are:

* **Input constraints.** An oversized reference image is resized in the sandbox and resubmitted.
* **Input mismatch.** The input is rebuilt to match what the model expects.
* **Transient provider errors.** The run is retried once.

The agent repairs a run up to three times. After that, it explains the failure and asks how to proceed. Retried runs are paginated in the cell as **Attempt N of M**.

## Errors you can see

Failed cells show a short explanation. Some messages are rewritten for clarity. The raw provider message stays available on hover.

| Message                                                          | Meaning                                                                             |
| :--------------------------------------------------------------- | :---------------------------------------------------------------------------------- |
| This model isn't available on your account.                      | Your access policy restricts the model                                              |
| Insufficient credits. Add credits to your account and try again. | Your balance is too low for the run                                                 |
| Account locked — generations are paused.                         | Billing needs attention. Check the [Billing](https://fal.ai/dashboard/billing) page |
| Couldn't reach the model service. Retry to try again.            | A transient failure on the provider side                                            |
| Cancelled                                                        | You stopped the run. This is not a failure                                          |

## Cancellation

Hover an in-flight cell and click the cancel button to stop that run. The cell shows **Cancelled**. To stop everything, use the stop button in the composer. See [Queue and steering](/docs/documentation/agent/chats/queue).

## Limits

| Limit                     | Value                                            |
| :------------------------ | :----------------------------------------------- |
| Async repairs per run     | 3                                                |
| Tool steps per turn       | About 60. Longer work continues in the next turn |
| Concurrent turns per chat | 1                                                |

When a turn needs more steps than the limit, the agent stops and tells you. Send another message to continue.
