Skip to content

Dg sdk

dg_sdk

This class is the entrypoint for DeGirumJS, responsible for creating AIServerZoo / AIServerCloudZoo / CloudServerCloudZoo instances.

Kind: global class

new dg_sdk()

Example (Usage:)

let dg = new dg_sdk();
let zoo = await dg.connect('ws://localhost:8779', 'https://hub.degirum.com/degirum/public', secretToken);

dg_sdk.connect(dest, [zooUrl], [token]) ⇒ AIServerZoo | AIServerCloudZoo | CloudServerCloudZoo

Connects to an AI Server or Cloud model zoo based on the provided parameters.

This method supports three modes of inference:

  1. AIServer inference with AIServer model zoo.
  2. AIServer inference with Cloud model zoo.
  3. Cloud inference with Cloud model zoo.

Kind: instance method of dg_sdk
Returns: AIServerZoo | AIServerCloudZoo | CloudServerCloudZoo -

  • An instance of the appropriate zoo class based on the parameters.

Param Type Default Description
dest string

The destination address or alias ('cloud' for cloud inference).

[zooUrl] string null

The URL of the cloud model zoo (required for cloud model access in AIServerCloudZoo / CloudServerCloudZoo inference).

[token] string null

The authentication token for the model zoo (required for cloud model access).

Example (AIServer inference with AIServer model zoo:)

let zoo = await dg.connect('ws://localhost:8779');
Example (AIServer inference with Cloud model zoo:)
let zoo = await dg.connect('ws://localhost:8779', 'https://hub.degirum.com/degirum/public', secretToken);
Example (Cloud inference with Cloud model zoo:)
let zoo = await dg.connect('cloud', 'https://hub.degirum.com/degirum/public', secretToken);

dg_sdk.getSupportedDevices(inferenceHostAddress, [token]) ⇒ Promise.<Array.<string>>

Gets the list of supported devices for inference as a list of "RUNTIME/DEVICE" strings.

Kind: instance method of dg_sdk
Returns: Promise.<Array.<string>> -

  • A promise that resolves with the list of supported runtime/device strings.

Param Type Default Description
inferenceHostAddress string

The address of the inference host, either an AIServer IP address or 'cloud'

[token] string null

Cloud authentication token (required only for cloud).