Remote allows you to provision GPU instances programmatically using Python. Specify the instance type and quantity to provision GPU instances.
# Specify GPU instance type and quantityinstance_type ='remotex2.x4090'num_instances =5# Provision GPU instancesinstances = client.provision_instances(instance_type, num_instances)# Access instance detailsfor instance in instances:print(f"Instance ID: {instance.id}, Public IP: {instance.public_ip}, Status: {instance.status}")
Creating New Instances and Deducting Balance
With the updated functionality, users can create new instances and deduct the cost from their Remote Dashboard balance using their API key.
# Define GPU type and quantitygpu_types ={'remotex2.x4090':1,'remotex2.xa100':2,# Add more GPU types as needed}# Calculate total costtotal_cost =sum(client.get_instance_cost(gpu_id) * quantity for gpu_id, quantity in gpu_types.items())# Deduct balance from Remote Dashboardclient.deduct_balance(total_cost)# Provision new instancesfor gpu_id, quantity in gpu_types.items(): instances = client.provision_instances(gpu_id, quantity)for instance in instances:print(f"Instance ID: {instance.id}, Public IP: {instance.public_ip}, Status: {instance.status}")