Skip to main content

Overview

The rent_compute action allows you to rent GPU machines on the Hyperbolic platform. This function creates a marketplace instance with specified GPU resources.

Function Signature

def rent_compute(cluster_name: str, node_name: str, gpu_count: str) -> str

Input Schema

cluster_name
string
required
The cluster name that the user wants to rent from. Obtain this from the get_available_gpus action.
node_name
string
required
The node ID that the user wants to rent. Obtain this from the get_available_gpus action.
gpu_count
string
required
The number of GPUs to allocate from the node.

Response

Returns a formatted JSON string containing the API response with instance details.
response
string
A formatted JSON string representation of the created marketplace instance, including instance ID, status, and configuration details.

API Endpoint

POST https://api.hyperbolic.xyz/v1/marketplace/instances/create

Example Usage

from hyperbolic_agentkit_core.actions import rent_compute

# Rent 2 GPUs from a specific cluster and node
result = rent_compute(
    cluster_name="us-east-1",
    node_name="node-12345",
    gpu_count="2"
)

print(result)

Important Notes

  • All inputs must be provided to process the rental
  • If you haven’t used the get_available_gpus action in the conversation, always use it first to get valid cluster and node names
  • After renting, you can find the instance through the get_gpu_status action
  • Access the instance through the ssh_access action
  • Run commands on it through the remote_shell action
  • Requires HYPERBOLIC_API_KEY environment variable

Error Handling

The function raises:
  • ValueError: If any required parameter (cluster_name, node_name, gpu_count) is missing or invalid
  • requests.exceptions.RequestException: If the API request fails, including HTTP errors with response details

Build docs developers (and LLMs) love