ClustroAI SDK

Introduction

ClustroAI SDK is a comprehensive toolkit designed to interact with ClustroAI's platform, providing a seamless interface for managing AI models and inference jobs. This SDK allows users to easily create, list, update, and delete models, as well as manage inference jobs, tasks, and workers programmatically.

Purpose of the SDK

The ClustroAI SDK serves as a bridge between the ClustroAI platform and users' applications, enabling automation and efficient management of various AI-related tasks. It offers the following capabilities:

  • Model Management: Create, list, update, and delete AI models.

  • Inference Jobs: Manage inference jobs, including creation, listing, updating, and deletion.

  • Task and Worker Management: Handle tasks and workers for distributed computing.

  • Enhanced Control: Run custom tasks and manage resources with admin-level controls.

Installation

To get started with the ClustroAI SDK, install it using pip:

pip install clustroai-sdk

Usage

Here's a quick guide on how to use the ClustroAI SDK:

Initializing the SDK

First, import ClustroAI from the SDK and initialize it with your API key:

from clustroai_sdk import ClustroAI

api_key = "Your Clustro API_Key"
clustroai = ClustroAI(api_key, timeout=180)

Listing Models

To list all available models:

all_models = clustroai.list_models()
print(all_models)

Retrieving a Single Model

To get details of a specific model:

single_model = clustroai.get_model("model_id_here")
print(single_model)

Running Inference Jobs

To run an inference job:

result = clustroai.run(input="Sample input", job_id='job_id_here', sync=True)
print(result)

Comprehensive API Support

The SDK offers a wide range of APIs including:

  • create_model, list_models, get_model, delete_model

  • create_inference_job, list_inference_job, delete_inference_job, update_inference_job

  • list_task, get_task, create_worker, update_worker, delete_worker, get_worker

  • run, username_run

Admin Role and Rate Limits

Note that certain APIs (create, update, and delete) require an admin role for access. Additionally, to ensure optimal performance and resource management, the SDK imposes rate limits:

  • List and Get APIs: 60 calls per minute.

  • Run and Username_Run APIs: 10 calls per minute.

If you need more call requests, please contact us


Last updated