Cloudflare Launches Persistent, Stateful, Computer-like Environments for Agents
Cloudflare Computer is a new open-source runtime that aims to lower agent costs by offloading tasks from ephemeral containers to serverless isolates.
Deep dive
- Hybrid Execution: Dynamically routes workloads to either serverless isolates (for speed) or sandboxed containers (for heavy compute).
- Shared Filesystem: Uses an SQLite-backed FUSE filesystem to maintain state while transitioning between execution environments.
- Horizontal Scalability: Leverages Cloudflare Workers' ability to handle large concurrent agent populations.
- Backend Options: Currently supports container projects, isolate shells (bash), and isolated JavaScript runtime modules.
Decoder
- Isolate: A lightweight, sandboxed execution environment used by serverless platforms (like Workers) that has much lower memory overhead than a full Linux container.
- FUSE: Filesystem in Userspace, a mechanism that allows creating custom filesystems that run as standard programs.
Original article
Cloudflare Launches Persistent, Stateful, Computer-Like Environments for Agents
Cloudflare has introduced Cloudflare Computer, a new open-source runtime designed to give AI agents something closer to a real "computer" instead of just ephemeral containers. It leverages Cloudflare isolates for fast serverless execution, making agents cheaper, faster, and more scalable, according to the company.
Cloudflare Computer attempts to tackle a major challenge in AI agent deployment. The company argues that relying on containers to run agents will not scale to "hundreds of millions, then billions, of concurrent agents", because there simply is not enough global compute capacity for that.
To address this, the @cloudflare/computer package introduces an agent runtime where the platform decides whether code runs in an isolate, a container sandbox, or a web browser. In this model, "each agent gets a computer, the runtime optimizes for efficiency, and scalability".
Our goal with @cloudflare/computer is to provide an agent with a runtime where a container is required for less than 10% of its work, and coding tasks, audio/video manipulation, and document creation can all be handled by isolates.
According to Cloudflare, isolates, which were introduced with Cloudflare Workers, are "infinitely horizontally scalable" and can start up and shut down extremely quickly. Additionally, they can persist the agent state, hibernate when the agent is not running, as well as spin up their own container sandboxes when needed. Cloudflare maintains that this combination of isolates and container sandboxes is extremely effective because it combines horizontal and vertical scalability:
Cloudflare’s architecture has been designed to run the agent harness in the isolate (in a Durable Object) and call an attached container on-demand as a tool. This allows you to utilize heavier compute primitives only when required, optimizing performance and cost.
One central piece in this architecture is a shared, SQLite-based filesystem accessible to both isolates and containers. This allows tasks to move seamlessly between the two, with the shared filesystem allowing them to work on the same files. Cloudflare Computer filesystems can be used with git repositories, storage buckets or arbitrary files, while ensuring all operations are gated, audited, and observed.
Currently, Cloudflare Computer provides three backends: container projects, where the SQLite state is exposed as a sandboxed container as a real FUSE-mounted filesystem; isolate shells, which runs just-bash environment in a Dynamic Worker; and isolate JavaScript, which runs an ECMAScript module in a fresh Dynamic Worker.
Cloudflare Computer is still an early preview and is only suitable for experiments, exploration and prototypes, says Cloudflare.
Fresh dev news, AI-digested daily. Never miss a trend at devoured.fyi