Vastai-Api - Llms-Txt
Pages: 283
Workergroup Parameters
URL: llms-txt#workergroup-parameters
Contents:
- gpu_ram
- launch_args
- search_params
- template_hash
- template_id
- test_workers
The following parameters can be specified specifically for a Workergroup and override Endpoint parameters. The Endpoint parameters will continue to apply for other Workergroups contained in it, unless specifically set.
- min_load
- target_util
- cold_mult
The parameters below are specific to only Workergroups, not Endpoints.
The amount of GPU memory (VRAM) in gigabytes that your model or workload requires to run. This parameter tells the serverless engine how much GPU memory your model needs.
If not specified during workergroup creation, the default value is 24.
A command-line style string containing additional parameters for instance creation that will be parsed and applied when the serverless engine creates new workers. This allows you to customize instance configuration beyond what's specified in templates.
There is no default value for launch_args.
A query string, list, or dictionary that specifies the hardware and performance criteria for filtering GPU offers in the vast.ai marketplace. It uses a simple query syntax to define requirements for the machines that your Workergroup will consider when searching for workers to create.
There is no default value for search_params. To see all available search filters, see the CLI docs here.
A unique hexadecimal identifier that references a pre-configured template containing all the configuration needed to create instances. Templates are comprehensive specifications that include the Docker image, environment variables, onstart scripts, resource requirements, and other deployment settings.
There is no default value for template_hash.
A numeric (integer) identifier that uniquely references a template in the Vast.ai database. This is an alternative way to reference the same template that template_hash points to, but using the template's database primary key instead of its hash string.
There is no default value for template_id.
The number of different physical machines that a Workergroup should test during its initial "exploration" phase to gather performance data before transitioning to normal demand-based scaling. The Worker Group remains in "exploring" mode until it has successfully tested at least floor(test_workers / 2) machines.
If not specified during workergroup creation, the default value is 3.
delete endpoint
URL: llms-txt#delete-endpoint
Source: https://docs.vast.ai/api-reference/serverless/delete-endpoint
api-reference/openapi.json delete /api/v0/endptjobs/{id}/
Deletes an endpoint group by ID. Associated workergroups will also be deleted.
CLI Usage: vastai delete endpoint <id>
QuickStart
URL: llms-txt#quickstart
Contents:
- Sign Up & Add Credit
- 2. Prepare to Connect
- 3. Pick a Template & Find a Machine
- 4. Manage or End Your Instance
- Common Questions
- What is a minimum deposit amount?
- What happens when my balance runs out? Can I avoid interruptions?
- How can I customize a template?
Source: https://docs.vast.ai/documentation/get-started/quickstart
1---2name: 2483-llms-txt-e9bdd61a3description: Vastai-Api - Llms-Txt4---5# Vastai-Api - Llms-Txt67**Pages:** 28389---1011## Workergroup Parameters1213**URL:** llms-txt#workergroup-parameters1415**Contents:**16- gpu\_ram17- launch\_args18- search\_params19- template\_hash20- template\_id21- test\_workers2223The following parameters can be specified specifically for a Workergroup and override Endpoint parameters. The Endpoint parameters will continue to apply for other Workergroups contained in it, unless specifically set. 2425* min\_load26* target\_util27* cold\_mult2829The parameters below are specific to only Workergroups, not Endpoints.3031The amount of GPU memory (VRAM) in gigabytes that your model or workload requires to run. This parameter tells the serverless engine how much GPU memory your model needs.3233If not specified during workergroup creation, the default value is 24.3435A command-line style string containing additional parameters for instance creation that will be parsed and applied when the serverless engine creates new workers. This allows you to customize instance configuration beyond what's specified in templates.3637There is no default value for launch\_args.3839A query string, list, or dictionary that specifies the hardware and performance criteria for filtering GPU offers in the vast.ai marketplace. It uses a simple query syntax to define requirements for the machines that your Workergroup will consider when searching for workers to create.4041There is no default value for search\_params. To see all available search filters, see the CLI docs [here](https://docs.vast.ai/cli/commands).4243A unique hexadecimal identifier that references a pre-configured template containing all the configuration needed to create instances. Templates are comprehensive specifications that include the Docker image, environment variables, onstart scripts, resource requirements, and other deployment settings.4445There is no default value for template\_hash.4647A numeric (integer) identifier that uniquely references a template in the Vast.ai database. This is an alternative way to reference the same template that `template_hash` points to, but using the template's database primary key instead of its hash string.4849There is no default value for template\_id.5051The number of different physical machines that a Workergroup should test during its initial "exploration" phase to gather performance data before transitioning to normal demand-based scaling. The Worker Group remains in "exploring" mode until it has successfully tested at least `floor(test_workers / 2)` machines.5253If not specified during workergroup creation, the default value is 3.5455---5657## delete endpoint5859**URL:** llms-txt#delete-endpoint6061Source: https://docs.vast.ai/api-reference/serverless/delete-endpoint6263api-reference/openapi.json delete /api/v0/endptjobs/{id}/64Deletes an endpoint group by ID. Associated workergroups will also be deleted.6566CLI Usage: `vastai delete endpoint <id>`6768---6970## QuickStart7172**URL:** llms-txt#quickstart7374**Contents:**75 - 1. Sign Up & Add Credit76 - 2**. Prepare to Connect**77 - 3**. Pick a **[**Template**](/documentation/instances/templates)** & Find a Machine**78 - **4. **[**Manage or End Your Instance**](/documentation/instances/managing-instances)79- Common Questions80 - What is a minimum deposit amount?81 - What happens when my balance runs out? Can I avoid interruptions?82 - How can I customize a template?8384Source: https://docs.vast.ai/documentation/get-started/quickstart8586<script87 type="application/ld+json"88 dangerouslySetInnerHTML={{89__html: JSON.stringify({90 "@context": "https://schema.org",91 "@type": "HowTo",92 "name": "How to Get Started with Vast.ai",93 "description": "A step-by-step guide to setting up your Vast.ai account and running your first GPU instance.",94 "step": [95 {96 "@type": "HowToStep",97 "name": "Sign Up & Add Credit",98 "text": "Create an account on vast.ai, verify your email address, and add credit through Billing using credit card, Coinbase, or Crypto.com. Your balance will appear at the top right of the dashboard."99 },100 {101 "@type": "HowToStep",102 "name": "Prepare to Connect",103 "text": "For SSH access: generate an SSH key pair and upload your public key in the Keys page. For Jupyter access: download and install the provided TSL certificate for secure browser access."104 },105 {106 "@type": "HowToStep",107 "name": "Pick a Template & Find a Machine",108 "text": "Browse Templates for pre-built setups like PyTorch, TensorFlow, or ComfyUI. Go to Search and filter by GPU type, count, RAM, CPU, network speed, and price. Remember that disk space is permanent and cannot be changed later. Click Rent when you find a match and wait for the instance to start."109 },110 {111 "@type": "HowToStep",112 "name": "Manage or End Your Instance",113 "text": "Use Stop to pause GPU billing (storage still accrues charges). Use Delete when finished to stop all charges."114 }115 ]116})117}}118/>119120<script121 type="application/ld+json"122 dangerouslySetInnerHTML={{123__html: JSON.stringify({124 "@context": "https://schema.org",125 "@type": "FAQPage",126 "mainEntity": [127 {128 "@type": "Question",129 "name": "What is a minimum deposit amount?",130 "acceptedAnswer": {131 "@type": "Answer",132 "text": "The minimum deposit amount on Vast.ai is $5."133 }134 },135 {136 "@type": "Question",137 "name": "What happens when my balance runs out? Can I avoid interruptions?",138 "acceptedAnswer": {139 "@type": "Answer",140 "text": "When your balance reaches zero, your running instances will automatically stop. To avoid this, you can enable auto-billing on the Billing page. Set an auto-charge threshold higher than your average daily spend, so your card is automatically charged when your balance falls below that amount. We also recommend setting a low-balance email alert at a slightly lower threshold to notify you if the auto-charge fails for any reason."141 }142 },143 {144 "@type": "Question",145 "name": "How can I customize a template?",146 "acceptedAnswer": {147 "@type": "Answer",148 "text": "You can create a new template from scratch, or you can edit an existing template. You can find a guide in the templates documentation."149 }150 }151 ]152})153}}154/>155156This Quickstart will guide you through setting up your Vast.ai account and running your first instance in just a few steps. 157158### 1. Sign Up & Add Credit159160* Create an account on [vast.ai.](https://cloud.vast.ai/)161* Verify your email address.162* Go to [**Billing**](https://cloud.vast.ai/billing/) → **Add Credit** and top up using credit card, Coinbase, or Crypto.com.163164<img src="https://mintcdn.com/vastai-80aa3a82/KWV1TCiq0zjC57hU/images/guides-overview-quick-start.webp?fit=max&auto=format&n=KWV1TCiq0zjC57hU&q=85&s=3512036ce752f432218c5fc67adfe073" alt="Billing" data-og-width="800" width="800" data-og-height="853" height="853" data-path="images/guides-overview-quick-start.webp" data-optimize="true" data-opv="3" srcset="https://mintcdn.com/vastai-80aa3a82/KWV1TCiq0zjC57hU/images/guides-overview-quick-start.webp?w=280&fit=max&auto=format&n=KWV1TCiq0zjC57hU&q=85&s=232b461125a3d4a98ab962094e77a166 280w, https://mintcdn.com/vastai-80aa3a82/KWV1TCiq0zjC57hU/images/guides-overview-quick-start.webp?w=560&fit=max&auto=format&n=KWV1TCiq0zjC57hU&q=85&s=9cd76de9c4d957a0fb632a9f87465ef1 560w, https://mintcdn.com/vastai-80aa3a82/KWV1TCiq0zjC57hU/images/guides-overview-quick-start.webp?w=840&fit=max&auto=format&n=KWV1TCiq0zjC57hU&q=85&s=683729ddfc9debc85e0809fcff5d737e 840w, https://mintcdn.com/vastai-80aa3a82/KWV1TCiq0zjC57hU/images/guides-overview-quick-start.webp?w=1100&fit=max&auto=format&n=KWV1TCiq0zjC57hU&q=85&s=3555ef813dc1ae188112c85f2b058bcb 1100w, https://mintcdn.com/vastai-80aa3a82/KWV1TCiq0zjC57hU/images/guides-overview-quick-start.webp?w=1650&fit=max&auto=format&n=KWV1TCiq0zjC57hU&q=85&s=f5a88f091c569857fda64388c837fb61 1650w, https://mintcdn.com/vastai-80aa3a82/KWV1TCiq0zjC57hU/images/guides-overview-quick-start.webp?w=2500&fit=max&auto=format&n=KWV1TCiq0zjC57hU&q=85&s=6d9a579281e68580e6a6482eda020f87 2500w" />165* Your balance appears at the top right of the dashboard.166167<img src="https://mintcdn.com/vastai-80aa3a82/KWV1TCiq0zjC57hU/images/guides-overview-quick-start-2.webp?fit=max&auto=format&n=KWV1TCiq0zjC57hU&q=85&s=024d3a562b305ac29f47cea16022536f" alt="" data-og-width="973" width="973" data-og-height="65" height="65" data-path="images/guides-overview-quick-start-2.webp" data-optimize="true" data-opv="3" srcset="https://mintcdn.com/vastai-80aa3a82/KWV1TCiq0zjC57hU/images/guides-overview-quick-start-2.webp?w=280&fit=max&auto=format&n=KWV1TCiq0zjC57hU&q=85&s=3deed130eecbc43adb385e88452fa94f 280w, https://mintcdn.com/vastai-80aa3a82/KWV1TCiq0zjC57hU/images/guides-overview-quick-start-2.webp?w=560&fit=max&auto=format&n=KWV1TCiq0zjC57hU&q=85&s=25fe2a5f2883f1aa4ea55f2df7f76ec1 560w, https://mintcdn.com/vastai-80aa3a82/KWV1TCiq0zjC57hU/images/guides-overview-quick-start-2.webp?w=840&fit=max&auto=format&n=KWV1TCiq0zjC57hU&q=85&s=6894eea5311426107efcd81d683c8531 840w, https://mintcdn.com/vastai-80aa3a82/KWV1TCiq0zjC57hU/images/guides-overview-quick-start-2.webp?w=1100&fit=max&auto=format&n=KWV1TCiq0zjC57hU&q=85&s=532c990e02204e56dc8a9767ef03d5a2 1100w, https://mintcdn.com/vastai-80aa3a82/KWV1TCiq0zjC57hU/images/guides-overview-quick-start-2.webp?w=1650&fit=max&auto=format&n=KWV1TCiq0zjC57hU&q=85&s=a8dae300bcde252e34ab7d47c3de3362 1650w, https://mintcdn.com/vastai-80aa3a82/KWV1TCiq0zjC57hU/images/guides-overview-quick-start-2.webp?w=2500&fit=max&auto=format&n=KWV1TCiq0zjC57hU&q=85&s=a2d8dd66a18b678322a2f5b34002a3dd 2500w" />168169<Note>170 Before you can **rent a machine **or **create a team**, you must verify your email address. After signing up, check your inbox (and spam folder) for the verification email and click the link inside. You can resend the verification email anytime from **Settings → Resend Verification Email.**171</Note>172173### 2**. Prepare to Connect**174175* **For SSH access**: generate an [SSH key pair](/documentation/instances/sshscp) and upload your **public key** in [Keys page](https://cloud.vast.ai/manage-keys/).176177<img src="https://mintcdn.com/vastai-80aa3a82/KWV1TCiq0zjC57hU/images/guides-overview-quick-start-3.webp?fit=max&auto=format&n=KWV1TCiq0zjC57hU&q=85&s=5b7bd06c9d287c89754a598a2be3c360" alt="Keys" data-og-width="1279" width="1279" data-og-height="579" height="579" data-path="images/guides-overview-quick-start-3.webp" data-optimize="true" data-opv="3" srcset="https://mintcdn.com/vastai-80aa3a82/KWV1TCiq0zjC57hU/images/guides-overview-quick-start-3.webp?w=280&fit=max&auto=format&n=KWV1TCiq0zjC57hU&q=85&s=b2b2dd3126a1a716ba6d6e70832d9e99 280w, https://mintcdn.com/vastai-80aa3a82/KWV1TCiq0zjC57hU/images/guides-overview-quick-start-3.webp?w=560&fit=max&auto=format&n=KWV1TCiq0zjC57hU&q=85&s=fa2b0ef4be9a051694ee4e28f9263ce1 560w, https://mintcdn.com/vastai-80aa3a82/KWV1TCiq0zjC57hU/images/guides-overview-quick-start-3.webp?w=840&fit=max&auto=format&n=KWV1TCiq0zjC57hU&q=85&s=6faf68e85e85941c6afcd85602af3613 840w, https://mintcdn.com/vastai-80aa3a82/KWV1TCiq0zjC57hU/images/guides-overview-quick-start-3.webp?w=1100&fit=max&auto=format&n=KWV1TCiq0zjC57hU&q=85&s=3864b38246ed01a168df7ef5357a9349 1100w, https://mintcdn.com/vastai-80aa3a82/KWV1TCiq0zjC57hU/images/guides-overview-quick-start-3.webp?w=1650&fit=max&auto=format&n=KWV1TCiq0zjC57hU&q=85&s=6b492e5d08306470905e63dce37a3dc2 1650w, https://mintcdn.com/vastai-80aa3a82/KWV1TCiq0zjC57hU/images/guides-overview-quick-start-3.webp?w=2500&fit=max&auto=format&n=KWV1TCiq0zjC57hU&q=85&s=4200de798dd314922cec733c92b4160b 2500w" />178* **For Jupyter access**: download and install the provided [TSL certificate](/documentation/instances/jupyter#1SmCz) (needed for secure browser access).179180<Note>181 If you don’t install the provided browser certificate: 182183* **Windows / Linux** – You’ll see a **“Your connection is not private”** privacy warning. You can still connect by clicking **Advanced** → **Proceed**, but the warning will appear every time.184 * **macOS** – Browsers will block Jupyter until you install and trust the provided certificate in **Keychain Access**. Without it, you won’t be able to connect.185186Installing the certificate once removes the warning permanently.187</Note>188189### 3**. Pick a **[**Template**](/documentation/instances/templates)** & Find a Machine**190191* Browse [**Templates**](https://cloud.vast.ai/templates/) for pre-built setups (e.g., [PyTorch](/pytorch), TensorFlow, ComfyUI).192* Go to [**Search**](https://cloud.vast.ai/create/) and filter by GPU type, count, RAM, CPU, network speed, and price.193* **Disk Space is Permanent. **The disk size you choose when creating an instance cannot be changed later. If you run out of space, you’ll need to create a new instance with a larger disk. Tip: Allocate a bit more than you think you need to avoid interruptions.194* Click **Rent** when you find a match.195* Wait for the instance to start—cached images launch quickly, fresh pulls may take 10–60 minutes.196* Click **Open** button to access your instance.197198### **4. **[**Manage or End Your Instance**](/documentation/instances/managing-instances)199200* Use **Stop** to pause GPU billing (storage still accrues charges).201* Use **Delete** when finished to stop *all* charges.202203<img src="https://mintcdn.com/vastai-80aa3a82/KWV1TCiq0zjC57hU/images/guides-overview-quick-start-4.webp?fit=max&auto=format&n=KWV1TCiq0zjC57hU&q=85&s=5924a1a46183b876b909daf802c07841" alt="Manage or End Your Instance" data-og-width="1018" width="1018" data-og-height="249" height="249" data-path="images/guides-overview-quick-start-4.webp" data-optimize="true" data-opv="3" srcset="https://mintcdn.com/vastai-80aa3a82/KWV1TCiq0zjC57hU/images/guides-overview-quick-start-4.webp?w=280&fit=max&auto=format&n=KWV1TCiq0zjC57hU&q=85&s=f08910728e4eebb9dd822c866cb6a602 280w, https://mintcdn.com/vastai-80aa3a82/KWV1TCiq0zjC57hU/images/guides-overview-quick-start-4.webp?w=560&fit=max&auto=format&n=KWV1TCiq0zjC57hU&q=85&s=b48d2026679f1e83ccaab2ce2adc4e2f 560w, https://mintcdn.com/vastai-80aa3a82/KWV1TCiq0zjC57hU/images/guides-overview-quick-start-4.webp?w=840&fit=max&auto=format&n=KWV1TCiq0zjC57hU&q=85&s=6f48b1a4ee377ee27d8a67ec83f770f1 840w, https://mintcdn.com/vastai-80aa3a82/KWV1TCiq0zjC57hU/images/guides-overview-quick-start-4.webp?w=1100&fit=max&auto=format&n=KWV1TCiq0zjC57hU&q=85&s=4c7f2ecefa1c7870b45336ed4ec86820 1100w, https://mintcdn.com/vastai-80aa3a82/KWV1TCiq0zjC57hU/images/guides-overview-quick-start-4.webp?w=1650&fit=max&auto=format&n=KWV1TCiq0zjC57hU&q=85&s=8766a3a91186dd38eef4d2e2d97af3e1 1650w, https://mintcdn.com/vastai-80aa3a82/KWV1TCiq0zjC57hU/images/guides-overview-quick-start-4.webp?w=2500&fit=max&auto=format&n=KWV1TCiq0zjC57hU&q=85&s=ebe0bf0b9e5da78c1e65a3c50273f97c 2500w" />204205### What is a minimum deposit amount?206207The minimum deposit amount on Vast.ai is \$5.208209### What happens when my balance runs out? Can I avoid interruptions?210211When your balance reaches zero, your running instances will automatically stop. To avoid this, you can enable **auto-billing **on the Billing page. Set an auto-charge threshold higher than your average daily spend, so your card is automatically charged when your balance falls below that amount. We also recommend setting a **low-balance email alert **at a slightly lower threshold to notify you if the auto-charge fails for any reason. 212213### How can I customize a template?214215You can create a new template from scratch, or you can edit an existing template. You can find a guide [here](/documentation/instances/templates#LrOME). 216217---218219## Huggingface TGI with LLama3220221**URL:** llms-txt#huggingface-tgi-with-llama3222223**Contents:**224- 1) Choose The Huggingface LLama3 TGI API Template From the Recommended Section225- 2) Modifying the Template226- 3) Rent a GPU227- 4) Monitor Your Instance228- 5) Congratulations!229230Source: https://docs.vast.ai/huggingface-tgi-with-llama3231232This is a guide on how to setup and expose an API for Llama3 Text Generation.233234## 1) Choose The Huggingface LLama3 TGI API Template From the Recommended Section235236Login to your Vast account on the [console](https://cloud.vast.ai)237238Select the [HuggingFace Llama3 TGI API](https://cloud.vast.ai/?template_id=906891f677fb36f21662a92e6092b5fc) template by clicking the link provider239240For this template we will be using the meta-llama/Meta-Llama-3-8B-Instruct model, and the TGI 2.0.4 from Huggingface241242Templates encapsulate all the information required to run an application with the autoscaler, including machine parameters, docker image, and environment variables.243244For this template, the only requirement is that you have your own Huggingface access token. You will also need to apply to have access to Llama3 on huggingface in order to access this gated repository.245246The template comes with some filters that are minimum requirements for TGI to run effectively. This includes but is not limited to a disk space requirement of 100GB, and a gpu ram requirement of at least 16GB.247248After selecting the template your screen should look like this:249250<Frame caption="Select">251 <img src="https://mintcdn.com/vastai-80aa3a82/MV3o3hbz7ZsjLzLy/images/Select.png?fit=max&auto=format&n=MV3o3hbz7ZsjLzLy&q=85&s=02e8297d55467706c3411dcb8a9fa6bf" alt="Select" data-og-width="1082" width="1082" data-og-height="465" height="465" data-path="images/Select.png" data-optimize="true" data-opv="3" srcset="https://mintcdn.com/vastai-80aa3a82/MV3o3hbz7ZsjLzLy/images/Select.png?w=280&fit=max&auto=format&n=MV3o3hbz7ZsjLzLy&q=85&s=8fff2658ba8f39ea17b1244a3e74e88f 280w, https://mintcdn.com/vastai-80aa3a82/MV3o3hbz7ZsjLzLy/images/Select.png?w=560&fit=max&auto=format&n=MV3o3hbz7ZsjLzLy&q=85&s=8fb7d9f1ddde6e1be705793093308c26 560w, https://mintcdn.com/vastai-80aa3a82/MV3o3hbz7ZsjLzLy/images/Select.png?w=840&fit=max&auto=format&n=MV3o3hbz7ZsjLzLy&q=85&s=60bc97e88501c1fd1a8ee3de9a455517 840w, https://mintcdn.com/vastai-80aa3a82/MV3o3hbz7ZsjLzLy/images/Select.png?w=1100&fit=max&auto=format&n=MV3o3hbz7ZsjLzLy&q=85&s=3baf5713662c147ee48d9e7cf85d16fe 1100w, https://mintcdn.com/vastai-80aa3a82/MV3o3hbz7ZsjLzLy/images/Select.png?w=1650&fit=max&auto=format&n=MV3o3hbz7ZsjLzLy&q=85&s=7a6e17fad2f5bab89d29bd4fb4cd9248 1650w, https://mintcdn.com/vastai-80aa3a82/MV3o3hbz7ZsjLzLy/images/Select.png?w=2500&fit=max&auto=format&n=MV3o3hbz7ZsjLzLy&q=85&s=4928a1b1b5bc5569ac5575d94cbd7085 2500w" />252</Frame>253254## 2) Modifying the Template255256Once you have selected the template, you will need to then add in your huggingface token and click the 'Select & Save' button.257258You can add your huggingface token with the rest of the docker run options.259260<Frame caption="Edithf">261 262</Frame>263264This is the only modification you will need to make on this template.265266You can then press 'Select & Save' to get ready to launch your instance.267268Once you have selected the template, you can then choose to rent a GPU of your choice from either the search page or the CLI/API.269270For someone just getting started I recommend either an Nvidia RTX 4090, or an A5000.271272<Frame caption="Rent">273 274</Frame>275276## 4) Monitor Your Instance277278Once you rent a GPU your instance will being spinning up on the Instances page.279280You know the API will be ready when your instance looks like this:281282<Frame caption="Llama3Tgiinstances">283 284</Frame>285286Once your instance is ready you will need to find where your API is exposed. Go to the IP & Config by pressing the blue button on the top of the instance card. You can see the networking configuration here.287288<Frame caption="Llama3Ip">289 290</Frame>291292After opening the IP & Port Config you should see a forwarded port from 5001, this is where your API resides. To hit TGI you can use the '/generate' endpoint on that port.293294<Frame caption="Llama3Tgipostman">295 296</Frame>297298## 5) Congratulations!299300You now have a running instance with an API that is using TGI loaded up with Llama3 8B!301302---303304## SSH Connection305306**URL:** llms-txt#ssh-connection307308**Contents:**309- About SSH310- Quick start: Generate and add your SSH key to your Vast account311- Connecting to your Instance312 - Direct vs Proxy Connections313- Tmux314- SSH Local Port Forwarding315- SSH Alternative - Jupyter Terminal316- Troubleshooting317 - Permission Denied (publickey)318 - SSH Key Changes319320Source: https://docs.vast.ai/documentation/instances/connect/ssh321322Learn how to securely connect to Vast.ai instances using SSH. Generate keys, establish connections, use port forwarding, and integrate with VS Code.323324**SSH (Secure Shell)** is a protocol for safely connecting to remote servers. It encrypts your connection so you can:325326* Log in securely327* Run commands remotely328* Transfer files without exposing your data329330<Note>331 Vast.ai instances are configured to accept keys only - Password authentication is disabled for improved security.332</Note>333334## Quick start: Generate and add your SSH key to your Vast account335336<Tabs>337 <Tab title="Terminal">338 **1. Generate a SSH key pair in your terminal**3393401. Creates two files (by default in \~/.ssh/):341 * id\_ed25519 → your **private key** (keep safe, never share).342 * id\_ed25519.pub → your **public key** (safe to share, add to servers).343 2. -C "[your\_email@example.com](mailto:your_email@example.com)" is optional. Whatever you put there is stored as a comment in the public key file (e.g., id\_ed25519.pub). It's just for identification (helpful if you use multiple keys), not for security.344345<Note>346 When you run ssh-keygen -t ed25519 in **Windows PowerShell**, the keys are created in your Windows user profile folder:347 `C:\Users\<YourUsername>\.ssh\`348 </Note>349350**2. Copy your public key.**351352**3. Add it in your** [**vast account**](https://cloud.vast.ai/manage-keys/)353354<img src="https://mintcdn.com/vastai-80aa3a82/rJSuh7NkZ00k8fzX/images/instances-sshscp.webp?fit=max&auto=format&n=rJSuh7NkZ00k8fzX&q=85&s=0c4875e49e2b1250de56ca5d06c8dd8a" alt="" data-og-width="914" width="914" data-og-height="684" height="684" data-path="images/instances-sshscp.webp" data-optimize="true" data-opv="3" srcset="https://mintcdn.com/vastai-80aa3a82/rJSuh7NkZ00k8fzX/images/instances-sshscp.webp?w=280&fit=max&auto=format&n=rJSuh7NkZ00k8fzX&q=85&s=ce25808c68ef5747ae61afc47e21dbac 280w, https://mintcdn.com/vastai-80aa3a82/rJSuh7NkZ00k8fzX/images/instances-sshscp.webp?w=560&fit=max&auto=format&n=rJSuh7NkZ00k8fzX&q=85&s=ad998abfde5ababac4ce81f09fd2d465 560w, https://mintcdn.com/vastai-80aa3a82/rJSuh7NkZ00k8fzX/images/instances-sshscp.webp?w=840&fit=max&auto=format&n=rJSuh7NkZ00k8fzX&q=85&s=d02a30b53bd09b1014350478397dece5 840w, https://mintcdn.com/vastai-80aa3a82/rJSuh7NkZ00k8fzX/images/instances-sshscp.webp?w=1100&fit=max&auto=format&n=rJSuh7NkZ00k8fzX&q=85&s=8154e85ec34d201cde1ae4647f334bec 1100w, https://mintcdn.com/vastai-80aa3a82/rJSuh7NkZ00k8fzX/images/instances-sshscp.webp?w=1650&fit=max&auto=format&n=rJSuh7NkZ00k8fzX&q=85&s=6577c4d72389e767fb8ffe14e92167f8 1650w, https://mintcdn.com/vastai-80aa3a82/rJSuh7NkZ00k8fzX/images/instances-sshscp.webp?w=2500&fit=max&auto=format&n=rJSuh7NkZ00k8fzX&q=85&s=7e4c0d56416402102e8e115bc9c481e6 2500w" />355 </Tab>356357<Tab title="Vast CLI">358 **Add & Generate SSH Key (using** [**Vast CLI**](/cli/get-started)**)**3593601. **Install Vast CLI:**3613622. **Generate an API key in your vast account:**363 1. Open [CLI page](https://cloud.vast.ai/cli/)364 2. Create an API key365 <Frame caption="API Key creation">366 <img src="https://mintcdn.com/vastai-80aa3a82/rJSuh7NkZ00k8fzX/images/instances-sshscp-2.webp?fit=max&auto=format&n=rJSuh7NkZ00k8fzX&q=85&s=b87717158bb150f91e707186ee5e3d0f" alt="API Key creation" data-og-width="800" width="800" data-og-height="316" height="316" data-path="images/instances-sshscp-2.webp" data-optimize="true" data-opv="3" srcset="https://mintcdn.com/vastai-80aa3a82/rJSuh7NkZ00k8fzX/images/instances-sshscp-2.webp?w=280&fit=max&auto=format&n=rJSuh7NkZ00k8fzX&q=85&s=142b3c9d5f6649159213ffd6808b72dd 280w, https://mintcdn.com/vastai-80aa3a82/rJSuh7NkZ00k8fzX/images/instances-sshscp-2.webp?w=560&fit=max&auto=format&n=rJSuh7NkZ00k8fzX&q=85&s=00b017024671fc23e9ff633b929ad068 560w, https://mintcdn.com/vastai-80aa3a82/rJSuh7NkZ00k8fzX/images/instances-sshscp-2.webp?w=840&fit=max&auto=format&n=rJSuh7NkZ00k8fzX&q=85&s=29ff3c6567e5eb5fc92198a007d2cbb8 840w, https://mintcdn.com/vastai-80aa3a82/rJSuh7NkZ00k8fzX/images/instances-sshscp-2.webp?w=1100&fit=max&auto=format&n=rJSuh7NkZ00k8fzX&q=85&s=cff4606483c2ce7b077be309ed80af02 1100w, https://mintcdn.com/vastai-80aa3a82/rJSuh7NkZ00k8fzX/images/instances-sshscp-2.webp?w=1650&fit=max&auto=format&n=rJSuh7NkZ00k8fzX&q=85&s=b154d75102218364a8a476b999b003dd 1650w, https://mintcdn.com/vastai-80aa3a82/rJSuh7NkZ00k8fzX/images/instances-sshscp-2.webp?w=2500&fit=max&auto=format&n=rJSuh7NkZ00k8fzX&q=85&s=5959f2128d22d7794176c4fa391d30dd 2500w" />367 </Frame>3683693. **Generate a new SSH key pair** (you will need your vast API key):370371* Saves keys as \~/.ssh/id\_ed25519 (private) and \~/.ssh/id\_ed25519.pub (public).372 * Backs up existing keys as .backup\_\[timestamp].373 * Keys are stored in your Vast account and used for new instances.374 </Tab>375</Tabs>376377<Warning>378 * Adding a key to your account keys only applies to **new instances**.379 * Existing instances will **not** get the new key automatically. To add a key, use the **instance-specific SSH interface**.380 * For **VM instances**, changing keys requires recreating the VM.381</Warning>382383## Connecting to your Instance384385Start a new instance and click the SSH icon to see your connection information.386387<Frame caption="Terminal Connection Options">388 <img src="https://mintcdn.com/vastai-80aa3a82/rJSuh7NkZ00k8fzX/images/instances-sshscp-3.webp?fit=max&auto=format&n=rJSuh7NkZ00k8fzX&q=85&s=0baecee39ed1714254241d265a1583ef" alt="Connection details" data-og-width="1063" width="1063" data-og-height="453" height="453" data-path="images/instances-sshscp-3.webp" data-optimize="true" data-opv="3" srcset="https://mintcdn.com/vastai-80aa3a82/rJSuh7NkZ00k8fzX/images/instances-sshscp-3.webp?w=280&fit=max&auto=format&n=rJSuh7NkZ00k8fzX&q=85&s=23a7cc28f35a45da60ae7bac6851c5c3 280w, https://mintcdn.com/vastai-80aa3a82/rJSuh7NkZ00k8fzX/images/instances-sshscp-3.webp?w=560&fit=max&auto=format&n=rJSuh7NkZ00k8fzX&q=85&s=55d399312c5cd759898b27d23d80fd05 560w, https://mintcdn.com/vastai-80aa3a82/rJSuh7NkZ00k8fzX/images/instances-sshscp-3.webp?w=840&fit=max&auto=format&n=rJSuh7NkZ00k8fzX&q=85&s=46cf12ad1ed7a5fa4dc4e0f377c64059 840w, https://mintcdn.com/vastai-80aa3a82/rJSuh7NkZ00k8fzX/images/instances-sshscp-3.webp?w=1100&fit=max&auto=format&n=rJSuh7NkZ00k8fzX&q=85&s=8a954169f77ccb3e9ff2ce5d095d00e8 1100w, https://mintcdn.com/vastai-80aa3a82/rJSuh7NkZ00k8fzX/images/instances-sshscp-3.webp?w=1650&fit=max&auto=format&n=rJSuh7NkZ00k8fzX&q=85&s=8d694128da14e5c0540821be56579377 1650w, https://mintcdn.com/vastai-80aa3a82/rJSuh7NkZ00k8fzX/images/instances-sshscp-3.webp?w=2500&fit=max&auto=format&n=rJSuh7NkZ00k8fzX&q=85&s=7cfb49180130e1d6dd523d2d90c9fe99 2500w" />389</Frame>390391Now you can enter the connection command string into your terminal392393You should now see a screen similar to this. You will, by default, be placed into a tmux session.394395<Frame caption="Connected to Instance">396 <img src="https://mintcdn.com/vastai-80aa3a82/rJSuh7NkZ00k8fzX/images/instances-sshscp-4.webp?fit=max&auto=format&n=rJSuh7NkZ00k8fzX&q=85&s=e3dadd004d54ec00fbe7236860f5adc2" alt="Instance SSH session" data-og-width="1254" width="1254" data-og-height="464" height="464" data-path="images/instances-sshscp-4.webp" data-optimize="true" data-opv="3" srcset="https://mintcdn.com/vastai-80aa3a82/rJSuh7NkZ00k8fzX/images/instances-sshscp-4.webp?w=280&fit=max&auto=format&n=rJSuh7NkZ00k8fzX&q=85&s=a185fcc096f446ee40f48d6bc58a8871 280w, https://mintcdn.com/vastai-80aa3a82/rJSuh7NkZ00k8fzX/images/instances-sshscp-4.webp?w=560&fit=max&auto=format&n=rJSuh7NkZ00k8fzX&q=85&s=fabdfe7e040ea540d21dc4c552966358 560w, https://mintcdn.com/vastai-80aa3a82/rJSuh7NkZ00k8fzX/images/instances-sshscp-4.webp?w=840&fit=max&auto=format&n=rJSuh7NkZ00k8fzX&q=85&s=3d35d7fb1b7d2d5a1bd7731a02d5dff2 840w, https://mintcdn.com/vastai-80aa3a82/rJSuh7NkZ00k8fzX/images/instances-sshscp-4.webp?w=1100&fit=max&auto=format&n=rJSuh7NkZ00k8fzX&q=85&s=e259ec3f325fa860ba277948a5481ce8 1100w, https://mintcdn.com/vastai-80aa3a82/rJSuh7NkZ00k8fzX/images/instances-sshscp-4.webp?w=1650&fit=max&auto=format&n=rJSuh7NkZ00k8fzX&q=85&s=53eb278140b2d8dd6507121fcaada6ee 1650w, https://mintcdn.com/vastai-80aa3a82/rJSuh7NkZ00k8fzX/images/instances-sshscp-4.webp?w=2500&fit=max&auto=format&n=rJSuh7NkZ00k8fzX&q=85&s=29713333a4bf70aac4f71d5d96fb8bee 2500w" />397</Frame>398399### Direct vs Proxy Connections400401Vast offers both proxy (default) and direct connection methods for SSH:402403* **Proxy SSH**: Works on all machines, slower for data transfer, uses Vast proxy server404* **Direct SSH**: Requires machines with open ports, faster and more reliable, preferred method405406We connect you to a tmux session by default for reliability and to prevent unintentional termination of foreground processes. You can create a new bash terminal window with `ctrl+b` + `c`. Cycle through your windows with `ctrl+b` + `n`407408There is an excellent guide for getting to grips with tmux at [https://tmuxcheatsheet.com](https://tmuxcheatsheet.com/)409410If, however, you would prefer to disable TMUX, you can apply the following either in a terminal or from your template's on-start section.411412## SSH Local Port Forwarding413414An often overlooked feature of SSH is its ability to forward local ports to another machine. When you access a server remotely over SSH, you can make ports from the remote machine available as if they were listening on your own device. This is a secure alternative to opening ports on the public interface as all data is transported over the SSH connection.415416This SSH command connects to the remote instance and sets up **local port forwarding** (SSH tunneling):417418**Connection details:**419420* Connects to IP 180.123.123.123 as user root421* Uses port 1234 instead of the default SSH port 22422423**Port forwarding (the key part):**424425* `-L 8080:localhost:8080` - Creates a tunnel so when you access localhost:8080 on your local machine, it forwards to port `8080` on the remote server426* `-L 5000:localhost:5000` - Same thing for port `5000`427428You can repeat the `-L` arguments to forward as many ports as you need.429430**What this means:** After connecting, you can open your web browser and go to [https://localhost:8080](https://localhost:8080) or [http://localhost:5000](http://localhost:5000) on your local computer, and you'll actually be accessing services running on those ports on the remote server. It's like creating secure "tunnels" through the SSH connection to reach applications on the remote machine that might not be directly accessible from the internet.431432## SSH Alternative - Jupyter Terminal433434As a simple alternative to SSH, you might like to consider Jupyter Terminal instead. All instances started in Jupyter launch mode will have this enabled. It is a very straightforward web-based terminal with session persistence. It's great for a quick CLI session.435436Access the terminal from the SSH connections interface.437438<img src="https://mintcdn.com/vastai-80aa3a82/rJSuh7NkZ00k8fzX/images/instances-sshscp-5.webp?fit=max&auto=format&n=rJSuh7NkZ00k8fzX&q=85&s=209bceca0c9c25960269d6af03a4ec00" alt="" data-og-width="800" width="800" data-og-height="174" height="174" data-path="images/instances-sshscp-5.webp" data-optimize="true" data-opv="3" srcset="https://mintcdn.com/vastai-80aa3a82/rJSuh7NkZ00k8fzX/images/instances-sshscp-5.webp?w=280&fit=max&auto=format&n=rJSuh7NkZ00k8fzX&q=85&s=7fd1f0b63e9e32976482c161d8adb0ff 280w, https://mintcdn.com/vastai-80aa3a82/rJSuh7NkZ00k8fzX/images/instances-sshscp-5.webp?w=560&fit=max&auto=format&n=rJSuh7NkZ00k8fzX&q=85&s=3a37e3391a09f2b2d5442640ad5371a1 560w, https://mintcdn.com/vastai-80aa3a82/rJSuh7NkZ00k8fzX/images/instances-sshscp-5.webp?w=840&fit=max&auto=format&n=rJSuh7NkZ00k8fzX&q=85&s=445a424b204acae3aa5892c0fb5e19f7 840w, https://mintcdn.com/vastai-80aa3a82/rJSuh7NkZ00k8fzX/images/instances-sshscp-5.webp?w=1100&fit=max&auto=format&n=rJSuh7NkZ00k8fzX&q=85&s=3a1c02fd93343b38f04db5301a07abe1 1100w, https://mintcdn.com/vastai-80aa3a82/rJSuh7NkZ00k8fzX/images/instances-sshscp-5.webp?w=1650&fit=max&auto=format&n=rJSuh7NkZ00k8fzX&q=85&s=9f74b697ddbcd0b226db17785c72ff8d 1650w, https://mintcdn.com/vastai-80aa3a82/rJSuh7NkZ00k8fzX/images/instances-sshscp-5.webp?w=2500&fit=max&auto=format&n=rJSuh7NkZ00k8fzX&q=85&s=19409536de358a89230eeb9f50f1683c 2500w" />439440### Permission Denied (publickey)441442If you get this error when trying to SSH:4434441. Ensure your SSH key is added to your [Vast account](https://cloud.vast.ai/manage-keys/)4452. Verify you're using the correct private key4463. Check key file permissions: `chmod 600 ~/.ssh/id_ed25519`4474. Use `-vv` flag for detailed debug info: `ssh -vv -p PORT root@IP`448449* New account keys only apply to NEW instances created after adding the key450* Existing instances keep their original keys (won't get new keys automatically)451* For VM instances, changing keys requires recreating the VM452* To add keys to existing instances, use the instance-specific SSH interface453454### General Connection Issues455456You can often determine the exact cause of a connection failure by using the -vv arguments with ssh to get more information.457458Common reasons include:459460* Using the wrong private key461* Incorrect permissions for your private key462* Public key not added to instance or account463* Connecting to the wrong port464465## SCP & SFTP File Transfer466467Both **SCP** (Secure Copy Protocol) and **SFTP** (SSH File Transfer Protocol) are tools for securely transferring files that piggyback on the SSH protocol. They use the same authentication and encryption as SSH.468469### SCP (Secure Copy Protocol)470471* **What it is:** Simple, command-line tool for copying files between local and remote machines472* **Best for:** Quick, one-time file transfers473* **Syntax:** `scp -P <port> source destination`474475```bash Bash theme={null}476477**Examples:**478479Example 1 (unknown):480```unknown481482```483484Example 2 (unknown):485```unknown486</CodeGroup>487488 1. Creates two files (by default in \~/.ssh/):489 * id\_ed25519 → your **private key** (keep safe, never share).490 * id\_ed25519.pub → your **public key** (safe to share, add to servers).491 2. -C "[your\_email@example.com](mailto:your_email@example.com)" is optional. Whatever you put there is stored as a comment in the public key file (e.g., id\_ed25519.pub). It's just for identification (helpful if you use multiple keys), not for security.492493 <Note>494 When you run ssh-keygen -t ed25519 in **Windows PowerShell**, the keys are created in your Windows user profile folder:495 `C:\Users\<YourUsername>\.ssh\`496 </Note>497498 **2. Copy your public key.**499500 <CodeGroup>501```502503Example 3 (unknown):504```unknown505506```507508Example 4 (unknown):509```unknown510</CodeGroup>511512 **3. Add it in your** [**vast account**](https://cloud.vast.ai/manage-keys/)513514 <img src="https://mintcdn.com/vastai-80aa3a82/rJSuh7NkZ00k8fzX/images/instances-sshscp.webp?fit=max&auto=format&n=rJSuh7NkZ00k8fzX&q=85&s=0c4875e49e2b1250de56ca5d06c8dd8a" alt="" data-og-width="914" width="914" data-og-height="684" height="684" data-path="images/instances-sshscp.webp" data-optimize="true" data-opv="3" srcset="https://mintcdn.com/vastai-80aa3a82/rJSuh7NkZ00k8fzX/images/instances-sshscp.webp?w=280&fit=max&auto=format&n=rJSuh7NkZ00k8fzX&q=85&s=ce25808c68ef5747ae61afc47e21dbac 280w, https://mintcdn.com/vastai-80aa3a82/rJSuh7NkZ00k8fzX/images/instances-sshscp.webp?w=560&fit=max&auto=format&n=rJSuh7NkZ00k8fzX&q=85&s=ad998abfde5ababac4ce81f09fd2d465 560w, https://mintcdn.com/vastai-80aa3a82/rJSuh7NkZ00k8fzX/images/instances-sshscp.webp?w=840&fit=max&auto=format&n=rJSuh7NkZ00k8fzX&q=85&s=d02a30b53bd09b1014350478397dece5 840w, https://mintcdn.com/vastai-80aa3a82/rJSuh7NkZ00k8fzX/images/instances-sshscp.webp?w=1100&fit=max&auto=format&n=rJSuh7NkZ00k8fzX&q=85&s=8154e85ec34d201cde1ae4647f334bec 1100w, https://mintcdn.com/vastai-80aa3a82/rJSuh7NkZ00k8fzX/images/instances-sshscp.webp?w=1650&fit=max&auto=format&n=rJSuh7NkZ00k8fzX&q=85&s=6577c4d72389e767fb8ffe14e92167f8 1650w, https://mintcdn.com/vastai-80aa3a82/rJSuh7NkZ00k8fzX/images/instances-sshscp.webp?w=2500&fit=max&auto=format&n=rJSuh7NkZ00k8fzX&q=85&s=7e4c0d56416402102e8e115bc9c481e6 2500w" />515 </Tab>516517 <Tab title="Vast CLI">518 **Add & Generate SSH Key (using** [**Vast CLI**](/cli/get-started)**)**519520 1. **Install Vast CLI:**521522 <CodeGroup>523```524525---526527## unlist volume528529**URL:** llms-txt#unlist-volume530531Source: https://docs.vast.ai/api-reference/volumes/unlist-volume532533api-reference/openapi.json post /api/v0/volumes/unlist/534Remove a volume listing from the marketplace.535536CLI Usage: `vastai unlist volume <volume_id>`537538---539540## streaming response from model API to client541542**URL:** llms-txt#streaming-response-from-model-api-to-client543544class GenerateStreamHandler(EndpointHandler[InputData]):545 @property546 def endpoint(self) -> str:547 return "/generate_stream"548549@classmethod550 def payload_cls(cls) -> Type[InputData]:551 return InputData552553def generate_payload_json(self, payload: InputData) -> Dict[str, Any]:554 return dataclasses.asdict(payload)555556def make_benchmark_payload(self) -> InputData:557 return InputData.for_test()558559async def generate_client_response(560 self, client_request: web.Request, model_response: ClientResponse561 ) -> Union[web.Response, web.StreamResponse]:562 match model_response.status:563 case 200:564 log.debug("Streaming response...")565 res = web.StreamResponse()566 res.content_type = "text/event-stream"567 await res.prepare(client_request)568 async for chunk in model_response.content:569 await res.write(chunk)570 await res.write_eof()571 log.debug("Done streaming response")572 return res573 case code:574 log.debug("SENDING RESPONSE: ERROR: unknown code")575 return web.Response(status=code)576577---578579## remove defjob580581**URL:** llms-txt#remove-defjob582583Source: https://docs.vast.ai/api-reference/machines/remove-defjob584585api-reference/openapi.json delete /api/v0/machines/{machine_id}/defjob/586Deletes the default job (background instances) for a specified machine.587588CLI Usage: `vastai remove defjob <machine_id>`589590---591592## Creating Templates for GROBID593594**URL:** llms-txt#creating-templates-for-grobid595596**Contents:**597- Introduction598- Find The Image and Tag You Want to Use599 - Step 1 - Find a Suitable Image600 - Step 2 - Selecting the Version Tag601- Configuring The Template602 - Step 1 - Setting Your Chosen Image and Tag in Your Vast.ai Template603 - Step 2 - Map Ports and Specify Your Image and Tag Combination604 - Step 3 - Select the Launch Mode605 - Step 4 - Look for CMD or ENTRYPOINT command606 - Step 5 - Fill Out On-start Script section using the CMD command we just found607608Source: https://docs.vast.ai/documentation/templates/examples/grobid609610This guide demonstrates creating a template using an existing Docker image. See our [Creating Templates](/documentation/templates/creating-templates) guide for more details on template configuration. We will be using the image from [GROBID on dockerhub](https://hub.docker.com/r/grobid/grobid).611612## Find The Image and Tag You Want to Use613614### Step 1 - Find a Suitable Image615616There are multiple GROBID images in dockerhub, but for this guide we will be using the official GROBID image.617618<Frame caption="Grobid Overview">619 ![Grobid620621…(truncated)