Skip to main content

Crate studio_worker

Crate studio_worker 

Source
Expand description

Library surface for the studio-worker binary.

Exposes the worker’s modules so integration tests (and downstream tooling) can drive the contract without going through the CLI.

Modules§

admission
Admission: does a load or transient job fit in device memory now? (see docs/runtime/model-lifecycle.md).
auto_register
Auto-register state machine — the only registration path.
autostart
Autostart-on-login toggle. Writes per-OS artefacts so the desktop UI (tray) comes back after a reboot:
catalog
Local model catalog — the offline equivalent of the studio’s studioModels registry.
cli
Clap CLI definitions, kept out of main.rs so they’re testable.
config
Persistent config in ~/.config/minis-studio-worker/config.toml (Linux/macOS) or %APPDATA%\minis-studio-worker\config.toml (Windows).
control
What the tray UI can see and do in the daemon, independent of HTTP.
daemon_api
Wire types of the daemon-control routes on the local API, shared by the daemon (which answers them) and the tray UI (which reads them).
daemon_client
Blocking client for the daemon’s local API, used by the tray UI.
daemon_link
The tray UI’s link to its daemon.
daemon_lock
One daemon per config directory.
engine
Pluggable inference engines, generalised to all task kinds.
host
The model host: owns loaded models, drives each model’s lifecycle, persists residency and enforces admission and exclusive groups (see docs/runtime/model-lifecycle.md).
http
Thin reqwest wrapper around the studio API.
job_gate
The worker’s single-job reservation gate.
job_log
Per-job log capture.
job_run
One job’s bookkeeping, shared by every job path (studio offers, local transient jobs, lane requests, streaming sessions).
lifecycle
Per-model lifecycle state machine (see docs/runtime/model-lifecycle.md).
loaders
The worker’s in-process model loaders, one per engine, behind the model host’s ModelRuntime (see docs/runtime/model-lifecycle.md).
local
Local image generation — submit a prompt straight to the engine, no studio.
local_api
Always-on local HTTP API for image generation (127.0.0.1 only).
net
Shared transport-level guards for everything the worker downloads.
residency
Persisted residency: which catalogue models the operator wants loaded (see docs/runtime/model-lifecycle.md).
runtime
Long-running auto-update task + one-shot CLI helpers.
secrets
Shared entropy primitives for every locally-minted credential.
service
OS service install/uninstall. Linux: systemd –user. macOS: launchd plist template (written but not loaded — operator runs launchctl load). Windows: schtasks template (written but not registered — operator runs the printed command).
stt_stream
Streaming speech-to-text: the /transcribe session protocol, voice activity detection and the LAN listener that serves loaded models.
sys
Host-system probes: hostname, OS user, VRAM.
telemetry
Sentry telemetry — opt-in error/panic reporting.
thumbnail
Thumbnails of image jobs, so the tray UI can show what a job made.
types
Shared wire-format mirrors of the studio API.
ui
The tray UI: an egui window + system tray that is a client of the daemon (studio-worker run). See docs/runtime/daemon-and-tray.md.
update
Auto-update: poll a GitHub Releases feed, download cargo-dist’s platform installer when a newer semver is available, and re-exec ourselves so the new binary takes over.
ws
WebSocket worker-channel module.

Constants§

AGENT_VERSION
RELEASE_NAME
Sentry release identifier in the <pkg>@<version> form expected by Sentry’s organisation-wide Releases feature. Bare version strings collide across projects in the same org, so we namespace with the crate name. Matches what sentry::release_name!() would expand to.

Functions§

run_cli
Dispatch table for the CLI subcommands. Lives in the library so we can drive it from tests without invoking the binary.