Skip to main content

A python based DIANA Client for interacting with the DIANA server with higher level apis.

Project description

DIANA Client

This is a python client for the DIANA REST API. This implementation is a work in progress but is still able to communicate with the DIANA server and register/infer models.

from diana_client import HTTPClient

client = HTTPClient(
  diana_server_url = "https://diana.distributive.network",
  model_registry_url = "https://models.diana.distributive.network"
)

print(f"Can we connect? {client.check_diana_server_connection()}")

#### Register a Model

response = client.register_model(
    model_name = "my_model",
    model_path = "./my_model.onnx",
    preprocess_path = "./preprocess.py",
    postprocess_path = "./postprocess.py",
    password = "my_password",
    language = "python",
    packages = ["numpy", "pandas", "opencv-python"]
)

print(response.text) ### Model registered successfully!

#### Infer a Model

response = client.infer(
    inputs = files, # a list of the bytes of each input
    model_name = "my_model",
    slice_batch = 1, # number of inputs per slice
    inference_id = "my_inference_id", # An identifier for the inference
    compute_group_info = "joinKey/joinSecret" # The compute group info for the inference
)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

diana_client-0.2.1.tar.gz (4.6 kB view details)

Uploaded Source

Built Distribution

diana_client-0.2.1-py3-none-any.whl (5.3 kB view details)

Uploaded Python 3

File details

Details for the file diana_client-0.2.1.tar.gz.

File metadata

  • Download URL: diana_client-0.2.1.tar.gz
  • Upload date:
  • Size: 4.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.5.1 CPython/3.10.6 Linux/5.15.0-89-generic

File hashes

Hashes for diana_client-0.2.1.tar.gz
Algorithm Hash digest
SHA256 80e1161b278dbf6dce6b1c35c21dfa923b0fc7ebbf73d4fbeb50b2a7971b617a
MD5 af5f2d84d09ce7fad0a3ecd65f0e6e71
BLAKE2b-256 72d1eea69723748664b34752300f60f82071a45333d6793fae2f7bf6afda8ab8

See more details on using hashes here.

File details

Details for the file diana_client-0.2.1-py3-none-any.whl.

File metadata

  • Download URL: diana_client-0.2.1-py3-none-any.whl
  • Upload date:
  • Size: 5.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.5.1 CPython/3.10.6 Linux/5.15.0-89-generic

File hashes

Hashes for diana_client-0.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 baf204d6895ac72eaa41d77c4266601ae233ea1eb468290a0470601fc5a9f0a2
MD5 369761ca62f6696e69259abdbca9091d
BLAKE2b-256 e1541a7597da2a3f0e199ef252c1eaa4f645c8c4842a94ddd7b1e74926b9e6c7

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page