Notebooks
S
Shadeform
Quickstart Guide

Quickstart Guide

GPU instances with Shadeform's API

šŸš€ Shadeform GPU Instances - Quickstart Guide

Shadeform Logo

Welcome to the Shadeform API Quickstart Guide! This notebook will walk you through the complete lifecycle of GPU instances on Shadeform:

StepOperationDescription
1ļøāƒ£FindSearch for available GPU instances
2ļøāƒ£LaunchCreate and spin up your instance
3ļøāƒ£MonitorCheck instance status until ready
4ļøāƒ£ConnectSSH into your GPU instance
5ļøāƒ£ManageRestart or delete when done

šŸ’” Tip: All operations can also be performed via the Shadeform UI


šŸ“‹ Prerequisites

Before getting started, make sure you have completed these two steps:

RequirementActionLink
šŸ’° Wallet BalanceTop up your account walletAdd Funds →
šŸ”‘ API KeyGenerate your Shadeform API keyGet API Key →

āš ļø Important: Keep your API key secure and never commit it to public repositories!

[1]
āœ… Setup complete! Libraries imported and API configured.

1ļøāƒ£ Finding a GPU Instance

Use the /instances/types endpoint to search for available GPU instances. You can filter by:

ParameterDescriptionExample
gpu_typeType of GPUA6000, A100, H100
num_gpusNumber of GPUs1, 2, 4, 8
availableOnly show available instancestrue
sortSort resultsprice (cheapest first)

Let's find the cheapest available A6000 instance:

[ ]
[ ]

2ļøāƒ£ Launching the Instance

Now let's launch our GPU instance using the /instances/create endpoint.

Required Parameters:

ParameterDescription
cloudCloud provider (from search results)
regionDeployment region
shade_instance_typeInstance type identifier
shade_cloudUse Shadeform's managed environment
nameA friendly name for your instance

ā±ļø Note: Instance creation typically takes 3-5 minutes depending on the GPU type.

[2]
āš ļø Demo mode: Uncomment the launch_instance() call above to create a real instance

3ļøāƒ£ Checking Instance Status

Monitor your instance using the /instances/{id}/info endpoint. The instance will transition through these states:

	ā”Œā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”     ā”Œā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”     ā”Œā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”
│ pending  │ ──► │  active  │ ──► │ deleted  │
ā””ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”˜     ā””ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”˜     ā””ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”˜
     │                                  ā–²
     └──────────► (error) ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”˜

StatusDescription
pendingInstance is being provisioned
activeReady to use! IP address available
deletedInstance has been terminated
[ ]
[ ]

4ļøāƒ£ Connecting via SSH

Once your instance is active, you can SSH into it.

Step 1: Download Your Private Key

Download your Shadeform-generated private key from Settings → SSH Keys

Step 2: Set Correct Permissions

	chmod 600 ~/Downloads/private_key.pem

Step 3: Connect!

	ssh -i ~/Downloads/private_key.pem shadeform@<your-instance-ip>

šŸ”§ Troubleshooting: If you see WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED!, run:

	ssh-keygen -R <your-instance-ip>

[3]
šŸ” SSH CONNECTION DETAILS
==================================================

    šŸ“ IP Address:    123.45.67.89
    šŸ‘¤ Username:      shadeform
    šŸ”Œ Port:          22
    šŸ”‘ Key File:      ~/Downloads/private_key.pem
    
    šŸ“‹ Copy this command to connect:
    ā”Œā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€
    │  ssh -i ~/Downloads/private_key.pem -p 22 shadeform@123.45.67.89
    └──────────────────────────────────────────────────
    
    šŸ”§ If you get a host key error, run:
    │  ssh-keygen -R 123.45.67.89
    
'ssh -i ~/Downloads/private_key.pem -p 22 shadeform@123.45.67.89'

5ļøāƒ£ Managing Your Instance

Restart Instance

Use the /instances/{id}/restart endpoint to reboot your instance.

āš ļø A 200 response confirms the restart was initiated, not completed. Wait a few minutes before reconnecting.

Delete Instance

Use the /instances/{id}/delete endpoint to terminate and remove your instance.

šŸ’” Important: Always delete instances when you're done to avoid unnecessary charges!

[ ]

šŸ› ļø Bonus: All-in-One Helper Class

Here's a convenient wrapper class that combines all the functionality above:

[4]
āœ… ShadeformClient class is ready to use!

Example workflow:
─────────────────────────────────────────────
client = ShadeformClient("your-api-key")

# Find cheapest A6000
instances = client.find_instances(gpu_type="A6000")

# Launch it
instance_id = client.launch(instances[0], name="my-gpu")

# Wait for it to be ready
info = client.wait_until_active()

# Get SSH command
print(client.ssh_command())

# When done, delete it
client.delete()
─────────────────────────────────────────────


šŸ“š API Reference Summary

EndpointMethodDescription
/instances/typesGETSearch available instance types
/instances/createPOSTLaunch a new instance
/instances/{id}/infoGETGet instance details
/instances/{id}/restartPOSTRestart an instance
/instances/{id}/deletePOSTTerminate an instance

Available GPU Types

GPUVRAMBest For
A600048 GBTraining, fine-tuning medium models
A10040/80 GBLarge model training, inference
H10080 GBCutting-edge LLM training
RTX 409024 GBInference, smaller training jobs

šŸ”— Additional Resources


Happy GPU Computing! šŸš€

Built with ā¤ļø using Shadeform