Skip to main content

Magnitude

@svendowideit/magnitudev2026.10.18.1beta· MIT· 6d agoBEHAVIORSWORKFLOWSACCEPTED WARNINGS
01README

============================================================================ ⚠️ SECURITY WARNING — THIS CAN EXPOSE MAGNITUDE ON THE NETWORK ============================================================================

Turning on the network API (networkEnabled=true, a non-empty networkHost, or network.enabled in config.json) makes Magnitude listen beyond loopback; with networkHost=0.0.0.0 it listens on EVERY interface. Any device that can route to port 10100 then reaches Magnitude's web UI and its OpenAI-compatible inference API. The API needs the network access key (networkApiKey), but the UI is served to anyone, and inference is open when the key is unset/weak or requireApiKey is off. Only enable it on a network you trust; prefer binding one interface over 0.0.0.0; always set a long random networkApiKey; and front it with a TLS reverse proxy (see the README TODO) as soon as you can. The README carries the same warning and a TODO to move the bind back to loopback behind Caddy at magnitude.<host>.<zone>.

Install, upgrade and configure Magnitude (https://magnitude.dev) on a Linux machine with systemd — the whole loop from "which version is installed" to "the server is running the new package with my settings", elevated through the @svendowideit/sudo ladder. WHAT IT DOES

Closes the loop around a Magnitude (https://magnitude.dev) install on this machine: it reads the installed magnitude --version, resolves the newest release, and installs the checksum-verified distro package for this distribution and architecture (Debian/apt, RPM/dnf, Arch/pacman) only when the version actually changed — never re-downloading a ~200 MB package for a current machine. It then registers and turns on the Magnitude server (the boot service that serves models over the network) with magnitude server setup, and writes your settings — network access, API key, bind host and port — to /var/lib/magnitude/config.json, restarting only when they changed. Privileged steps are delegated to @svendowideit/sudo, so any elevation route the host already grants works. Prefer it over hand-running apt install and magnitude server setup when you want repeatable swamp workflows that reconcile the server as configuration.

INSTALL

swamp extension pull @svendowideit/magnitude

DEPENDENCIES

@svendowideit/github-release-install and @svendowideit/sudo, declared in dependencies: and installed by the single pull above. The bundled workflow calls github-release-install to resolve the release, match the platform package, record its SHA-256 and download a verified package only when an update is needed; it calls sudo's named operations for every privileged step. A GitHub token is optional (GITHUB_TOKEN / GH_TOKEN / gh auth token).

RUN

# Install or upgrade Magnitude and register its server. Idempotent:
# re-running is a no-op when nothing changed.
swamp workflow run @svendowideit/magnitude-install

# Turn on the network API, set its key and bind it to the LAN.
swamp workflow run @svendowideit/magnitude-install \
  --input networkEnabled=true \
  --input networkApiKey=mag_examplekey --input networkHost=0.0.0.0

# Ask for the installed version, the path and the exact status command.
swamp model @svendowideit/magnitude method run sync magnitude
swamp model @svendowideit/magnitude method run print magnitude

# Upgrade an existing install in one idempotent command — re-running is a
# no-op unless a new release, a changed setting or a stopped server needs
# reconciling. Same loop as installing; nothing to pass.
swamp workflow run @svendowideit/magnitude-upgrade

# Remove it again, keeping the downloaded models and settings.
swamp workflow run @svendowideit/magnitude-install --input uninstall=true

CONFIGURE

Workflow inputs (all optional, with defaults), also settable as model global args with --global-arg and overridable per call with --input:

repo            GitHub repository publishing Magnitude (default magnitudedev/magnitude)
version         Release to install; empty = latest      (default "")
distro          debian | rhel | arch override           (default: host probe)
arch            x86_64 | arm64 override                 (default: host probe)
githubToken     Raises the releases API rate limit     (default: GITHUB_TOKEN, GH_TOKEN, `gh auth token`)
downloadDir     Where the verified package is staged   (default ~/.cache/magnitude)
stagingDir      Where the root-side scripts are staged (default ~/.cache/magnitude/staging)
packageName     Distro package name                    (default magnitude-desktop)
serviceName     systemd service name                   (default magnitude)
serviceUser     Run-as user for the server             (default magnitude)
configDir       Server settings/models/logs dir        (default /var/lib/magnitude)
manageService   auto | "true" | "false"                (default auto: set the server up when the package is present)
networkEnabled  Turn on the network API — EXPOSES IT   (default false; see the WARNING)
networkApiKey   Bearer key the network API requires    (default: leaves any existing key untouched)
networkHost     Address the network API binds          (default: all interfaces; 0.0.0.0 = every interface)
sudoInstanceKey Sudo model instance to elevate with    (default default)
sudoAllowedOperations  Sudo ops allowed for this run   (default: the standard install set)
force           Reinstall even if current              (default false)
uninstall       Remove package and service instead     (default false)
purgeData       Also delete /var/lib/magnitude         (default false)

Privileged steps run through @svendowideit/sudo's sudo-run workflow, which passes this run's sudoAllowedOperations to the sudo model, so a bare auto-created instance works without a prior swamp model create. Magnitude tags releases as @magnitudedev/cli@<version>, so --input version= pinning is best-effort; the default latest release resolves reliably. The releases API allows only 60 anonymous requests per hour per IP, so authenticate for scheduled runs: run gh auth login once (its token is then used automatically), or export GITHUB_TOKEN=$(gh auth token).

Getting the network access key once network access is on: it is the value you passed as networkApiKey (the extension never stores it in swamp data); if you did not set one, read it on the server with sudo cat /var/lib/magnitude/config.json (the network.apiKey field), or see it in the UI under Settings → Network access. Clients send it as Authorization: Bearer <key> (or x-api-key) against <server>:10100/inference/v1. magnitude status never prints it.

Linux only: on macOS and Windows Magnitude ships a desktop app rather than a distro package, and this extension does not manage it.

SETUP

The setup method detects the server's current state and records it, then merges any settings you pass over it — so configuration is remembered, not re-asked. It reads /var/lib/magnitude/config.json and the persisted settings resource, then saves the effective values (partial values included) back to settings for the next run to reuse; the network API key is never written to swamp data, only to config.json on the host. It also reports which capabilities are enabled ("installed", "configured", "network-api"). It changes nothing on the host itself — the install workflow applies the settings as a privileged step, and stops at the failing step with the exact manual commands when it cannot elevate.

  swamp model @svendowideit/magnitude method run setup magnitude

UPGRADE

Magnitude install and upgrade are the same reconciled loop, so upgrading is one command with nothing to pass:

  swamp workflow run @svendowideit/magnitude-upgrade

It reads the installed magnitude --version, resolves the newest release, installs the verified package only when the version (not the ACN revision) actually changed, re-registers the server and re-applies your settings, restarting the service only when the unit, package or settings moved. Every step is idempotent, so re-running is safe; it ends on verified reality by printing the version now on the machine.

WHAT IT INSTALLS

The Magnitude desktop package for this distribution — magnitude-desktop, installed with the host's package manager as root through the elevation ladder. On Linux the package places /usr/bin/magnitude (a symlink to the CLI under /usr/lib/magnitude-desktop/resources/), the desktop resources and the inert /usr/lib/systemd/system/magnitude.service unit; magnitude server setup then creates the unprivileged magnitude system account, prepares /var/lib/magnitude (settings, models, logs) and enables the unit. Your settings are written to /var/lib/magnitude/config.json. The verified package is cached under downloadDir and the root-side scripts under stagingDir. Inspect the server at any time with:

  systemctl status magnitude.service

On uninstall=true it stops and removes the service and the package, keeping /var/lib/magnitude (models and settings) unless purgeData=true.

02Behaviors1
@svendowideit/magnitudev2026.10.18.1magnitude.ts

Global Arguments

ArgumentTypeDescription
distro?stringOverride the detected distribution family (debian, rhel, arch). Empty
arch?stringOverride the detected architecture token (x86_64, arm64). Empty probes
repo?stringGitHub repository publishing the Magnitude releases.
version?stringRelease to install (e.g. 0.2.9). Empty installs the latest. Pinning is
assetPattern?stringAsset-name pattern passed to @svendowideit/github-release-install.
githubToken?stringGitHub token to raise the releases API rate limit. Empty falls back to
downloadDir?stringDirectory the verified release package is downloaded into.
stagingDir?stringUnprivileged directory the root-side scripts are rendered into.
packageName?stringDistro package name (used for removal).
serviceName?stringsystemd service name (without the .service suffix).
serviceUser?stringRun-as user for the server service (created by `magnitude server setup`).
configDir?stringDirectory holding the server's settings, models and logs.
networkEnabled?booleanTurn on the server's network (LAN/remote) API in config.json.
networkApiKey?stringBearer key the network API requires. Empty leaves any existing key
networkHost?stringInterface address the network API binds (network.bind, one IP of this
sudoInstanceKey?stringInstance key of the @svendowideit/sudo model the workflow elevates
sudoAllowedOperations?arrayOperation allowlist passed to the sudo model for each privileged step.
force?booleanReinstall even when the target version is already installed, and re-run
fn setup(networkEnabled?: boolean, networkApiKey?: string, networkHost?: string, binaryPath?: string)
Detect the server's current settings, merge any supplied network
ArgumentTypeDescription
networkEnabled?booleanSupplied network-API toggle; merged over any detected or previously saved value.
networkApiKey?stringSupplied network-API key; the key itself is never persisted to swamp data.
networkHost?string
binaryPath?stringOverride the `magnitude` binary path for this call.
fn plan(distro?: string, arch?: string)
Resolve this machine's distribution family, architecture, package
ArgumentTypeDescription
distro?string
arch?string
fn privilege()
Report how this run can escalate to root (root / passwordless sudo /
fn sync(path?: string, repo?: string, githubToken?: string, checkLatest?: boolean)
Locate the magnitude binary, run `magnitude --version`, and record the
ArgumentTypeDescription
path?stringOverride the binary path for this call.
repo?stringGitHub repository to read the latest release version from when
githubToken?stringGitHub token for the optional latest-release check.
checkLatest?booleanAlso resolve the latest release version (one GitHub API request).
fn assess(latestVersion: string, force?: boolean)
Compare the installed version (from the `installed` resource) with the
ArgumentTypeDescription
latestVersionstringThe release version resolved by the release step (a tag such as
force?booleanReport an update as available regardless of the installed version.
fn renderScripts(networkEnabled?: boolean, networkApiKey?: string, networkHost?: string, binaryPath?: string)
Render the root-side server scripts into the unprivileged staging
ArgumentTypeDescription
networkEnabled?booleanSupplied network-API toggle; merged over any detected or previously saved value.
networkApiKey?stringSupplied network-API key; the key itself is never persisted to swamp data.
networkHost?string
binaryPath?stringOverride the `magnitude` binary path for this call.
fn stage(packagePath?: string, packageName?: string, checksum?: string, manager?: enum)
Verify the downloaded package's SHA-256 (defence in depth — the release
ArgumentTypeDescription
packagePath?stringPath to the downloaded, checksum-verified package (from the release
packageName?stringOverride the package file name for this call.
checksum?stringExpected SHA-256; when set the staged package is re-verified.
manager?enumOverride the package manager for this call.
fn install(packagePath?: string, manager?: enum, force?: boolean)
Install or upgrade the staged package with the host's package manager,
ArgumentTypeDescription
packagePath?stringPackage to install. Empty reuses the staged package from the `stage`
manager?enum
force?boolean
fn serverSetup(binaryPath?: string, force?: boolean)
Register and start the Magnitude server non-interactively: create the
ArgumentTypeDescription
binaryPath?stringOverride the `magnitude` binary path for this call.
force?boolean
fn configure(networkEnabled?: boolean, networkApiKey?: string, networkHost?: string, restart?: boolean)
Write /var/lib/magnitude/config.json (network access, API key, bind
ArgumentTypeDescription
networkEnabled?boolean
networkApiKey?string
networkHost?string
restart?booleanRestart the service after writing the settings.
fn service()
Report the Magnitude systemd unit's active/enabled state on this host.
fn uninstall(removePackage?: boolean, purgeData?: boolean)
Stop and disable the Magnitude server service and, by default, remove
ArgumentTypeDescription
removePackage?booleanAlso remove the distro package (not just the service).
purgeData?booleanDelete /var/lib/magnitude (models and settings) as well.
fn print()
Log the stored installed/server summary and the exact status command.

Resources

platform(infinite)— The resolved distro family/architecture, package format, manager and paths
privilege(infinite)— How this run can escalate to root (root/passwordless-sudo/sudo-prompt/none)
installed(infinite)— The installed Magnitude version and resolved path
assessment(infinite)— Whether an update is available (installed vs resolved release version)
stage(infinite)— The verified package and its install script awaiting privileged execution
scripts(infinite)— The rendered root-side server scripts (setup, remove, settings) awaiting privileged execution
install(infinite)— The result of the last install (or skipped install)
server(infinite)— The result of the last `magnitude server setup` / configure run
config(infinite)— The result of the last configure call (settings written)
settings(infinite)— The detected/merged server settings persisted by `setup` (the API key is never stored)
service(infinite)— systemd service status
uninstall(infinite)— The result of the last uninstall
summary(infinite)— The printed installed/server summary
03Workflows2
@svendowideit/magnitude-installcae23fc2-6542-4e21-9228-300506e5f85a

Install or upgrade Magnitude on this machine and register its server — the whole loop in one idempotent run, elevated through the @svendowideit/sudo ladder. Stages (install): plan → privilege → sync → resolve → assess → download → stage → install → server-setup → configure → service → print. (uninstall): plan → privilege → uninstall-service → uninstall-package → purge-data → print. plan resolves this machine's distribution family and architecture, the exact release package and package manager

mainPlan the platform, read the installed version, resolve and download the release only when an update is needed, install it through the elevation ladder, register and configure the server, then verify.
1.render— Render the root-side server scripts (setup, remove, settings) into the staging dir. Runs on every run, install and uninstall, so the privileged steps always have a script to execute.
2.plan— Resolve this machine's distro family/architecture, the release package filter, the package manager and every install/service path. Runs first so every later step uses one consistent plan.
3.privilege— Report the @svendowideit/sudo ladder for this host. Informational: the placement steps run the ladder themselves.
4.setup— Detect the server's current settings, merge the supplied network settings over them, and persist the effective values (partial values included) to the `settings` resource, so a later run reuses them. Read-only: nothing on the host changes here.
5.sync— Read the installed `magnitude --version` so assess can decide whether an update is needed. Skipped on an uninstall. Offline: the dedicated resolve step owns the release check.
6.resolve— Read the latest Magnitude release (or the pinned version), match the package plan resolved, and record its expected SHA-256. Skipped on an uninstall.
7.assess— Compare the installed version with the resolved release and record whether an update is available. Skipped on an uninstall.
8.download— Download the resolved package and verify its SHA-256. Runs only when an update is available (or force is set), so a current machine does not re-download a ~200 MB package.
9.stage— Verify the downloaded package again (defence in depth) and render its package-manager install script into the staging dir. Runs only when a package was downloaded.
10.install— Run the staged package-install script as root through the elevation ladder. Only runs when a package was downloaded.
11.server-setup— Register and start the Magnitude server as root: `magnitude server setup` through the elevation ladder. Runs on manageService runs.
12.service— Confirm the unit's active/enabled state on this host.
13.verify-service— Fail the run unless the Magnitude service is actually active and enabled — the sudo ladder records a non-zero privileged exit in its result rather than failing the step, so this assert is what makes a denied or failed registration visible instead of a false success.
14.uninstall-service— Stop and remove the Magnitude server service as root. Only runs on an uninstall.
15.uninstall-package— Remove the distro package as root. Only runs on an uninstall.
16.purge-data— Delete /var/lib/magnitude (models and settings) as root. Only runs on an uninstall with purgeData=true.
17.print— Log the installed version, its path and the exact `systemctl status` command, so the run ends on what is now on the machine.
@svendowideit/magnitude-upgrade5caef184-1fa8-4dbf-a5ed-d87a0a935440

Upgrade Magnitude on this machine — one idempotent command, no inputs to remember. Magnitude install and upgrade are the same reconciled loop: read the installed `magnitude --version`, resolve the newest release, install the verified package only when it actually changed, then re-run `magnitude server setup` and rewrite your settings, restarting only when something moved. This workflow is that loop, so re-running it is safe and changes only what differs; it delegates to the same `@svendowideit/

upgradeReconcile the package, the server service and the settings to the newest release through the same idempotent install loop.
1.reconcile— Install the newest release (only when the installed version differs), re-run `magnitude server setup` and re-apply the settings, then verify.
04Stats
A
100 / 100
Downloads
0
Archive size
57.2 KB
  • Has README or module doc2/2earned
  • README has a code example1/1earned
  • README is substantive1/1earned
  • Most symbols documented1/1earned
  • No slow types (deprecated)1/1earned
  • Dependencies pass trust audit2/2earned
  • Has description1/1earned
  • Platform support declared (or universal)2/2earned
  • License2/2earned
  • Verified public repository2/2earned

06Platforms