This guide walks you through launching your first H100 GPU node on SF Compute.
Install the CLI
Install the SF Compute CLI.
curl -fsSL https://sfcompute.com/cli/install | bash
Log in
Authenticate with your SF Compute account.
This opens your browser to authenticate and stores your credentials locally.
Create an API token
Create an API token for programmatic access.
Save the token securely. Set it as an environment variable by adding it to your shell profile or using a secrets manager.
Create an SSH key pair
Generate an SSH key pair to connect to your nodes.
ssh-keygen -t ed25519 -f ~/.ssh/sf_compute
Press Enter to accept the defaults. This creates a private key at ~/.ssh/sf_compute and a public key at ~/.ssh/sf_compute.pub.
Create a node template with cloud-init
A node template captures settings like the VM image and startup script. Cloud-init lets you inject your SSH key at boot time without building a custom image.
Create a cloud-init file that adds your SSH public key.
#cloud-config
users:
- name: root
ssh_authorized_keys:
- <paste contents of ~/.ssh/sf_compute.pub>
Base64-encode the file and create a template.
curl -X POST https://api.sfcompute.com/v2/node_templates \
-H "Authorization: Bearer $SF_API_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"name": "my-template",
"image": "image_a0022b7913d20121",
"cloud_init_user_data": "'$(base64 -w 0 < cloud-init.yaml)'"
}'
For custom operating systems and software, you can upload your own VM images. See Images for details.
Create a capacity
A capacity is a bucket that holds your compute balance. Create one that references your template and automatically starts nodes when capacity is available.
curl -X POST https://api.sfcompute.com/v2/capacities \
-H "Authorization: Bearer $SF_API_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"name": "dev",
"zones": ["richmond"],
"node_template": "my-template",
"start_nodes_automatically": true
}'
Place a buy order
Orders are how you buy compute. Get timestamps for an order starting now and ending at the next hour boundary.
now=$(date +%s)
next_hour=$(( (now / 3600 + 1) * 3600 ))
echo "start_at: $now"
echo "end_at: $next_hour"
Place an order for one node.
curl -X POST https://api.sfcompute.com/v2/orders \
-H "Authorization: Bearer $SF_API_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"capacity": "dev",
"side": "buy",
"node_count": 1,
"start_at": <start_at value>,
"end_at": <end_at value>,
"limit_price_dollars_per_node_hour": "20.000000",
"allow_standing": false
}'
Check the order status.
curl https://api.sfcompute.com/v2/orders/<order_id> \
-H "Authorization: Bearer $SF_API_TOKEN"
Verify your node is running
After your order fills, list your nodes.
Once a node shows running status, connect via SSH.
Even after a node shows running status, it may take several minutes for SSH to become available while the node boots.
Sell your capacity
When you’re done with your compute, you can sell it on the market.
curl -X POST https://api.sfcompute.com/v2/orders \
-H "Authorization: Bearer $SF_API_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"capacity": "dev",
"side": "sell",
"node_count": 1,
"start_at": <start_at value>,
"end_at": <end_at value>,
"limit_price_dollars_per_node_hour": "15.000000",
"allow_standing": true
}'
When matched, credits are added to your balance.
Next steps
You’ve launched your first node. To automatically maintain a desired number of nodes over time, see the Spot Scaler guide.