DocsHow-to guides
Run headless as a service
Make headless ModelDeck start when you log in and restart if it fails, on macOS, Windows and Linux.
Coming in the next release
Everything on this page is merged into ModelDeck but is not in a published release yet.
modeldeck service install makes headless ModelDeck start when you log in and restarts it if it fails. You need the headless archive first; see Run ModelDeck with no window.
On every system, service install has so far been exercised only with --dry-run and with automated tests that use a stand-in for the system tools. Run the dry run first and read what it prints.
Preview what will be installed
modeldeck service install --dry-run
It prints the file it would write and the commands it would run, and changes nothing.
Install
Stop the app, or any modeldeck serve you started by hand, first. Only one ModelDeck can own a ModelDeck folder.
modeldeck service install
macOS
It writes a launch agent for your user, ~/Library/LaunchAgents/ai.modeldeck.headless.plist. The agent starts at login and restarts ModelDeck if it exits with an error. Output goes to ~/.modeldeck/logs/headless.log.
Windows
It creates a scheduled task for your user, ModelDeck\Headless. The task runs at logon with normal user rights, restarts on failure, and opens no console window. It is a scheduled task and not a Windows service, because a service would run under another account and would not see your .modeldeck folder or your models.
Linux
It writes a systemd user unit, ~/.config/systemd/user/modeldeck.service, and enables it. A user unit runs only while you are logged in. To keep it running after you log out and to start it at boot, run loginctl enable-linger $USER yourself, once. ModelDeck prints that command and never runs it, because it changes a system setting.
If you installed with --home <dir>, or with MODELDECK_HOME set, the service keeps using that folder.
Check it
modeldeck service status
modeldeck status
service status says whether the unit is installed and running. status shows the owner, the API address and the loaded models.
Load a model when it starts
Headless mode reads the same settings as the app. Turn on Load a model when ModelDeck starts in the app, under Settings > Startup, before you switch to headless mode. Or load one after it starts with modeldeck load <model>.
Read its logs
modeldeck logs --follow
modeldeck logs <instance id> --limit 50
The first follows the ModelDeck log. The second prints one engine's log; modeldeck ps lists the instance ids.
Stop or remove it
| Command | What it does |
|---|---|
modeldeck stop | Stops headless ModelDeck and its engines. The service starts it again at the next login. |
modeldeck service uninstall | Stops it cleanly, then removes the agent, task or unit. Your settings and models stay. |
On Windows, do not end the task from Task Scheduler. That kills ModelDeck without stopping its engines.
Update it
The archive has no updater. Run modeldeck service uninstall, unpack the newer archive in place of the old one, and run modeldeck service install again. Settings, models and logs live in the ModelDeck folder, not in the archive, so they are kept.