Upload custom model

To upload a custom model to RagaAI Prism, follow these steps:

from raga import *
import datetime

# Generate a unique run name
run_name = "run_name"

# Initialize a test session
test_session = TestSession(
    project_name="project_name",
    run_name=run_name,
    access_key="",  # Add your access key
    secret_key="",  # Add your secret key
    host="host_name"
)

# Define infrastructure parameters
infra_params = {
    "minReplicas": "1",
    "maxReplicas": "1",
    "workGroup": "cpu",
    "maxMemoryLimit": "3000Mi",
    "maxCpuLimit": "3000m",
    "minMemoryLimit": "3000Mi",
    "minCpuLimit": "3000m",
}

# Define input and output functions
def input_function():
    return ""

def output_function():
    return ""

# Create and load the model
model = Model(
    test_session=test_session,
    name="model-name",
    version="v1",
    description="model-description",
    docker_image="model-image",
    infra_params=infra_params,
    config_params={},
    input_func=input_function,
    output_func=output_function
)

model.load()

This script sets up and uploads a custom model using the RagaAI Prism platform, allowing you to specify model details, infrastructure, and I/O functions.

Note: Currently, model upload requires the model code to be present and built locally. An upcoming feature will allow you to upload a model directly using a Docker Hub path.

Last updated