How to choose between a VPS, GPU cloud, serverless, or a sandbox for AI work
computevpsgpu-cloudserverlesssandboxes
Short version: rent a VPS if you need a small always-on box with SSH (agents that poll, schedulers, webhooks, small APIs). Rent GPU cloud machines if you need CUDA hardware for training or steady inference. Use serverless compute if your load is bursty and you want to pay only while code runs. Use an agent sandbox if the code being executed is untrusted, for example code an LLM wrote. Most real setups combine two of these.
This page is not a benchmark. I have not load-tested these products against each other, and there are no performance numbers here. It is a decision guide based on how each category works and what the official pages say. Category prices below are described in orders of magnitude only; exact rates live on the linked official pricing pages and change often.
The four categories at a glance
| Category | Persistent SSH box | Billing granularity | GPU availability | Isolation model | Typical cost shape |
|---|---|---|---|---|---|
| VPS (e.g. DigitalOcean) | Yes, that is the product | Monthly, or hourly until a monthly cap | Limited; classic plans are CPU-first | Standard VM | Cheapest tier for always-on, single-digit dollars per month and up |
| GPU cloud (e.g. RunPod) | Often, while the pod runs | Per second on RunPod | The whole point; consumer to datacenter cards | VM or container on shared hosts, varies by vendor | Mid; you pay for GPU-hours, idle time is the enemy |
| Serverless (e.g. Modal) | No; you deploy functions, not boxes | Per second rates on Modal, no minimum usage-time increments per their docs | Yes, attached per function call | Managed containers | Near zero when idle, scales with actual usage |
| Agent sandbox (e.g. E2B) | Ephemeral machines via SDK, not a pet server | Per second while a sandbox runs, per E2B docs | Depends on plan and vendor | Strong: isolated microVM-style sandboxes built for untrusted code | Small per-session costs that add up with fleet size |
Billing-granularity claims in this table come from each vendor’s official pricing or billing docs, checked on the date shown at the top. The rest of the table is my qualitative read of each category, not vendor wording.
Choose a VPS if…
- You want one box that is always on: cron jobs, a small API, a Telegram bot, an agent that polls a queue.
- You want plain SSH, systemd, and files that survive reboots without thinking about it.
- Your AI workload is mostly API calls to hosted models, so you need orchestration, not local GPUs.
DigitalOcean is a reasonable default in this category. If you are new there, a signup credit exists; I keep its exact amount, expiry, and payment-method rules on a dated page: DigitalOcean free credits.
Choose a GPU cloud if…
- You need CUDA hardware for hours at a time: fine-tuning, batch inference, embeddings at scale.
- You can start and stop machines around your jobs, so per-second billing actually saves money.
- You want a choice of GPU classes instead of whatever a general cloud has free in your region.
RunPod is a well-known name here: GPU pods, serverless endpoints, and clusters, billed per second, with serverless time rounded up to the nearest second and no data-transfer fees, per their docs. One caution from checking their pages on 2026-08-20: RunPod does not advertise a free signup credit. Their docs suggest you can start by depositing as little as $10. That is a minimum deposit, not a grant, and I will not list it as free credit on the credits page.
Choose serverless if…
- Your load is bursty: an endpoint that gets traffic spikes, nightly batch jobs, per-request GPU inference.
- You would rather ship functions than administer a box.
- Idle cost matters more to you than cold starts.
Modal is my reference example. Its Starter plan is $0 plus compute per month and includes monthly free credits; the exact figures, what “included compute” covers, and the payment-method requirement are on the dated page: Modal free tier.
Choose an agent sandbox if…
- You execute code that an LLM generated, or code from users you do not trust.
- You want a fresh, disposable machine per task, created and destroyed from an SDK.
- Isolation failures would be a security incident, not just an inconvenience.
E2B builds exactly this: isolated cloud sandboxes, described on their site as secure computers for AI agents. Their pricing page shows a Hobby tier that is free plus usage with a one-time $100 usage credit, and the signup button says no credit card is required (all checked 2026-08-20). A plain VPS can imitate a sandbox with containers, but you own the escape-hatch risk yourself.
Two adjacent options worth knowing
- OpenRouter if what you actually need is model access, not compute. It is a unified API for hundreds of models. A free plan with free models exists (their FAQ says 50 free-model requests per day, or 1000 per day after buying at least $10 of credits). No dollar signup credit is published, only a “small free allowance” with no stated amount, so ignore any post that names one.
- Google Cloud if you want a full cloud around your compute. New customers get a $300 Welcome credit valid for 90 days (their terms say 3 months). A credit card or other payment method is required at signup; Google places a temporary authorization hold of at most $1, not a charge, per their docs.
How to actually decide
Start from the failure mode you cannot accept. If downtime is unacceptable, a VPS or managed serverless beats a spot GPU pod. If a security escape is unacceptable, a purpose-built sandbox beats a hand-rolled container on a VPS. If surprise bills are unacceptable, per-second billing with an idle floor of zero (serverless, sandboxes) beats a monthly box you forget about.
Then look at grants before paying: the credits index tracks what each provider officially gives away, with the date I last checked each number. Comparisons between specific pairs of providers are collected under /compare/ as they are written.
Sources
Last checked:- DigitalOcean pricing
- RunPod pricing
- RunPod billing docs
- Modal pricing
- E2B pricing
- OpenRouter FAQ
- Google Cloud free trial docs
All numbers on this page come from the official pages above, checked on the date shown. If a figure is not stated there, this page says "Not stated officially" instead of guessing.