Compute Sizing and Resource Limits for Computer-Use Agent VMs

Choosing hardware and allocation strategy for persistent AI agent VMs.

· 9 min read
Cover illustration for “Compute Sizing and Resource Limits for Computer-Use Agent VMs”
Agent Patterns · October 24, 2026 · 9 min read · 1,975 words

Running persistent AI agents at scale, one per user, needs isolated environments that keep context between sessions without keeping every agent’s compute running. Compute sizing for computer-use agent VMs therefore has two axes. External vision APIs versus local VLM inference determine the hardware class, while the agentic loop’s idle rhythm determines allocation and billing. Persistent microVMs with snapshot-restore connect those requirements by preserving working state while reclaiming idle CPU and RAM.

Why computer-use agents are a distinct VM sizing problem

Computer-use agents use visual perception and browser state as they reason and act again and again. Their resource demands change throughout a session. For local inference, a VLM must already occupy VRAM before the first screenshot arrives, while a headless browser pool runs beside it. Tight colocation reduces screenshot transfer latency, and the accumulating conversation grows the model’s KV cache across turns.

These demands defeat both stateless execution and indiscriminate always-on provisioning. Tearing down the environment on every turn destroys working state and forces rebuilds, but reserving a running VM for every waiting agent wastes capacity. Google’s Agent Compute Engine deep dive identifies the need for VM isolation with container-speed density. Before choosing an instance or deployment model, the inference location must be settled, because the two sizing paths diverge immediately.

The first axis: whether the agent calls an external vision API or runs a local VLM

An API-driven agent VM runs orchestration. Its workload includes the agent process, a database, HTTP routing, and headless browser containers, while the provider’s GPU cluster handles the model. A production-comfortable baseline for roughly 20 concurrent sessions is 4 vCPU and 8 GB RAM. Browser automation needs explicit headroom within that budget. Playwright and Selenium stacks consume substantially more memory than the agent process itself, making browser RAM a common source of underestimation.

Local inference changes the required hardware class entirely. A vision encoder, or ViT, works with a language model served through vLLM, and model weights must fit in VRAM before any request can run. CPU and system RAM cannot substitute for that fit. Qwen2.5-VL at FP16 requires roughly 17 GB for weights before concurrent sessions add their visual-token allocations.

That footprint is only the starting commitment. Each screenshot and conversation adds demand beyond the resident model, so selecting a local VLM also commits the deployment to concurrency-aware GPU sizing. The choice of model affects both cost and how well tasks succeed. ScreenSpot and OSWorld test skills such as picking the correct UI element from a screenshot and instruction, so sizing must also account for how well the model does the task.

VRAM math for local VLM agents: weights, KV cache, and concurrent sessions

Local VLM capacity starts with three additive loads, namely model weights, per-session KV cache, and screenshot visual tokens. At 16-bit precision, weights need roughly 2 GB of VRAM for every billion parameters. Quantization is the main lever for shrinking that footprint. A 4-bit quantized large model can fit in roughly 35–40 GB, bringing a single high-VRAM workstation or data-center card into consideration where full-precision weights would require multi-card tensor parallelism.

Each concurrent agent adds its own KV cache and visual-token allocation above the shared weight footprint, and its cache grows as the conversation continues. Capacity planning must therefore allow for how long conversations are expected to grow, beyond what an empty session needs. Conceptually, subtracting weights from available VRAM and dividing the remainder by per-session overhead gives a concurrency limit before headroom.

That limit is not a safe operating target. Sizing must leave room for changes in what each session needs and for system RAM headroom, while keeping enough VRAM for the work that needs it. Tool calls also complicate utilization estimates because pausing model execution does not release its memory. A GPU can stop computing while its weights and session state remain allocated, so low activity does not imply capacity for another agent.

The second axis: how the agentic loop's idle-heavy rhythm reshapes resource allocation

Once the hardware class is clear, session rhythm determines how much of that capacity should remain allocated. AWS Bedrock AgentCore pricing describes agents spending 30–70% of a session waiting on model responses and tool calls. Runtime v1 does not bill CPU during that wait, although memory remains billable throughout the session.

The difficulty is that waiting agents retain useful state. A browser session or unfinished task must respond quickly when the next step arrives, but keeping every environment running limits how many fit on a host. Google identifies this tension as a reason traditional compute primitives break at agentic scale. The appropriate economic model preserves state as storage while reclaiming idle CPU and RAM.

That model differs from deleting a sandbox. Ephemeral scale-to-zero loses the environment, whereas perpetual scale-to-zero pauses it with its working context intact. To make that distinction useful, the infrastructure must pause and resume quickly enough that users do not experience the savings as a delay.

Why microVM isolation is the right primitive for both axes

Containers share the host kernel, which creates an isolation gap for agents that need extensive control over their environments. A kernel exploit in a container reaches that shared kernel. A microVM instead gives the guest its own kernel behind a hardware boundary. This separation supports browser and development workloads without making a tenant’s kernel the host’s kernel.

Traditional VMs provide separation but impose heavier lifecycle costs. Starting, suspending, and resuming them takes seconds to minutes, and that time adds up as agents move between these states across sessions. MicroVMs pair KVM isolation with much shorter transitions. Firecracker achieves sub-50 ms restore from a prewarmed snapshot pool with low per-instance memory overhead, allowing preserved agent environments to outnumber those actively consuming compute.

Other capabilities depend on the chosen runtime. MicroVM architectures can support memory hotplugging without downtime, allowing a guest to start with less than its maximum allocation and grow mid-session. VFIO device passthrough can also provide real GPU access with near-native performance. This differs from gVisor’s nvproxy ioctl passthrough mechanism, which supports GPU access but is not VFIO-style PCIe passthrough.

