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

# Constraints

> Tell BLAST its limits

<Note>
  **Quickstart**

  ```yaml theme={null}
  # config.yaml
  constraints:
    max_concurrent_browsers: 4    # Limit concurrent browsers
    max_memory: "4GB"            # Limit memory usage
    allow_parallelism:
      task: true                 # Enable parallel tasks
      data: true                 # Enable parallel data processing

  # Start the BLAST server with your config
  blastai serve --config config.yaml
  ```
</Note>

## Resources

### Memory Usage

```yaml theme={null}
constraints:
  max_memory: "4GB"  # Accepts B, KB, MB, GB, TB units
```

### Browser Instances

```yaml theme={null}
constraints:
  max_concurrent_browsers: 4  # Maximum concurrent browsers
  share_browser_process: true  # Share browser process between contexts
```

### Cost Limits

```yaml theme={null}
constraints:
  max_cost_per_minute: 0.10  # $0.10 per minute
  max_cost_per_hour: 5.00    # $5.00 per hour
```

## Parallelism

BLAST supports different types of parallelism:

```yaml theme={null}
constraints:
  allow_parallelism:
    task: true        # Enable parallel subtasks
    data: true        # Enable parallel web browser content extraction
    first_of_n: false # Disable first-result parallelism
  max_parallelism_nesting_depth: 1  # Maximum depth of nested parallel tasks
```

## LLM

```yaml theme={null}
constraints:
  llm_model: "gpt-4.1"         # Primary model
  llm_model_mini: "gpt-4.1-mini"  # Model for parallel processing
  allow_vision: true           # Enable vision capabilities
```

## Browser

```yaml theme={null}
constraints:
  require_headless: true        # Force headless mode
  share_browser_process: true   # Share browser process
```

## Programmatic Configuration

While YAML configuration is recommended, you can also set constraints programmatically using the Engine API (see [Engine API](/guides/engine-api) for details):

```python theme={null}
from blastai import Engine, Constraints

engine = await Engine.create(
    constraints=Constraints(
        max_memory="4GB",
        max_concurrent_browsers=4,
        allow_parallelism={"task": True, "data": True}
    )
)
```

## Next Steps

* Understand [Concurrency](/guides/concurrency)
* Learn about automatic [Parallelism](/guides/parallelism)
* Explore configuring [Settings](/guides/settings)
