DocsReference
Headless mode and the CLI
Run ModelDeck's engines, local server and MCP server with no window, and control them with the modeldeck command.
Coming in the next release
Everything on this page is merged into ModelDeck but is not in a published release yet.
What it is
Headless mode runs ModelDeck's engines, the local server and the MCP server with no window, no menu bar icon and no display. It works on macOS, Windows and Linux. You control it with the modeldeck command.
It uses the same folder as the app, ~/.modeldeck, so your models, presets, settings, downloads and logs are shared. Only one of the two can run the engines at a time; see The app and headless mode.
Headless mode ships as a separate archive, not inside the Mac app. It is not offered for download on this site yet.
- Unpack the archive
modeldeck-headless-<platform>-<arch>, with its own Node runtime - Run
modeldeck serveEngines, the local server and MCP start - Load a model
modeldeck load <model>, or let a request load it - Call the APIAny OpenAI or Anthropic client, as with the app
- StopCtrl+C, or
modeldeck stop
Install
The archive holds bin/modeldeck (modeldeck.cmd on Windows), the program, its own Node runtime, the engine help files and the licenses. On Windows and Linux it also holds the llama.cpp engine. On a Mac it uses llama.cpp from Homebrew, like the app.
macOS
The archive is not signed, so clear the quarantine flag after unpacking it:
xattr -dr com.apple.quarantine <folder>
Splash, GGUF and MLX all work, as in the app.
Windows
Unpack the .zip and run bin\modeldeck.cmd. GGUF is the only engine.
Linux
Unpack the .tar.gz and run bin/modeldeck. GGUF is the only engine.
Serve
modeldeck serve
ModelDeck prints the API and MCP addresses and keeps running until you press Ctrl+C or run modeldeck stop.
| Option | What it does |
|---|---|
--port N | Use this port for the local server for this run. 8000 and 8001 are refused. Engines still use 8101 to 8199. |
--no-mcp | Do not start the MCP server. |
--quiet | Print less. |
The memory check, the API key, loading on first request and idle unloading work as in the app, from the same settings.
Commands
| Command | What it does |
|---|---|
modeldeck serve | Run in the foreground. |
modeldeck stop | Stop a headless ModelDeck and its engines. |
modeldeck status | Who owns this ModelDeck folder, the server address, whether it needs a key, and the loaded models. |
modeldeck models [--rescan] | Models on this computer, with id, name, engine, size and quant. |
modeldeck engines | Each engine, whether it is available, and its version. |
modeldeck ps | Loaded models. |
modeldeck load <model> [--preset P] [--ctx N] [--ttl M] [--no-wait] | Load a model by library id, name or a unique part of its name, and wait until it is ready. --ttl sets the idle minutes. |
modeldeck unload <model> | Unload a model. |
modeldeck search <query> [--limit N] | Search Hugging Face. |
modeldeck download <repo> <file...> | Download files into the model folder. Ctrl+C stops watching; the download stays resumable. |
modeldeck downloads | Downloads and their progress. |
modeldeck logs [<instance>] [--follow] [--limit N] | The app log, or one engine's log. |
modeldeck service install, uninstall, status | Run headless ModelDeck at login. See Start at login. |
Every command takes --home <dir> to use another ModelDeck folder, --json for raw output, --help and --version.
| Exit code | Meaning |
|---|---|
| 0 | Done. |
| 1 | Error. |
| 2 | Wrong usage. |
| 3 | Another ModelDeck owns this folder. |
| 4 | Nothing is running. |
The app and headless mode
One ModelDeck at a time owns the engines and the local server for a ModelDeck folder.
- If the app is running,
modeldeck servestops with exit code 3. Other commands, such asstatus,loadandmodels, talk to the app instead. - If headless ModelDeck is running, opening the app shows "ModelDeck is already running without a window" and quits. Stop headless mode with
modeldeck stop(ormodeldeck service uninstallif it runs as a service), then open the app. - A ModelDeck that crashed is noticed within about two minutes, so the next one can start.
Headless mode cannot read API provider keys saved in the app, so it uses local engines only.
Start at login
modeldeck service install sets headless ModelDeck to start when you log in. Add --dry-run to see what it would do without doing it.
macOS
It installs a launch agent for your user, which restarts ModelDeck if it exits with an error. Its output goes to ~/.modeldeck/logs/headless.log. It never touches the Splash background server or the app's own login item.
Windows
It adds a scheduled task for your user, ModelDeck\Headless, that starts at logon and restarts up to three times. Stop it with modeldeck stop; ending the task in Task Scheduler kills ModelDeck without stopping its engines.
Linux
It adds a systemd user service, modeldeck.service, and enables it. Read its log with journalctl --user -u modeldeck. To start it at boot without logging in, run loginctl enable-linger $USER yourself; ModelDeck prints the command but never runs it.
modeldeck service uninstall stops a running headless ModelDeck first, so its engines stop cleanly.
For the steps in order, with how to preview, check and remove it, see Run headless as a service. To try headless mode first, follow Run ModelDeck with no window.