How Vast.ai maps to Runpod
The biggest structural change is how you get a GPU. On Vast you search a marketplace of offers from individual hosts and rent one specific machine. On Runpod you name a GPU type (and optionally a data center), and the scheduler places your container.What’s different
What works differently
You pick a GPU type, not a machine. A Vast create call takes an offer ID from a search. A Runpod create call takes a GPU type ID such asNVIDIA GeForce RTX 4090 and places it. The create call doesn’t search for capacity or fall back to another GPU, so automation that looped over offers becomes a loop over GPU types or data centers that you’re willing to accept. Stock varies by data center and changes between a catalog read and a create.
Your image’s entrypoint keeps running. Vast’s SSH and Jupyter launch modes replace the image entrypoint and run your --onstart-cmd instead. Runpod has no launch modes. SSH is an option on the Pod (--ssh, on by default in runpodctl), and your image’s ENTRYPOINT and CMD run as built unless you override them. Move the contents of an on-start script into the Pod’s start command or into the image.
Environment variables are visible in SSH sessions without extra steps. On Vast you may have added env >> /etc/environment to on-start scripts so SSH and Jupyter sessions could see your variables. Drop that line. On Runpod you pass env as a JSON object, and the Pod’s own variables use the RUNPOD_ prefix.
Ports are typed. Vast maps each -p port to a random external port on the host’s shared IP over plain TCP. On Runpod, a port declared as PORT/http is served at https://POD_ID-PORT.proxy.runpod.net over HTTPS, and a port declared as PORT/tcp gets a public IP and a mapped external port. The proxy URL is public and unauthenticated, and it closes connections that run longer than 100 seconds, so add authentication in your app and use a TCP port for long-lived connections. Declare every port you need: the console accepts up to 10 HTTP ports per Pod. Requesting a port above 70000 for a matching internal and external port works the same way on both platforms.
Stopping a Pod clears its container disk. A stopped Vast instance keeps everything on its disk. A stopped Pod keeps only the volume disk (mounted at /workspace by default) or an attached network volume. Anything written elsewhere in the container is gone after a stop, a restart caused by a config change, or a terminate. Write checkpoints and outputs under /workspace.
Storage isn’t tied to a machine. A Vast volume can only attach to instances on the physical machine where it was created. A Runpod network volume attaches to any Pod or Serverless worker in its data center, and a global volume attaches in any data center. You size a network volume up front and can grow it later. You can also change a Pod’s container disk and volume disk size with runpodctl pod update, where Vast fixes disk size at creation.
Bandwidth isn’t billed. Vast hosts set per-GB upload and download prices. Runpod Pods bill compute and storage per second with no ingress or egress fees. Remove inet_up_cost and inet_down_cost terms from any cost model you carry over.
Status fields have different names and one false friend. Vast scripts decide from actual_status. Runpod’s REST API returns one status field, and runpodctl adds runtimeStatus. On Vast, exited means the container crashed. On Runpod, EXITED means the Pod is stopped and can be started again, and ERROR is the failure state. See the status map.
Serverless is one resource, and requests go through Runpod. A Vast client asks the Serverless engine for a worker (/route/), then sends the request to that worker’s address with signed auth_data. A Runpod client sends every request to a fixed endpoint URL with your API key, and Runpod queues or load-balances it. There’s no workergroup: the endpoint itself holds the image, GPU pools, and scaling settings.
Serverless scaling uses different inputs. Vast scales on measured load against benchmarked worker performance (min_load, target_util, cold_mult, cold_workers). Runpod scales on queue delay or request count, between a minimum and maximum worker count, with an idle timeout. Endpoints scale to zero by default.
What has no direct equivalent
On the Runpod side:- UDP ports. Vast maps UDP ports (
-p 8082:8082/udp,VAST_UDP_PORT_X). Pods don’t support UDP. Move the protocol to TCP (for example WebRTC over TCP or TURN over TCP, or WireGuard replaced by a TCP-based tunnel), or keep the UDP-facing component elsewhere and connect it to the Pod over TCP. - Bidding for interruptible capacity. Vast lets you set a bid and pauses the instance when you’re outbid. Pod creation in
runpodctland REST API v2 has no bid or interruptible field. Run these jobs as on-demand Pods with checkpoints, as a Serverless queue endpoint that scales to zero between jobs, or as an@app.taskfunction that provisions a Pod per call and terminates it when the function returns. - Self-serve reserved discounts.
vastai prepay instancehas no counterpart. Runpod’s savings plans are deprecated and can’t be purchased. For committed capacity or custom pricing, contact sales. - Choosing a host. Filters such as
reliability,inet_down,dlperf,static_ip, andmachine_iddon’t exist. You choose a GPU type, a cloud tier, a data center or country, a minimum CUDA version, and minimum vCPU and RAM per GPU. - Virtual machines and Docker inside the instance. Vast VM instances support systemd and nested containers. Pods are containers and don’t run Docker Compose. Package each service as its own image and run one Pod per service (NVIDIA GPU Pods in the same account can reach each other over global networking), or run the services as processes in one image.
- ARM hosts. Vast lists
cpu_arch=arm64offers. Runpod images must belinux/amd64. - Copying data off a stopped instance.
vastai copyand Cloud Sync work on stopped Vast instances. On Runpod, put data you need without a running Pod on a network volume and read it through the S3-compatible API. - Scheduled Cloud Sync.
vastai cloud copy --schedulehas no counterpart. Runaws s3 syncorrclonefrom cron inside the Pod, or from your own scheduler against the S3-compatible API. - Custom hostname (
-h). Pod create has no hostname field. ReadRUNPOD_POD_HOSTNAMEandRUNPOD_POD_IDinstead. - Benchmark-driven Serverless scaling and mixed-hardware workergroups. Runpod doesn’t benchmark workers or weight requests by cost. Use GPU pools to allow several GPU types, and tune the scaler threshold.
- Network-attached and cross-region volumes. Vast volumes are machine-local, so shared data usually lives in external object storage. Network volumes and global volumes can replace that, or you can keep your object storage as is.
- A URL derived from the Pod ID. Vast’s Cloudflare tunnel URLs are generated per instance by the Instance Portal. Runpod’s proxy URL is built from the Pod ID and port, so you know it before the Pod starts.
- Queued jobs with IDs. Runpod queue endpoints accept a job, return an ID, and let you poll, stream, cancel, or receive a webhook.
- Deploy when available. REST
POST /v2/podsaccepts aqueueobject that holds a Secure Cloud GPU Pod request until capacity appears, depending on your plan. - Hosted models. Public Endpoints serve models with no deployment.
- Multi-node clusters. Instant Clusters provide multi-node Slurm, PyTorch, and Ray environments.
- Terraform. The
runpod/runpodprovider manages Pods, endpoints, templates, and volumes.
Requirements
- A Vast.ai account with access to the resources you’re migrating, and the
vastaiCLI authenticated (vastai show usersucceeds). - A Runpod account with credits. Runpod is prepaid, like Vast.
- Docker images built for
linux/amd64, in a registry Runpod can pull from. - An SSH key pair if you connect to Pods over SSH.
jqandcurlfor the scripted steps.
Step 1: Take inventory of what you run on Vast.ai
List every resource on the account, in JSON, so you have a record to work from. Run these with thevastai CLI.
inventory.sh
env-vars.json and api-keys.json can contain secrets. Keep the directory out of version control.
For each instance, pull the fields you need to recreate it. The names below are the ones Vast returns from show instances.
vastai show instance INSTANCE_ID --raw) and record what the summary line doesn’t show:
- The image and tag, and whether it’s private (you passed
--login). - The launch mode (
image_runtype): entrypoint with arguments, or SSH or Jupyter with an on-start script (onstart). - Environment variables and port mappings from the Docker options (
extra_env), including any/udpports. - Disk size and what’s stored on it, plus any attached volume and its mount path.
- Whether the instance is on-demand, interruptible (
is_bidis true), or reserved (it has prepaid credit). - The template it came from, if any. Templates you own are in the console under Templates, and
vastai search templatesfinds them by name.
max_workers, min_load, cold_workers, target_util, inactivity_timeout) and, for each workergroup, the template or launch_args, the search_params, and gpu_ram. If the workergroup uses a custom PyWorker, note the PYWORKER_REPO value and read its worker.py.
Finally, find the code that calls Vast. Run this from the root of each repository.
Step 2: Set up Runpod
- Create an account in the Runpod console and add credits on the billing page.
- Create an API key on the Credentials page. Your Vast key doesn’t work on Runpod.
- Install the tools and sign in.
rp login stores the key in ~/.runpod/config.toml. In CI, set RUNPOD_API_KEY as a secret instead. Register your SSH key before you create Pods: keys apply to Pods created afterward.
If you manage infrastructure as code, the Terraform provider is built on REST API v2. To let an agent manage resources, connect the MCP server.
Step 3: Choose where each workload lands
Use the shape of the workload, not the Vast product it runs on today, to choose a target.Map your GPUs
Vast search queries usegpu_name with underscores. Runpod uses GPU type IDs for Pods and GPU pool IDs for Serverless endpoints. The full list is in the GPU types reference.
Choose the GPU by what the workload needs (VRAM, GPU count, CUDA version), then check live stock before you commit to a data center.
id (for Pods), pool (for Serverless), memory in GB, maxCount per Pod, and, with include=AVAILABILITY, an availability level of NONE, LOW, MEDIUM, or HIGH. Stock changes continuously, so treat the result as a way to order your candidates.
These Vast search filters translate to Pod create options. The rest have no counterpart.
Step 4: Move your images and code
Check the image
Images that run on Vast in entrypoint mode usually run on Runpod unchanged. Check four things.- Architecture. Runpod pulls
linux/amd64images. If you build on Apple silicon, build withdocker buildx build --platform linux/amd64. - Registry access. Replace
--login '-u USER -p TOKEN REGISTRY'with a stored credential, then pass its ID when you create a Pod or template. - CUDA. Vast’s
@vastai-automatic-tagpicks an image build to match each host. Runpod doesn’t rewrite tags, so pin a real tag and set a CUDA floor on the Pod (--min-cuda-version) that matches the image. - Vast base image features. Images built on
vastai/base-imageinclude the Instance Portal, Cloudflare tunnels, and Vast’s Jupyter certificate setup. Those services expect Vast’s environment. Use your framework’s upstream image or a Runpod image such asrunpod/pytorchas the base, and reach HTTP services through the Pod proxy.
Translate the launch configuration
The before and after below launch the same vLLM server: one image, one port, one environment variable, and arguments passed to the image’s entrypoint.- Before: Vast.ai
- After: runpodctl
- After: REST API v2
hf_token secret before you run the Runpod versions. The server is then reachable at https://POD_ID-8000.proxy.runpod.net/v1/models. That URL is public, so set an API key on the server (vLLM’s --api-key argument) before you put real traffic on it. Three things changed: there’s no offer ID, the port carries a type, and the Hugging Face token comes from a secret instead of sitting in the command. Set the CUDA floor to the version your image was built for.
Each launch mode translates as follows.
Convert templates
A Vast template stores the image, Docker options, launch mode, on-start script, disk size, and search filters. A Runpod template stores the image, start command, environment, ports, and disk sizes. GPU choice stays on the Pod or endpoint.--docker-start-cmd takes a comma-separated list. Add --serverless to create a template for a Serverless endpoint: Pod templates and Serverless templates aren’t interchangeable, and a Serverless template binds to one endpoint at a time. For Vast’s recommended templates (PyTorch, ComfyUI, vLLM), look for a maintained counterpart with runpodctl template search NAME --type official before you convert your own.
Replace Vast runtime variables in your code
Code inside the container that reads Vast’s predefined variables needs new names. The full table is in the environment variable map. The common cases areCONTAINER_ID to RUNPOD_POD_ID, PUBLIC_IPADDR to RUNPOD_PUBLIC_IP, GPU_COUNT to RUNPOD_GPU_COUNT, and VAST_TCP_PORT_22 to RUNPOD_TCP_PORT_22.
Code that builds its own public URL from PUBLIC_IPADDR and VAST_TCP_PORT_8000 changes shape for HTTP ports, because the proxy URL needs only the Pod ID.
- Before: Vast.ai
- After: Runpod
vastai stop instance $CONTAINER_ID) can call REST API v2 instead. Runpod sets a Pod-scoped key in RUNPOD_API_KEY. Test that it’s allowed to stop its own Pod in your setup, and pass your own key as a secret if it isn’t.
Port a PyWorker to a Runpod worker
A PyWorker is an HTTP proxy that sits in front of your model server, reports load, and runs a benchmark before the worker is marked ready. Runpod workers have no proxy layer, soworker.py goes away. What replaces it depends on the endpoint type.
Here’s a typical PyWorker for a model server with one /generate route.
worker.py
- After: queue endpoint handler
- After: load-balancing endpoint
A queue endpoint calls a handler function once per job. Load the model at import time so it stays in memory between jobs, and return the result. The file below is complete: replace the pipeline with your own model code.The image’s start command runs
handler.py
python -u handler.py. allow_parallel_requests=False matches the default of one job per worker at a time. To process several jobs at once on a worker, see concurrent handlers.Port a Deployment to a Runpod SDK app
Vast Deployments (beta) and Runpod SDK apps both turn a decorated Python function into a remote endpoint.- Before: Vast.ai Deployment
- After: Runpod SDK
deploy.py
rp flash dev main.py while you iterate and rp flash deploy to create the production endpoint. There’s no benchmark dataset, the gpu argument replaces image.require (pass a list to allow several GPUs), and workers=(0, 3) replaces the load-based autoscaling settings. An @app.context class that loads a model once per worker maps most closely to an @app.api class with a @runpod.init method, which runs once when each worker starts. See Build an app.
Step 5: Move your data and models
Choose the storage
A network volume lives in one data center, and every Pod or worker that mounts it must run there. Pick the data center by GPU stock first (
runpodctl datacenter list), then create the volume. If you want to use the S3-compatible API, choose a data center where it’s available.
/workspace on Pods and at /runpod-volume on Serverless workers. If your Vast volume was mounted at /data or /mnt, either update the paths in your code or mount the Runpod volume at the old path with --volume-mount-path (volume disk) or REST mounts.network[].path (network volume). A global volume isn’t pinned to a data center and suits read-heavy data such as model weights. It’s object-backed, so check its limitations before you use it for write-heavy work.
Transfer the data
Pick the route that matches where the data is now.- From object storage
- Instance to Pod
- Your machine to a network volume
- From a Vast volume
If your Vast instances pulled from S3, R2, or GCS, the fastest path is to pull from the same place inside a Pod with the volume attached. No data passes through your machine.Runpod’s Cloud Sync does the same from the console for Amazon S3, Google Cloud Storage, Azure Blob Storage, Backblaze B2, and Dropbox. Vast’s Cloud Sync also connects Google Drive and Hugging Face buckets, which Runpod’s doesn’t: use
rclone or hf download in the Pod for those.du -sh and find . -type f | wc -l) before you delete anything on Vast.
Step 6: Deploy on Runpod
Pods
Create the Pod with the image, ports, and storage you settled on. This example attaches the network volume from Step 5 and opens one HTTP port and direct SSH.id. A network volume takes the place of the volume disk, so don’t pass --volume-in-gb with it, and set --data-center-ids to the volume’s data center. Wait for the container before you connect.
runtimeStatus: running means the container is up, not that your service is listening. Probe the port before you send traffic. In the console, the same flow is Pods, then Deploy. For every flag, see the runpodctl pod reference.
Serverless queue endpoints
A Vast endpoint and its workergroup collapse into one Runpod endpoint. Build and push the worker image from Step 4, create a Serverless template for it, then create the endpoint.- Before: Vast.ai
- After: runpodctl
- After: REST API v2
gpu_ram>=24 becomes a GPU pool. max_workers becomes the maximum worker count. Vast’s cold_workers (stopped workers kept ready) has no direct counterpart: Runpod workers scale to zero and start on demand, and a minimum worker count above zero keeps workers running and billing. With --template-id, environment variables come from the template, so set them there.
For a vLLM endpoint, skip the custom image and deploy the vLLM worker from the Hub with a cached model.
Serverless load-balancing endpoints
For the HTTP server from Step 4, create the endpoint withtype set to LOAD_BALANCER. Load-balancing endpoints scale on request count.
id. Requests go to https://ENDPOINT_ID.api.runpod.ai/PATH. Load-balancing endpoints have request and processing time limits, listed in the load-balancing overview.
Run-to-completion jobs
A script that rented an instance, ran one job, and destroyed it can become a function.@app.task provisions a Pod for each call and terminates it when the function returns.
main.py
rp flash dev main.py. torch is already installed on the SDK’s built-in GPU images. If you need to keep full control of the Pod lifecycle, use the REST version in Step 7.
Step 7: Update the code that calls Vast.ai
Serverless clients
A Vast client resolves an endpoint by name and sends a request to a route on a worker. A Runpod queue client posts a job to a fixed URL that includes the endpoint ID.- Before: Vast.ai SDK
- After: Runpod HTTP
- After: Runpod SDK
- Addressing. Endpoints are addressed by ID, not name. Store the ID in configuration.
- Body. The HTTP body wraps your payload in
input. There’s nocostargument. - Response. A queue endpoint returns a job object with
id,status, andoutput. Vast’s wrapper withresponsegoes away. - Long jobs. Use
/runto get a job ID, then poll/status/JOB_ID, read/stream/JOB_ID, or pass awebhookURL in the request./runsyncholds the connection open for short jobs. - Retries. The Vast SDK retries when a worker returns
429. With a queue endpoint, jobs wait in the queue for a worker instead. Check the jobstatus(IN_QUEUE,IN_PROGRESS,COMPLETED,FAILED,CANCELLED,TIMED_OUT). - Sessions. Vast worker sessions pin requests to one worker. On a load-balancing endpoint, use worker affinity.
- Before: Vast.ai
- After: Runpod
model. Runpod’s vLLM worker requires the deployed model name, or the name you set with OPENAI_SERVED_MODEL_NAME_OVERRIDE. See OpenAI compatibility.
Control-plane code: a complete Python program
This program rents a GPU with a given image, environment variable, start command, and HTTP port, waits for the job’s output, saves it, and deletes the GPU. The first version uses thevastai Python SDK. The second does the same job against Runpod REST API v2.
before_vast.py
after_runpod.py
- The offer search and price cap are gone. You list the GPU types you accept, and a
400on create means that type couldn’t be placed (and a403that your account can’t use it), so you try the next. A failed create leaves nothing behind. The Pod’s hourly rate comes back incost. To cap spend, readpricefromGET /v2/catalog/gpusand filter your candidates before you create. envis a JSON object, and the port moves out of the Docker options intoportswith a type.argsbecomescmd.- The port lookup (
public_ipaddrplusports["8000/tcp"]) becomes a URL built from the Pod ID, over HTTPS. actual_statusbecomesstatus, with different values./workspacehere is on the container disk, which is fine for a job that’s deleted at the end. To keep outputs after the Pod is deleted, attach a network volume.
Control-plane code: a Bash batch job
This script uploads inputs, runs a GPU job over SSH, downloads the results, and deletes the Pod. If the job or the download fails, it keeps the Pod so you can recover the results. It needsrunpodctl, curl, jq, ssh, and scp, and an SSH key registered with runpodctl ssh add-key.
batch_job.sh
--cancel-unavail. /workspace exists because the Pod has a volume disk. The SSH host and port come from the Pod’s ssh.direct block, which is populated once 22/tcp is mapped. Direct SSH needs a public IP, which Secure Cloud (the default) provides. If you only need to run a short command and read its output, POST /v2/pods/POD_ID/exec runs an argv array without SSH and waits up to 25 seconds.
For other calls, use the CLI command map and the API map.
Step 8: Verify, cut over, and shut down
Verify from outside. Send a real request from a machine that isn’t on Runpod, using the production payload.status values, then move the rest.
Set a cost guard on Runpod. Set workers.max and the idle timeout on each endpoint, enable low balance notifications and auto-pay on the billing page, and review runpodctl pod list --all and runpodctl billing pods after the first day. A stopped Pod still bills for its volume disk, and a network volume bills until you delete it.
Shut down Vast. Stopped Vast instances and volumes keep billing for storage, so destroy them once the data is verified on Runpod. Delete Deployments, endpoints, and workergroups first, then destroy any worker instances they leave behind.
VAST_API_KEY from CI secrets.
Reference
CLI command map
API map
Vast’s base URL ishttps://console.vast.ai/api/v0. Runpod’s is https://api.runpod.io/v2. Both take Authorization: Bearer KEY.
REST API v2 validates request bodies strictly. A
422 lists each violation in errors, and a 400 on Pod create means the body was valid but couldn’t be placed.
Configuration field map
Serverless fields map like this.
Environment variable map
These are the variables each platform sets inside the container.
Serverless workers set their own variables. See Serverless environment variables.
Status map
Vast reportsactual_status (what the machine reports) and intended_status (what you asked for). Runpod’s REST API reports one status, and runpodctl output adds runtimeStatus next to desiredStatus.
Each Pod response also includes
actions, the state transitions that are valid right now (start, stop, restart, terminate).
Vast Serverless worker states map loosely to Runpod’s, because Runpod has no stopped-but-ready worker.
Migrate with a coding agent
A coding agent can run the inventory, propose the mapping, and make the changes while you approve each step that costs money. First, install the Runpod skills and connect the MCP server. MCP sign-in uses OAuth (“Sign in with Runpod”), so you don’t need an API key to start. For details, see agent skills and MCP servers.- Claude Code
- Other agents
Troubleshooting
The Pod create call returns400 for a GPU that the catalog showed as available. Stock changed between the read and the create, or the GPU isn’t available in the data center you pinned. Try the next GPU type or data center in your list, or drop dataCenterIds if you don’t have a network volume. Don’t retry a 422: it means the body is wrong.
The container exits right away or ignores your startup commands. On Vast, SSH and Jupyter modes replaced the entrypoint and ran your on-start script. On Runpod the image’s own ENTRYPOINT runs, and cmd is passed to it as arguments. If the image has an entrypoint, either pass arguments it understands or override it with entrypoint. Check runpodctl pod logs POD_ID to see what ran.
SSH is refused, or scp fails while an interactive shell works. Proxied SSH carries a shell only. Add 22/tcp to the Pod’s ports for direct SSH, register your key before you create the Pod, and use an image that starts sshd from the PUBLIC_KEY variable. runpodctl ssh info POD_ID reports which condition isn’t met. Note that runpodctl pod update --ports replaces the whole port list, so include your existing ports.
Files are missing after a stop and start. Only /workspace (the volume disk or a network volume) survives a stop. Vast kept the whole instance disk. Move outputs, checkpoints, and caches such as HF_HOME under /workspace.
A service works on the TCP port but returns 524 through the proxy URL. The HTTP proxy closes connections after 100 seconds. Return a job ID and poll, stream the response, or expose the service on a TCP port instead.
A service that listens on UDP is unreachable. Pods don’t route UDP. Switch the service to TCP, or run the UDP-facing part outside Runpod.
nvidia-smi works but your framework reports a CUDA error. The host’s CUDA version is older than the image expects. Vast’s cuda_vers filter or @vastai-automatic-tag handled this for you. Set --min-cuda-version (REST gpu.minCudaVersion) to the version the image was built for.
A network volume won’t attach, or the Pod can’t be placed with it. The Pod must run in the volume’s data center, and that data center needs stock of your GPU type. Check runpodctl datacenter list before you create the volume, or use a global volume for data that must follow the workload across data centers.
Serverless requests sit in IN_QUEUE. No worker has started. Check that the image is linux/amd64 and pullable, that the GPU pool has stock (add a second pool), and that workers.max is above zero. A handler that never calls runpod.serverless.start also leaves jobs queued.
Code still reads CONTAINER_ID or VAST_TCP_PORT_8000 and gets nothing. Those variables don’t exist on Runpod. Rerun the grep from Step 1 inside the image’s source and replace them with the names in the environment variable map.
Next steps
Choose a Pod
Pick a GPU, cloud tier, and storage for your workload.
Serverless overview
Learn how endpoints, workers, and handlers fit together.
Network volumes
Share persistent data across Pods and Serverless workers.
REST API v2
Manage Pods, endpoints, templates, and volumes programmatically.