惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

Vercel News
Vercel News
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
雷峰网
雷峰网
有赞技术团队
有赞技术团队
罗磊的独立博客
博客园 - 叶小钗
Jina AI
Jina AI
博客园 - 司徒正美
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
T
Tailwind CSS Blog
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
人人都是产品经理
人人都是产品经理
Apple Machine Learning Research
Apple Machine Learning Research
阮一峰的网络日志
阮一峰的网络日志
Microsoft Security Blog
Microsoft Security Blog
大猫的无限游戏
大猫的无限游戏
量子位
MyScale Blog
MyScale Blog
V
Visual Studio Blog
博客园 - 聂微东
The Cloudflare Blog
Engineering at Meta
Engineering at Meta
小众软件
小众软件
宝玉的分享
宝玉的分享

DEV Community

Authentication Security Deep Dive: From Brute Force to Salted Hashing (With Java Examples) Why AI Systems Don’t Fail — They Drift Spilling beans for how i learn for exam😁"Reinforcement Learning Cheat Sheet" I Replaced Chrome with Safari for AI Browser Automation. Here's What Broke (and What Finally Worked) How Python Borrows Other People's Work The $40 Architecture: Processing 1 Billion API Requests with 99.99% Uptime Vibe Coding: A Workflow Guide (From Zero to SaaS) Most webhook security guides protect the wrong side. The scary part is delivery. Headless CMS for TanStack Start: Build a Blog with Cosmic EU Age Verification App "Hacked in 2 Minutes" — What Actually Happened Comfy Cloud’s delete function does not actually remove files Running AI Models on GPU Cloud Servers: A Beginner Guide Event-driven media intelligence with AWS Step Functions and Bedrock I scored 500 AI prompts across 8 quality dimensions — here's what broke How to Call Google Gemini API from Next.js (Free Tier, No Backend Needed) The Portal Protocol: Reclaiming Human Connection in the Age of AI How to Fix Your Team's Scattered Knowledge Problem With a Self-Hosted Forum Intro to tc Cloud Functors: A Graph-First Mental Model for the Modern Cloud Designing Multi-Tenant Backends With Both Ownership and Team Access I Built a Neumorphic CSS Library with 77+ Components — Here's What I Learned PostgreSQL Performance Optimization: Why Connection Pooling Is Critical at Scale Cómo construí un SaaS multi-rubro para gestionar expensas en Argentina con FastAPI + Vue 3 🚀 I Built an Ethical Hacking Scanner Tool – Open Source Project I Replaced /usage and /context in Claude Code With a Single Statusline A Pythonic Way to Handle Emails (IMAP/SMTP) with Auto-Discovery and AI-Ready Design I Collected 8.9 Million Polymarket Price Points — Here's What I Found About How Markets Really Move EcoTrack AI — Carbon Footprint Tracker & Dashboard Everyone's Using AI. No One Agrees How. 5 self-hosted ebook managers worth trying in 2026 Building Your First AI Agent with LangChain: From Chatbot to Autonomous Assistant
How I cut my OpenAI Agent latency by replacing cloud sand...
Markov · 2026-04-28 · via DEV Community
Cover image for How I cut my OpenAI Agent latency by replacing cloud sandboxes with a local microVM

Markov

A few days ago, I was building a coding agent using the new OpenAI Agents SDK. Like everyone else, I plugged in one of the official cloud sandboxes (I won't name names, they are all generally good).

My agent was working, but it felt incredibly sluggish.

I looked at the logs. My agent was averaging about 15 tool calls per task. Because the sandbox was hosted in the cloud, the physical path looked like this:

My Agent Runtime → Internet → Cloud Sandbox → MicroVM → Internet → My Agent Runtime

Every single exec_command was doing two round trips across the public internet. That's 30 network hops per task. The cloud provider advertised a "90ms cold start", but what was actually killing my UX was the constant RTT overhead on every tool call.

I tried falling back to the SDK's default local option (bubblewrap on Linux). It was fast, but it relies on process-level syscall filters. Running untrusted LLM-generated code directly on my host kernel just felt like a disaster waiting to happen.

Finding the middle ground: BoxLite

I wanted the hardware isolation of a cloud VM, but the zero-latency of a local process. I found BoxLite. https://github.com/boxlite-ai/boxlite

BoxLite is essentially the SQLite of sandboxing. It's an embedded microVM that uses KVM (Linux) or Hypervisor.framework (macOS) to spin up a dedicated guest kernel right on your machine.

The best part? No daemons to configure, no Docker sockets, no root access. Just a pip install:

pip install boxlite-openai-agents

Enter fullscreen mode Exit fullscreen mode

The 1-Line Swap

I didn't have to rewrite my agent logic. I just changed the client in my RunConfig:

from boxlite_openai_agents import BoxLiteSandboxClient, BoxLiteSandboxClientOptions

# ... agent setup ...

await Runner.run(
    agent,
    "Write fizzbuzz.py for n=15 and run it.",
    run_config=RunConfig(
        sandbox=SandboxRunConfig(
            client=BoxLiteSandboxClient(), # <-- Changed this line
            options=BoxLiteSandboxClientOptions(
                image="python:3.12-slim"
            ),
        ),
    ),
)

Enter fullscreen mode Exit fullscreen mode

The Result

The latency dropped immediately. Because the microVM runs in the same process as the agent runtime, the internet hops went from 30 down to zero. The communication is all microsecond-level IPC.

Plus, because it uses QCOW2 snapshots, I stopped having to re-run pip install pandas on every session. I just snapshot the VM state and resume it the next day in under a second.

If you are building coding agents on your laptop and are tired of cloud latency and timeouts, definitely give local microVMs a try. It completely changed my workflow.