GuidesRecipesAPI ReferenceChangelogDiscussions
Log In

How to Deploy a Model to the Edge

📘

Before deploying a model to your edge device the following dependencies must be met

  • ARM or x86 CPU
  • Linux or Unix operating system
  • Docker
  • Enough storage and memory to load and run your chosen models

If you've already created a device group and generated a device token you're ready to deploy a model to the edge.

You can either do this by installing Modzy Core automatically with a script, or with a manual download and installation process.

:fast-forward: Automatic installation script (via curl)

To install Modzy Core automatically on an edge device, start by copying the curl command that was generated when you created a device token for your device group. The script should look something like the example below, except that the domains will be specific to your instance of Modzy and the token at the end will look different.

$ curl -fsSL 'https://trail.app.modzy.com/scripts/install-modzy-core.sh' | sh -s - https://trial.app.modzy.com s.94dKziCDmsIWU3z4x0VDhLTC

Next, just follow these simple installation steps:

  1. Log in to your edge device (via SSH or remote desktop)
  2. Open up a terminal
  3. Paste the commands you just generated into your terminal window

After running these commands you should see a lot of messages appearing in your terminal providing status information about the installation process:

[INFO]  Downloading binary https://trial.app.modzy.com/api/downloads/modzy-core-linux-arm64
[INFO]  Copying binary to /opt/modzy/bin/modzy-core
[INFO]  Creating symlink to /usr/local/bin/modzy-core
[INFO]  Registering edge device with Modzy at https://trial.app.modzy.com
2023-11-14T09:53:28.799-0500	INFO	cmd/register.go:36	beginning device registration process
2023-11-14T09:53:30.936-0500	INFO	modzy/registration.go:67	registration with Modzy server successful
2023-11-14T09:53:30.937-0500	INFO	modzy/registration.go:68	caching registration information
2023-11-14T09:53:30.942-0500	INFO	modzy/registration.go:85	registration complete. Core is ready to start in server or direct mode
[INFO]  Installing Modzy Core
2023-11-14T09:53:31.977-0500	INFO	cmd/install.go:115	Modzy Core installed on system successfully
2023-11-14T09:53:31.978-0500	INFO	cmd/install.go:116	The modzy core binary has been moved to '/opt/modzy/bin' It is recommended that you add /opt/modzy/bin to your $PATH

After completing the installation process, you can check on the status of Modzy Core, by typing

$ modzy-core status
modzy-core.service - Service for Modzy Core
   Loaded: loaded (/etc/systemd/system/modzy-core.service; enabled; vendor preset: enabled)
   Active: active (running) since Tue 2023-11-14 09:53:31 EST; 1min ago
 Main PID: 14707 (modzy-core)
    Tasks: 13 (limit: 4181)
   CGroup: /system.slice/modzy-core.service
           └─14707 /opt/modzy/bin/modzy-core server --storage.filesystem.path /opt/modzy/core/data

If you see a green light beside the line modzy-core.service then Modzy Core is healthy and running! After about a minute, you should also see your device appear within the device group you created.

Once Modzy Core is successfully installed and your device has a live connection, any models added to your device group will begin to download and will start up in direct mode as soon as the download is complete.