Firecracker’s low per-VM memory cost and snapshot-restore allow a physical node to support orders of magnitude more living agent microVMs than conventional VMs. The distinction is between preserved environments and simultaneously active ones. Keeping an environment for each user therefore has a different cost from keeping a VM running for each user.

Snapshot-restore as the operational mechanism that makes idle pricing real

A microVM boots to a ready state, after which its memory and block-device state are snapshotted to local NVMe. Subsequent sandboxes restore from that base. When an active agent later becomes idle, its own state is preserved on disk so CPU and RAM can be reclaimed.

The next step reverses that transition. Restoring the saved snapshot allows the agent to resume with its context intact rather than rebuilding its browser and working environment. QEMU/libvirt stacks take several seconds to restore even an idle warm base, with longer restores for an agent VM holding a few gigabytes of live memory.

Research is pursuing finer-grained state transitions as well. DeltaBox, a 2026 research proposal cited in production systems research by late 2026, proposes millisecond-level checkpoint and rollback for stateful agents. Its relevance as a research proposal is its explicit treatment of recoverable agent state as an infrastructure capability.

Warm pooling solves a different latency problem. Pre-booted instances handle the first request, while snapshot-restore cuts the cost of waiting in a session that has already started. A pool’s Warm → Active → Draining → Dead lifecycle therefore remains useful even when restoration is fast. Neither mechanism replaces the other, and neither alone establishes how a local inference server’s occupied VRAM is managed.

What the pricing spread across agent sandbox platforms reveals about provisioning decisions

Nominal vCPU and RAM specifications do not describe an agent sandbox’s full economics. Platforms differ in isolation architecture, billing granularity, and treatment of idle resources. The relevant comparison includes what remains allocated during a wait and what the platform charges to preserve it.

AgentCore makes that distinction concrete through its runtime options. Runtime v1 bills per vCPU-hour and per GB-hour, with CPU charges stopped during idle waits and memory charged throughout the session. Runtime v2 has a higher unit rate but reclaims idle memory after a two-minute window within a session.

Session duration determines which trade-off is favorable. Short, active sessions favor v1, while long, idle-heavy sessions favor v2. Comparing only unit prices misses the resource-time product that generates the bill.

The first axis creates a separate volume trade-off. At low volume, managed API pricing wins because there are too few sessions over which to amortize a GPU’s hourly cost. With enough sessions, self-hosted inference can spread that rate across them and cost less than per-call pricing. The transition depends on utilization, so neither inference path is universally cheaper.

How do you deploy thousands of persistent agents, one per customer?

Allocating CPU, memory, and tool capacity per agent can prevent one customer from starving another’s workload, while isolation determines the scope of a compromise. A dedicated environment is only one boundary. Enforceable per-user limits also require identity to follow the work beyond the VM.

Every tool call should include the tenant, the acting user or agent, and the invocation context. These identify data ownership and billing, applicable permissions, and one logical unit of work respectively. They are not interchangeable identifiers. Keeping them distinct makes per-user resource caps enforceable without restructuring the agent’s own logic.

MCP provides a complementary tool boundary through lightweight JSON-RPC 2.0 endpoints accessed over stdio or HTTP. Exposing capabilities this way supports per-tenant scoping, so one tenant can receive code execution while another receives only read-only search. Network isolation applies to the networked deployment of those tools. Tool-layer throttling can then operate independently of the VM’s allocation.

Credentials require a separate isolation policy as well. The sandbox should hold no persistent credentials, with short-lived service credentials injected outside the microVM as traffic leaves it and cryptographically verified identities assigned to microVMs. Google’s production workload classes illustrate the breadth of this design problem. Interactive consumer agents, autonomous software engineering workspaces, massive-scale RL evaluation pipelines, and lightweight sandbox backends use the same underlying microVM primitive despite different sizing and isolation needs.

Putting the two axes together: a practical sizing decision framework

Diagram: Two Axes of Agent VM Sizing. Visualizes: Visualize a two-axis decision framework for sizing computer-use agent VMs.

Sizing starts with where inference runs. For API-driven workloads, a 4 vCPU and 8 GB RAM orchestration node with NVMe storage is a production-comfortable starting point for multi-agent use, with browser automation headroom added explicitly. For local VLMs, the starting point is weight VRAM plus the KV cache and visual tokens needed at target concurrency. Quantization reduces the weight burden, but safe sizing still requires memory headroom and an adequate system RAM budget.

The next decision concerns availability and waiting. Live, synchronous local-inference sessions require on-demand GPU instances and a warm pool, while spot or preemptible instances suit background tasks that can be checkpointed between turns. A multi-user fleet with high idle ratios calls for snapshot-restore so preserved environments consume storage and release CPU and RAM. The allocation policy must distinguish the persistent agent environment from the inference capacity it uses.

A platform evaluation should follow those requirements. The relevant criteria are a persistent disk, a separate guest kernel, snapshot-restore, sub-second wake latency, and enforceable per-user resource limits. Google’s microVM architecture shows that the primitive works at production scale, while AgentCore’s runtime policies show why idle billing needs its own review.

The avoidable failures follow from ignoring one axis. Always-on VMs waste resources while agents wait, stateless execution loses the browser’s state, and cold starts clash with a local VLM’s need to keep its weights in memory. Sizing only for weights leaves concurrent KV cache and visual tokens to exhaust the card mid-session. A persistent per-user environment must therefore be planned as both a capacity commitment when active and a recoverable state when idle.

Filed underAgent Patterns

More in Agent Patterns