SDKs

SDKs

In this section, we will introduce how to use the SDK to interact with ModelZ.

Python

We provide a Python SDK for interacting with ModelZ. You can install it with pip:

pip install modelz-py

You could use the following code to make a prediction request to the stable diffusion mosec server:

# pip install modelz-py
import modelz
 
# Or you could set the environment variable MODELZ_API_KEY
key = "mzi-abcde..."
 
client = modelz.ModelzClient(key=key, deployment="stable-diffusion-w41s2qknzjo0fk3i")
resp = client.inference(params="cute cat", serde="msgpack")
resp.save_to_file("inference.jpg")