A 321B model. On GPUs you rent.
vast-serve runs GLM-5.3-Flash 321B, and other open-weight models, on GPUs you rent from
vast.ai. Then you can use it from Claude Code, Codex or any OpenAI-compatible tool, at
127.0.0.1:18300 on your own computer. One command sets up the rented instance and connects it. One command
stops it, and only reports success once vast.ai confirms it.
What it is
Rented GPUs, set up for you, reachable only from your computer
vast.ai is a marketplace where people rent out GPU machines by the hour. A machine with four RTX 3090s costs far less
than a cloud H100, but it arrives empty. vast-serve does the rest: it checks the hardware, installs the engine, downloads
the model, starts the server, runs a test completion and opens an SSH tunnel to http://127.0.0.1:18300.
$ ./start.sh glm53-305 --check --instance 1234567 # check the hardware first
$ ./start.sh glm53-305 --bg # install, serve and connect
== READY: glm-5.3-flash-uncensored-3.05bpw (glm53-305, ctx 131072) ==
OpenAI http://127.0.0.1:18300/v1 (key: any string, e.g. sk-local)
Anthropic http://127.0.0.1:18300 (/v1/messages)
Web UI http://127.0.0.1:18300/
$ ./stop.sh # stop the instance: the disk still bills
$ ./stop.sh --destroy # delete it and all its files: all its billing ends
What it does on 4× RTX 3090
| Model | GLM-5.3-Flash 321B, 3.05 bpw (glm53-305) |
| Speed | 70 to 78 tokens/s for code and prose with short prompts |
| Context | set to 128K (the longest prompt tested was about 11K tokens) |
| Tool use | short tasks worked in Claude Code and Codex |
| Price | about $0.81/hour for our instance, as listed by vast.ai. Prices vary, and data transfer can cost extra. |
Three APIs and a web UI
OpenAI Chat Completions and Responses, Anthropic Messages, and a chat page, on your own machine through SSH.
Checks before it downloads
Disk, VRAM, CPU and RAM are checked first, using the container's own limits and not just the host's.
Keeps going if you disconnect
The work runs detached on the instance. Run the same command to re-attach; finished steps are skipped.
Confirmed stops
./stop.sh reports success only once vast.ai's own instance list
shows the instance stopped or gone.
Two engines, pinned
Project Maya for GLM-5.3-Flash (EXL3 with DFlash2 drafting) and llama.cpp for GGUF models.
Never rents for you
You choose and rent the machine on vast.ai. vast-serve only sets up an instance you already have, and stops it when you ask.
Billing starts when you rent and continues until you delete the instance. A stopped instance still bills for its disk.
The machine isn't yours. Its owner may be able to read your prompts and files. Don't send private data.
The models are uncensored, and the GLM-5.3 profiles use a drafter licensed for non-commercial use only. See Privacy and responsible use.
Project status
| Tested on a real instance | glm53-305 (build, load, speed, short tool-use tasks) and stopping with ./stop.sh |
| Not tested on one yet | ./stop.sh --destroy, resuming a stopped instance, the other profiles, long coding sessions and prompts near 128K |
Prefer Google Colab, with billing in compute units and no machine to pick? See the sister project, colab-serve.
How it works
start.shuploadsremote/over SSH- launches the setup, detached
- follows its log and result
tunnel.shforwards 127.0.0.1:18300
- check: x86_64, GPUs, VRAM, RAM, disk, AVX2
- CUDA toolkit if missing, then build Maya
- download, verify and pack the model
- serve on the container's 127.0.0.1:18290 and test
Maya's commit, the GLM-5.3 model revisions, the drafter (with its SHA-256) and the llama.cpp release are pinned; override them with
MAYA_COMMIT and LLAMA_TAG. The GGUF profiles follow their repository's main branch unless you set
HF_REV. Your connection details are kept in ~/.local/state/vast-serve, not in the repo.
Before you start
Requirements
required
vast.ai bills your account balance while an instance exists. GPU time ends when the instance stops; its disk bills until you delete it. Data transfer can cost extra, depending on the host.
required
With bash, ssh, curl, tar and python3. Other systems are
untested. No local GPU and no local disk space for models: everything heavy happens on the instance.
required for stop.sh
vastai, installed with uv or pipx, with an API key saved. ./stop.sh
can only stop or destroy your instance if the CLI is logged in, so set it up before you rent. It can also add SSH keys
and look up the instance's address. Without it, use the vast.ai console.
required
A separate key, not one that opens your own servers, without a passphrase so the tunnel can reconnect by itself. Add its public half to your vast.ai account before you rent: account keys only reach instances created afterwards.
you rent it
- Template: PyTorch (Vast) (
vastai/pytorch), x86_64, SSH access. Jupyter isn't needed. - GPUs: 4× RTX 3090, PCIe 4.0 x8 or better if you can.
- System RAM: see the table below. Check it before you rent.
- Container disk: 200 GB for one GLM-5.3 profile up to 3.05 bpw, 500 GB to keep several. It's fixed when you rent.
- CPU: AVX2 required. More real cores help, because the CPU computes the experts that stay in RAM.
not needed
No account or token: only public repositories are used, and no token is sent to the instance.
Why RAM matters
Four 3090s have 96 GB of VRAM, and GLM-5.3-Flash doesn't fit in it. The least-used experts go to system RAM, and whatever doesn't fit there is read from disk, which is much slower.
| Profile | Weights | VRAM + RAM needed | Free RAM for 4× 24 GB |
|---|---|---|---|
glm53-251 | 99 GiB | ~113 GiB | 32 GiB or more |
glm53-305 | 118 GiB | ~133 GiB | 64 GiB or more |
glm53-405 | 154 GiB | ~173 GiB | 96 GiB or more |
glm45air, qwen122b | ~70 GiB | fits in VRAM | 16 GiB |
glm47flash | 23 GiB | fits in VRAM | 16 GiB, quick smoke test |
The 3.05 and 4.05 bpw totals are based on Maya's docs/MEMORY.md; the 2.51 bpw total is an estimate. What counts is the
RAM the container may use, not the whole host's. ./start.sh --check shows it.
The fast way
Let your coding agent set it up
vast-serve is shell scripts and a detailed README, which coding agents handle well. Claude Code, Codex or any other popular agent CLI can install the vast CLI, make the SSH key, check the instance, start the model, test it and connect your tools. Three things stay with you: creating and saving the API key, renting the instance, and deciding when to stop or destroy it, because each of them spends or protects your money.
Works with the agent you already use
Open your agent in an empty folder and paste this:
Set up vast-serve (https://github.com/nemke82/vast-serve) for me. Read its README first and follow it.
1. Check that I have bash, ssh, curl, tar and python3, and clone the repository.
2. Install the vast CLI with `uv tool install vastai` (or pipx) if `vastai` is missing.
3. Don't handle my API key. Tell me how to create one with limited permissions on https://cloud.vast.ai/manage-keys/ and to save it myself with `vastai set api-key` in a normal terminal. Then run `vastai show instances` to confirm the login.
4. Create a separate SSH key with `ssh-keygen -t ed25519 -N "" -C "vast-serve" -f ~/.ssh/id_ed25519_vast` and show me the public key to add to my vast.ai account.
5. Tell me exactly what to rent for the profile I want (template, GPUs, RAM, disk), and wait until I give you the instance ID. Never rent anything yourself.
6. Run `./start.sh <profile> --check --instance <ID>`, explain the result, and only then `./start.sh <profile> --bg`.
7. Test it with `curl -s -m 10 http://127.0.0.1:18300/v1/models` and show me how to connect my tools.
8. Never run ./stop.sh as a test. When I say I'm done, ask whether to stop (the disk still bills) or destroy (all files deleted), run it, and confirm it printed CONFIRMED.
Why you save the API key yourself. vastai set api-key asks for the key at a hidden prompt, which keeps it out
of your shell history and out of the agent's context. It needs a normal terminal; in Claude Code you can type
! vastai set api-key. Treat the key like a password: never paste it into a chat.
Keep your agent and the rented model apart. The agent you use for setup runs on its usual service. If you then point Claude
Code at the rented model, use the separate config below (CLAUDE_CONFIG_DIR=~/.claude-vast), so your normal memory,
instructions and MCP servers are not sent to someone else's machine.
Step by step
Set it up manually
- Get the repo
git clone https://github.com/nemke82/vast-serve.git cd vast-serve - Make an SSH key for vast.ai
Never share the private key (the file withoutssh-keygen -t ed25519 -N "" -C "vast-serve" -f ~/.ssh/id_ed25519_vast export VAST_SSH_KEY=~/.ssh/id_ed25519_vast # in every terminal where you use vast-serve.pub). - Set up the vast CLI and an API key
Create an API key on the Keys page (+New under API Keys; with a team, switch to the account that owns the instance first). A new key has full access by default, so limit it:uv tool install vastai # or: pipx install vastai vastai --version # "command not found"? uv tool update-shell, then a new terminalPermission Needed for instance_readlisting instances, looking up the address, confirming a stop or destroy instance_write./stop.sh,./stop.sh --destroy,vastai start instance,vastai attach sshuser_write(optional)only for vastai create ssh-key. It can also change your account, including creating API keys, so it's better left out: add the SSH key on the Keys page instead.instance_writecan also rent new instances, so even a limited key can spend money. Save the key at the hidden prompt, then check the login (this only lists, it changes nothing):
Don't runvastai set api-key # paste the key at the prompt, not on the command line chmod 600 "${XDG_CONFIG_HOME:-$HOME/.config}/vastai/vast_api_key" vastai show instances./stop.shas a test: it really stops the instance. - Add the public key before you rent, so new instances get it:
Without the CLI, click the key icon on the instance's card and pastevastai create ssh-key ~/.ssh/id_ed25519_vast.pub # needs user_write; or paste it on the Keys page vastai attach ssh 1234567 ~/.ssh/id_ed25519_vast.pub # an instance that already existscat ~/.ssh/id_ed25519_vast.pub. - Rent the instance and find its SSH address
Rent it on vast.ai with the settings above. Billing starts when you rent. Then either pass
--instance 1234567and let vast-serve look up the address, copy the SSH command from the Connect button, or read the Open Ports line ending in→ 22/tcp:203.0.113.10:40199 → 22/tcpmeansssh -p 40199 root@203.0.113.10. Test it; it should list all your GPUs:ssh -i "$VAST_SSH_KEY" -o IdentitiesOnly=yes -p 40199 root@203.0.113.10 nvidia-smi -L - Check the hardware (uploads the scripts, builds and downloads nothing):
The address is remembered. Keep./start.sh --list ./start.sh glm53-305 --check --instance 1234567 ./start.sh glm53-305 --check --ssh 'ssh -p 40199 root@203.0.113.10' --instance 1234567 # without the CLI--instancein the command so the ID is saved for./stop.sh. If the check warns about RAM, pick a smaller profile. - Install, serve and connect
It installs missing build tools, builds Maya, downloads and packs the model, starts the server, runs a test completion and opens the tunnel. The first run downloads 118 GiB for 3.05 bpw, at least 17 minutes at 1 Gbit/s, plus the build. If SSH drops or you press Ctrl+C, run the same command to re-attach../start.sh glm53-305 --bg - Test it
Or chat at http://127.0.0.1:18300/. If the tunnel closes,curl -s -m 10 http://127.0.0.1:18300/v1/models curl -s -m 300 http://127.0.0.1:18300/v1/chat/completions \ -H 'Content-Type: application/json' -H 'Authorization: Bearer sk-local' \ -d '{"model":"glm-5.3-flash-uncensored-3.05bpw","messages":[{"role":"user","content":"Hello"}]}' ./status.sh # GPUs, RAM, disk, server log./tunnel.sh --bg. When you're done, see Stopping.
Use it
Connect Claude Code, Codex and other tools
| OpenAI base URL | http://127.0.0.1:18300/v1 (Chat Completions and Responses) |
| Anthropic base URL | http://127.0.0.1:18300 (without /v1) |
| API key | any text, such as sk-local (never a real key) |
| Model | the profile's model name, also shown by /v1/models |
| Context | 131072 for glm53-*, 65536 for the bundled GGUF profiles, or your --ctx |
The examples use glm53-305. For another profile, change both the model name and the context size, and the URL
if you use another --port. Before you use a coding agent:
- It runs commands and edits files on your machine. These models have no refusal behaviour, so keep approval prompts and sandboxing on.
- Everything it reads, including your files and command output, goes to the rented machine.
- Use at least 64K of context, preferably 128K. Agents send long instructions first, so the first reply can be slow.
Claude Code
mkdir -p ~/vast-test && cd ~/vast-test
CLAUDE_CONFIG_DIR=~/.claude-vast \
ANTHROPIC_API_KEY= \
ANTHROPIC_BASE_URL=http://127.0.0.1:18300 \
ANTHROPIC_AUTH_TOKEN=sk-local \
ANTHROPIC_MODEL=glm-5.3-flash-uncensored-3.05bpw \
ANTHROPIC_DEFAULT_HAIKU_MODEL=glm-5.3-flash-uncensored-3.05bpw \
CLAUDE_CODE_MAX_CONTEXT_TOKENS=131072 \
claude --permission-mode manual
It only applies to that run: plain claude still uses your normal account. The first start asks for a theme, shows
security notes, then asks whether you trust the folder: "No, exit" is selected by default, so choose "Yes, I trust this folder".
It shouldn't ask you to log in; if it does, check that you pasted the whole command.
| Setting | Why it is there |
|---|---|
CLAUDE_CONFIG_DIR=~/.claude-vast | Privacy. Your normal memory, instructions and MCP servers can hold private data, and Claude Code would send it to the rented machine. This starts with an empty config. |
ANTHROPIC_API_KEY= | keeps a real API key in your terminal from being used |
ANTHROPIC_DEFAULT_HAIKU_MODEL | the model for background tasks (replaces the deprecated ANTHROPIC_SMALL_FAST_MODEL) |
CLAUDE_CODE_MAX_CONTEXT_TOKENS | Claude Code doesn't know this model and assumed 1M tokens in our test. It must match the server, or long chats fail. |
--permission-mode manual | A new config can start in auto mode, and here the same uncensored model may be doing its safety checks. Check that the status line says "manual mode on". |
Optional, added before claude: ANTHROPIC_DEFAULT_SONNET_MODEL and ANTHROPIC_DEFAULT_OPUS_MODEL
(same name) for the sonnet/opus aliases; API_TIMEOUT_MS=1800000 for very long prompts;
CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC=1 to turn off telemetry and auto-updates; CLAUDE_CODE_ATTRIBUTION_HEADER=0
to drop the client-version block from the system prompt.
Try it: Reply with PONG, then Create hello.py that prints the first 10 prime numbers, run it and show me the
output (check that the file exists), then Add a test for hello.py and run it. Read each approval before you accept
it. To start over: rm -rf ~/.claude-vast.
This isn't a sandbox. Claude Code has the same access to your files as you do, and can still load
CLAUDE.md files and settings from the current folder, the folders above it and your organization. Use an empty folder or
a project you're happy to share. Exiting Claude Code doesn't stop billing.
Shortcut: put the same command in a function in ~/.zshrc or ~/.bashrc and run vast-claude:
vast-claude() {
CLAUDE_CONFIG_DIR=~/.claude-vast ANTHROPIC_API_KEY= \
ANTHROPIC_BASE_URL=http://127.0.0.1:18300 ANTHROPIC_AUTH_TOKEN=sk-local \
ANTHROPIC_MODEL=glm-5.3-flash-uncensored-3.05bpw \
ANTHROPIC_DEFAULT_HAIKU_MODEL=glm-5.3-flash-uncensored-3.05bpw \
CLAUDE_CODE_MAX_CONTEXT_TOKENS=131072 \
claude --permission-mode manual "$@"
}
Codex CLI
Codex only supports the Responses API (wire_api = "chat" has been removed), and both engines here support it.
With Codex 0.134 or newer, create ~/.codex/vast.config.toml:
model = "glm-5.3-flash-uncensored-3.05bpw"
model_provider = "vast"
model_context_window = 131072
model_auto_compact_token_limit = 110000 # below the context. For 65536, try 50000
[model_providers.vast]
name = "vast-serve"
base_url = "http://127.0.0.1:18300/v1"
wire_api = "responses"
stream_idle_timeout_ms = 1800000
codex --profile vast # interactive
codex exec --profile vast "Explain this project" # one task
Plain codex keeps your normal settings. This provider needs no API key. Codex warns that it has no metadata for the
model and uses fallback values; that's fine. Hosted tools such as web search don't run on this server.
OpenCode
For OpenCode 1.x, in opencode.json in your project (OpenCode 2 uses different field names; see its
provider docs):
{
"$schema": "https://opencode.ai/config.json",
"model": "vast/glm-5.3-flash-uncensored-3.05bpw",
"small_model": "vast/glm-5.3-flash-uncensored-3.05bpw",
"provider": {
"vast": {
"npm": "@ai-sdk/openai-compatible",
"name": "vast-serve",
"options": { "baseURL": "http://127.0.0.1:18300/v1", "apiKey": "sk-local" },
"models": {
"glm-5.3-flash-uncensored-3.05bpw": { "limit": { "context": 131072, "output": 16384 } }
}
}
}
}
Aider
OPENAI_API_BASE=http://127.0.0.1:18300/v1 OPENAI_API_KEY=sk-local \
aider --model openai/glm-5.3-flash-uncensored-3.05bpw
The openai/ prefix tells Aider which API to use; it isn't part of the model's name.
Any other tool
Choose "OpenAI-compatible" or "custom" as the provider with the values above, or use environment variables in a separate terminal:
export OPENAI_BASE_URL=http://127.0.0.1:18300/v1 # OpenAI SDKs
export OPENAI_API_BASE=http://127.0.0.1:18300/v1 # Aider and some others
export OPENAI_API_KEY=sk-local
from openai import OpenAI
client = OpenAI(base_url="http://127.0.0.1:18300/v1", api_key="sk-local")
reply = client.chat.completions.create(
model="glm-5.3-flash-uncensored-3.05bpw",
messages=[{"role": "user", "content": "Hello"}],
)
print(reply.choices[0].message.content)
For an Anthropic-compatible tool, use the base URL without /v1. A tool in Docker can't reach the host through its own
127.0.0.1; on Linux, run it with --network host.
What has been tested
With the real glm53-305 model on 4× RTX 3090, Claude Code 2.1.332 and Codex 0.172.0 each created a Python file,
ran it and reported the correct output, in 20 s and 43 s. Codex first tried an apply_patch command that wasn't available,
then wrote the file with a shell command. A direct Chat Completions tool call also worked. Long coding sessions, these tools with
llama.cpp, and the OpenCode and Aider examples haven't been tested yet.
Client problems
| Symptom | What to do |
|---|---|
| connection refused | The tunnel is closed: ./tunnel.sh --bg. Then check the server with ./status.sh. |
| 404 | Check the base URL: with /v1 for OpenAI tools, without it for Claude Code. |
| Claude Code: "model isn't recognized" | Expected. Set CLAUDE_CODE_MAX_CONTEXT_TOKENS to the server's context. |
| "Prompt is too long" or "ran out of room" | Make the tool's context match the server, compact the conversation, or turn off unused MCP servers. |
Codex: wire_api = "chat" is no longer supported | Use wire_api = "responses". |
| timeouts on long prompts | Raise the tool's timeout, and look for disk reads (see Why RAM matters). |
| poor tool calls or loops | Try glm53-305 or glm53-405, and give the agent smaller tasks. |
Billing
Stopping: what still bills
| Command | Instance | GPU billing | Disk billing | Files |
|---|---|---|---|---|
./stop.sh | stopped | ends | continues | kept, but someone else can rent the GPUs |
./stop.sh --destroy | deleted | ends | ends | deleted, asks first |
./stop.sh --unload | running, model unloaded | continues | continues | kept |
./stop.sh --tunnel | running, model loaded | continues | continues | kept |
- Back soon?
./stop.shkeeps the build and the downloaded model. - Done for a while?
./stop.sh --destroyends all of the instance's billing; next time, rent a new one and start fresh. Volumes you rented separately bill on their own. - Stopping and destroying need the instance ID and the logged-in vast CLI. The ID is saved if you used
--instance; otherwise./stop.sh --instance 1234567.
Look for CONFIRMED at the end. The vast CLI can exit 0 even when a request fails, so
stop.sh only reports success once vast.ai's own instance list shows the instance stopped or gone. Otherwise it prints
MAY STILL BE BILLING and exits with an error: open the console now.
Don't stop or destroy during an install: that interrupts it. After a stop, the next run skips finished steps and resumes the download.
Resume after ./stop.sh
vastai start instance 1234567
vastai show instances # wait until it is running
./start.sh glm53-305 --bg # looks up the new SSH port and skips finished steps
If someone else has rented the GPUs meanwhile, the instance can't start until they're free, and its disk keeps billing. Wait, or destroy it and rent another.
Start fresh after ./stop.sh --destroy
./start.sh glm53-305 --check --instance NEW_ID --ssh 'ssh -p PORT root@HOST'
./start.sh glm53-305 --bg
Reference
Profiles
| Profile | Model | Fits |
|---|---|---|
glm53-251 | GLM-5.3-Flash 321B Uncensored, EXL3 2.51 bpw (99 GiB), Maya | VRAM + RAM ≥ 113 GiB |
glm53-305 | GLM-5.3-Flash 321B Uncensored, EXL3 3.05 bpw (118 GiB), Maya, tested | VRAM + RAM ≥ 133 GiB |
glm53-405 | GLM-5.3-Flash 321B Uncensored, EXL3 4.05 bpw (154 GiB), Maya | VRAM + RAM ≥ 173 GiB |
glm45air | GLM-4.5-Air 106B abliterated, Q4_K_M (73 GB), llama.cpp | all in VRAM on 4× 24 GB |
qwen122b | Qwen3.5-122B-A10B abliterated, i1-Q4_K_M (74 GB), llama.cpp | all in VRAM on 4× 24 GB |
glm47flash | GLM-4.7-Flash 30B abliterated, i1-Q6_K (25 GB), llama.cpp | quick smoke test |
Measured results
glm53-305 (3.05 bpw, DFlash2, 128K context, one request at a time) on 4× RTX 3090 (PCIe 4.0 x16), a Threadripper PRO
5965WX and about 120 GiB of usable container RAM; Maya v1.1.86, CUDA 13.0, driver 580. Single runs at temperature 0 through the SSH
tunnel with short prompts, so yours will vary.
| Test | Result |
|---|---|
| writing code (2 runs, 700 tokens each) | 73 and 78 tokens/s |
| writing prose (600 tokens) | 70 tokens/s |
| 8,625-token prompt, then 200 tokens | first token after 7.8 s (about 1,100 prompt tokens/s), then 67 tokens/s |
| VRAM used | about 23.5 of 24 GiB on each card |
| model load / download | 65 s / 19 min at about 109 MiB/s |
./stop.sh until CONFIRMED | 40 s |
Prompts near 128K haven't been tested. Maya loaded fine even though the container's memlock limit stayed at 8 MiB, so
that warning alone doesn't rule a host out. For reference, Maya's README lists a user's 4× RTX 3090 at 86.5 tok/s with a different
quant and 256K context.
Maya settings for several GPUs
--kv int8, notk8v4. Onlyint8turns on Maya's compressed cache for GLM;k8v4falls back to FP16, about twice the memory.- All GPUs are listed in the config, so Maya adds
--layer-split autoand balances the layers itself. - No
--spec-min-p, CPU lane or PCIe share. Those were tuned for one GPU; Maya has its own multi-GPU defaults. fit_max_tokensis on. Otherwise Maya rejects a request whose prompt plusmax_tokensexceeds the context. Claude Code can ask for 32,000 output tokens, so at 128K it would fail at about 99K prompt tokens.- A cap on pinned RAM in containers. Maya sizes its RAM pool from the host's free memory, not the container's limit, and could be OOM-killed. vast-serve sets
MAYA_GLM_RAM_GBto the container's limit minus 16 GB, andMAYA_GLM_CPU_LANEunder a CPU quota.
Commands
| Command | What it does |
|---|---|
./start.sh <profile> [--ctx N] [--port N] [--bg] | provision, serve and open the tunnel |
./start.sh --list | list the profiles |
./start.sh <profile> --check | check the hardware against a profile |
./tunnel.sh [--port N] [--bg] | reopen the tunnel without touching the server |
./status.sh | state of the instance and the server |
./stop.sh | stop the instance on vast.ai (the disk still bills) |
./stop.sh --destroy | delete the instance and end all its billing |
Add --name NAME to any command to work with several instances, each with its own --port.
Add a model
Create profiles/<name>.env:
DESC="My model"
ENGINE="llama" # llama (GGUF) or maya (GLM-5.3-Flash in EXL3)
HF_REPO="someone/Some-GGUF" # public repos only, no HF token is sent
HF_REV="main" # optional, a commit is better
HF_FILE="model-Q4_K_M.gguf" # llama only. For split files, the 00001-of-N shard
MODEL_NAME="my-model"
CTX="32768"
SIZE_GB=20 # download size, for the disk check
MIN_VRAM_GB=24 # total across all GPUs
# POOL_GB=133 # maya: VRAM + RAM needed, for the warning
# MMPROJ_FILE="mmproj.gguf" # llama: vision projector from the same repo
# EXTRA_ARGS="--temp 0.7" # extra engine flags
Troubleshooting
| Symptom | What to do |
|---|---|
SSH failed or Permission denied (publickey) | Is the instance running? Are you using the port mapped to 22/tcp? Is your key on this instance? Try VAST_SSH_KEY. After a host key error because the instance was replaced at the same address, delete ~/.local/state/vast-serve/default.known_hosts. |
VRAM + RAM is ... wants about ... | Use a smaller profile or rent a host with more RAM. |
the Maya build failed | Read /workspace/vast-serve/run/build.log. "unsupported GNU version" means g++ is too new for that CUDA version. |
the job ended without a result | Usually an OOM kill or a restart of the instance. Run the same command again. |
| out of memory on a GPU | Use a smaller --ctx, or add EXTRA_ARGS="--vram-reserve-mib 1200" to a Maya profile. |
| slow answers with a busy disk | Not enough RAM, so experts are read from disk. See Why RAM matters. |
This action requires login | No API key is saved, or it's no longer valid. Save one again with vastai set api-key, as your normal user, not with sudo. |
401 or 403 from the vast CLI | The key is wrong, was deleted or lacks a permission. Check it on the Keys page. |
| "That isn't a Vast API key" | Copy the whole API key (64 characters, 0-9 and a-f), not your SSH key. |
| a new key is saved but the old one is used | VAST_API_KEY is set and overrides it: unset VAST_API_KEY and remove it from your shell startup files. |
| your instance isn't listed | The key belongs to another account or team. Create one in the account that owns the instance. |
stop.sh: no instance ID is saved | ./stop.sh --instance 1234567. |
stop.sh: MAY STILL BE BILLING | Open the console now and stop or destroy the instance there. Then fix the key. |
Logs are in /workspace/vast-serve/run/ on the instance. The offline tests run with tests/test.sh; set
MAYA_SRC=/path/to/project-maya to also check the config against Maya's own server code.
Privacy and responsible use
- The server listens only on
127.0.0.1in the container and is reached through SSH. No port is opened to the internet. - It isn't private from the host. vast.ai machines belong to third parties, and whoever runs one may be able to read its memory and disk, including your prompts. Don't send secrets, credentials or client data.
- Anyone who can log in to your computer can use the local port: there's no API key check.
- The bundled profiles are abliterated community models without refusal behaviour. You are responsible for how you use them, and for following the law, vast.ai's terms and the licenses.
- The DFlash2 drafter is CC BY-NC-ND 4.0: non-commercial use only. Every Maya profile uses it.
- Your vast.ai API key controls your account and can rent machines. Never put it in the repo, a chat, a screenshot or the instance. Keys don't expire by default: if one leaks, delete it on the Keys page, check your instances and billing, and make a new one.
Contributing and credits
Test results from other GPUs are especially welcome: see CONTRIBUTING.md and the changelog.
Built on Project Maya and llama.cpp, with alesha-pro/tools (the launcher colab-serve grew from). Model builds by MikeRoz (EXL3 quants), Anbeeld (DFlash2 GGUF), huihui-ai, mradermacher, tachyphylaxis and the original model teams.