How Freebuff is cutting its sandbox bill 15x

Freebuff is a free coding agent, so it pays for every cloud session itself. Its sandboxes had come to cost more than the model running inside them. A week after its first test on Agent 37, nearly all of them had moved, and Freebuff expects its bill to come down 15x or more.

Victor Cheng
Victor ChengVP of Engineering @ Freebuff, the free coding agent, funded by ads
“We have successfully transferred nearly all of our sandboxes to Agent37. Bill will be down 15x+. You guys are a lifesaver.”

The problem

Freebuff is a free coding agent, funded by ads. More than 900,000 developers have signed up. It runs in the terminal, on the desktop and in the browser, and a session in the cloud gets a sandbox of its own: the codebase is cloned into it, the agent works on that code, and a live preview of the app shows up inside Freebuff.

Users pay nothing for those sessions, so Freebuff covers every one. It had already driven the price of the model down, and that left the sandbox as the most expensive part of a session.

“We’re a free product and it’s gone to the point where inference is actually cheaper than the cost of running a sandbox.”
Victor Cheng, VP of Engineering, Freebuff

People drop in and out all day, so Freebuff puts each sandbox to sleep quickly and wakes it when its owner comes back. It keeps hundreds awake at any moment and creates thousands every day.

“The costs were just ridiculous.”
Victor Cheng, VP of Engineering, Freebuff

What they run now

Victor Cheng, Freebuff’s VP of Engineering, ran the first test sandboxes on a Friday. On a call the following Monday his main ask was about previews. Freebuff shows each one inside its own app, and a signed preview link would not load in an embedded frame. A link that does shipped that evening.

“We want to switch everything over to Agent37.”
Victor Cheng, VP of Engineering, Freebuff

The first production sandboxes started the next night. On its first full day Freebuff created thousands of them, on its own image. Not one of those creates failed, and the typical one was ready in a second.

Freebuff runs two kinds side by side. Some sessions get a full VM, and the rest get the default sandbox, which costs less. Every one goes to sleep soon after its owner leaves and wakes in about a second when they come back. A sleep costs nothing and a wake costs nothing. A sleeping sandbox pays for its disk alone, and an awake one is billed by the minute.

The outcome

  • The bill is coming down 15x: That is Victor's own figure for where the bill lands once the migration settles.
  • Nearly every sandbox moved in a week: From the first test to nearly all of production, on Freebuff's own image and the same sleep and wake pattern it already ran.
  • Room for 1,500 at once, the same night: When Freebuff was ready to move everyone, Victor asked for room to run 1,500 sandboxes at the same time. He had it within hours.
“After we stabilize everything and reduce failover it’ll be at 15x+.”
Victor Cheng, VP of Engineering, Freebuff

Freebuff is still free, and the sandbox is back to costing less than the model inside it.

See how a sleeping sandbox is billed

Cut your own sandbox bill

One API call creates a sandbox or a full VM. It is billed by the minute while it is awake and for its disk alone while it sleeps.

$5 free credit