Skip to main content

Create an Engine

Run Tasks

Single Task

Streaming Task

Sequence of Tasks

Caching

BLAST by default caches results and LLM-generated steps to optimize performance. You can control caching behavior using the cache_control option:

Resource Management

The engine automatically manages system resources:
  • Monitors memory usage
  • Limits concurrent browser instances
  • Tracks LLM costs
  • Handles browser reuse and cleanup
Get current resource metrics:
Monitor task states:
The Engine can be used as an async context manager for automatic cleanup:
Or stop the engine when done to clean up resources:

When to Use the Engine API

The Engine API is useful if you don’t want to “run a server”. For most use cases, prefer using blastai serve.

Next Steps