GuidesRecipesAPI ReferenceChangelogDiscussions
Log In

Changing edge serving mode

Modzy Core provides two ways to serve models server mode and direct mode. Server mode includes a local database so that past inferences can be accessed at a later date. Whereas Direct mode provides no data retention whatsoever. As a result, Direct mode is the fasted way to run inferences but, after an inference result has been returned it disappears.

Depending on how you're building applications at the edge, it may become necessary to change from serving your models from server mode to direct mode, or vice versa.

To change the serving mode that you're in:

  1. Log into your edge device via ssh or remote desktop

  2. Open up a terminal and type sudo vi /etc/systemd/system/modzy-core.service or otherwise prepare to edit the modzy-core.service file.
    This will open up a configuration file that should look something like this

    [Unit]
    Description=Service for Modzy Core
    Requires=docker.service
    Wants=network.target
    After=docker.service
    
    [Service]
    EnvironmentFile=-/etc/environment
    ExecStart=/opt/modzy/bin/modzy-core server --storage.filesystem.path /opt/modzy/core/data
    SyslogIdentifier=modzy-core
    Restart=on-failure
    TimeoutStopSec=60
    Type=exec
    
    [Install]
    WantedBy=multi-user.target
    
  3. Edit the ExecStart row by replace the text server with the text direct if you want to run in direct mode. Alternatively, if your device is already in direct mode, then you can change it back by replacing this text with server.

  4. Save your edits and close the file (in vi this can be done by hitting the 'esc' key and then typing :wq before finally typing the 'enter' key).

  5. Finally, restart Modzy Core by running the following commands

sudo systemctl daemon-reload
sudo systemctl restart modzy-core