Quickstart Guide
GPU instances with Shadeform's API
š Shadeform GPU Instances - Quickstart Guide
Welcome to the Shadeform API Quickstart Guide! This notebook will walk you through the complete lifecycle of GPU instances on Shadeform:
| Step | Operation | Description |
|---|---|---|
| 1ļøā£ | Find | Search for available GPU instances |
| 2ļøā£ | Launch | Create and spin up your instance |
| 3ļøā£ | Monitor | Check instance status until ready |
| 4ļøā£ | Connect | SSH into your GPU instance |
| 5ļøā£ | Manage | Restart 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:
| Requirement | Action | Link |
|---|---|---|
| š° Wallet Balance | Top up your account wallet | Add Funds ā |
| š API Key | Generate your Shadeform API key | Get API Key ā |
ā ļø Important: Keep your API key secure and never commit it to public repositories!
ā 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:
| Parameter | Description | Example |
|---|---|---|
gpu_type | Type of GPU | A6000, A100, H100 |
num_gpus | Number of GPUs | 1, 2, 4, 8 |
available | Only show available instances | true |
sort | Sort results | price (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:
| Parameter | Description |
|---|---|
cloud | Cloud provider (from search results) |
region | Deployment region |
shade_instance_type | Instance type identifier |
shade_cloud | Use Shadeform's managed environment |
name | A friendly name for your instance |
ā±ļø Note: Instance creation typically takes 3-5 minutes depending on the GPU type.
ā ļø 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) āāāāāāāāāāāāāāā
| Status | Description |
|---|---|
pending | Instance is being provisioned |
active | Ready to use! IP address available |
deleted | Instance 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>
š 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
200response 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:
ā
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
| Endpoint | Method | Description |
|---|---|---|
/instances/types | GET | Search available instance types |
/instances/create | POST | Launch a new instance |
/instances/{id}/info | GET | Get instance details |
/instances/{id}/restart | POST | Restart an instance |
/instances/{id}/delete | POST | Terminate an instance |
Available GPU Types
| GPU | VRAM | Best For |
|---|---|---|
| A6000 | 48 GB | Training, fine-tuning medium models |
| A100 | 40/80 GB | Large model training, inference |
| H100 | 80 GB | Cutting-edge LLM training |
| RTX 4090 | 24 GB | Inference, smaller training jobs |
š Additional Resources
- š Full API Documentation
- š» Shadeform Dashboard
- š° Billing & Wallet
- š API Key Management
- š SSH Key Settings
Happy GPU Computing! š
Built with ā¤ļø using Shadeform