Repository navigation
feat: Vast.ai GPU VMs - #174
Merged
Merged
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 46 minutes. View limit details
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. |
vkpdeveloper
force-pushed
the
feat/vast-provider
branch
2 times, most recently
from
November 30, 2026 13:28
725f0a6 to
09298f9
Compare
The dashboard API refuses POST requests without a matching Origin, so scripts/live.ts stopped at login.
Each VM rents the cheapest verified on-demand Vast.ai machine with one GPU that fits the size, optionally a chosen GPU model. Commands, files and the T3 and OpenCode ports go over SSH with a key VM Bridge makes and adds to the account. Sleep stops the instance and wake starts it, keeping the disk. A script in each VM stops it after 60 minutes with no SSH connection, as a safety net when VM Bridge is down.
…ve on in 3 minutes On some hosts the authorized_keys file Vast.ai writes has an owner or mode sshd refuses, so no key works and the VM waited the full 12 minute boot limit. The start script now sets the owner and mode, and a VM that runs but still refuses SSH after 3 minutes is deleted and the next offer rented.
Claude Code refuses --dangerously-skip-permissions as root unless IS_SANDBOX=1, so every Claude turn on a Vast.ai VM failed before it started. VM Bridge's env file now sets it on every VM.
vkpdeveloper
force-pushed
the
feat/vast-provider
branch
from
November 30, 2026 13:30
09298f9 to
4306c93
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
VM Bridge had no way to give a coding agent a GPU. This adds Vast.ai as the tenth provider: every VM gets one NVIDIA GPU, rented from the cheapest verified on-demand machine that fits the size, and it works with T3 Code and OpenCode like the others.
Stacked on #173.
How it works
Vast.ai has no exec, file or port API we can use (its execute endpoint only allows
ls,rmanddu), so everything goes over SSH:~/.vmbridge/vast/and adds it to the account. Host keys are kept per instance.ssh.Also in this PR
nvidia-smiin the same stats command as CPU and memory. Vast.ai's API reports these from the host with a delay, so it isn't used.--dangerously-skip-permissions. The VM's environment setsIS_SANDBOX=1, which Claude Code accepts for sandboxed machines.ghinstalls from the start. Setup on a GTX 1070 host went from 22.2 s to 17.6 s, and from about 44 s to 30 s on a slow one.scripts/live.ts, which had stopped at login since the dashboard started requiring a same-originOriginheader.What Vast.ai can't do
sshcommand on the computer running VM Bridge, so not on Cloudflare Workers.Validation
bun run check: 681 pass, 1 skip, 0 fail. CI green.apps/server/test/vast.test.ts: create, a failed boot moving to the next offer, paging, a wake throughexited, a wake stuck waiting for the GPU, no key leak, SSH targets, exec, timeouts and files. The files test needs GNU tools, so it runs on Linux CI only.[N/A], and no GPU. Setup tests cover the parallel download, the T3 retry, and an agent CLI that is broken once and broken every time.scripts/live.ts vast: create, T3 install and start, clone, sleep (29 s), reads while asleep, wake (65 s), checkout kept, delete.nvidia-smi, files, a tunnel before and after sleep, disk kept, watchdog running.vb opencodereaches it: worktree, session created and listed, wrong password refused.IS_SANDBOX=1, and the GPU readings in Resources.ghall running.exitedas a failure, a long data folder path broke SSH's shared socket, and npm left agent CLIs without their binary on a flaky host.