Examples

Reserve A100 GPUs using MultiOn Agent API

This example goes over how to use our Agent API to reserve an A100 GPU instance on Hyperstack.

Install Required Packages

Ensure you have the necessary packages installed by running the following commands in your terminal:

$pip install multion

Import Required Libraries

In your Python script, import the required libraries for the example:

1import multion

Initialize Multion Client

1from multion.client import MultiOn
2
3multion = MultiOn(api_key="MULTION_API_KEY")

Autonomous mode: Browse

1PROMPT = f"""
2You are an expert AI Agent whose job is to find and get an A100 GPU on a given service HYPERSTACK (https://www.hyperstack.cloud). Pass in the full detailed instructions exactly as below to MultiOn for browsing.
3
4 Here are the high-level steps:
5 1. Login and go to reach the gpu selection page
6 2. Click on the Load Provising profile and then select the multion-profile and load it
7 3. After the profile has been correctly selected and loaded continue
8 4. If an on-demand A100 GPU is available with 80GB RAM, then reserve it
9 5. If reservation is successful, then enable ssh access and return public ip to access the machine
10"""
11
12response = multion.browse(
13 cmd=PROMPT,
14 url="https://www.hyperstack.cloud/"
15)
16print(response.message)

Thank you for exploring this MultiOn Agent API example. Should you have any questions, feel free to reach out on our Discord channel or directly to our team. Happy building! 😊