# Edge deployment

Pipeline can be deployed to an EdgeAI-compatible device. Currently, we support the following models.

Brand Model
NVIDIA Jetson TX2 (opens new window)
NVIDIA Jetson TX2 NX (opens new window)
NVIDIA Jetson Xavier NX (opens new window)
Linux, NVIDIA Ubuntu 20.04, GeForce RTX 3080 (opens new window)

These EdgeAI runtimes are currently not available to the public but you can always reach our sales for early preview.

# Calling from an external program

An external program can make a request to the pipeline running in an edge device by calling the endpoint /api/v1/pipeline with a POST method. dataUrl is used to specify the data URI of the image. Sample JavaScript codes are illustrated as follows.

const fs = require('fs');
const fetch = require('node-fetch');

const deviceEndpoint = 'http://192.168.0.1:8888';
const pipelineId = '[your pipeline id]';
const blockId = '[your block id]';
const edgeAiKey = '[your edgeai key]';
const file = fs.readFileSync('your-image.png');

(async () => {
  const res = await fetch(`${deviceEndpoint}/api/v1/pipeline/${pipelineId}/${blockId}`, {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
      'x-edgeai-key': edgeAiKey,
    },
    body: JSON.stringify({
      dataUrl: `data:image/png;base64,${file.toString('base64')}`,
    }),
  });

  console.log(await res.json());
})();

The above codes return the JSON object.

TIP

In the block, remember to return the value of metadata. Otherwise, routing information loss would result in failure.