Purpose
jobd is a lightweight job agent for your own machine cluster, designed to turn several machines with GPUs (workstations, servers, laptops, connected via Tailscale or a local network) into a unified job queue. It is suitable for users who want to submit training, data pipelines, and long-running batch tasks from anywhere, have tasks automatically land on machines that actually have idle resources, survive across sessions, and be cleanly preempted when higher-priority tasks appear. It does not require the cloud, Kubernetes, or Slurm, only a Python process on each host.
Main capabilities
- VRAM-fit routing: The agent matches each job against the live capacity of worker nodes (idle VRAM / RAM / CPU, capability labels, architecture/OS) and dispatches it to a node that is actually suitable. Each host only tracks GPU index 0.
- Preemption and checkpoint window: Higher-priority jobs can preempt running jobs. The worker first sends SIGTERM, gives a grace window, then SIGKILLs. jobd provides JOBD_CHECKPOINT_DIR for each job, for workloads to write checkpoints within the window (saving checkpoints is the workload's own responsibility). Preempted jobs enter the terminal state preempted and are not automatically rerun; to resume, a new job must be submitted pointing to the old checkpoint.
- Survives across sessions: After submitting, you can close your laptop and check again the next day. Jobs are stored in the agent, not in the shell.
- Agent-native: Built-in first-class MCP server; LLM agents (such as Claude Code, etc.) can submit, monitor, and look after jobs via tool calls.
- Self-hosted and private: An agent process running on your own machines. No accounts, no telemetry, no per-GPU-hour billing; the agent and workers only communicate with each other and with clients. The optional self-update script fetches releases over the network.
- Loopback binding by default: Unless JOBD_HOST is set, the agent binds to 127.0.0.1 by default. Requests from non-loopback addresses outside the Tailscale CGNAT range (100.64.0.0/10) return 403 (this check can be disabled with JOBD_DISABLE_TAILNET_ACL=1).
Architecture and usage
jobd uses a pull model: workers poll the agent, and the agent matches jobs based on live capacity and delivers them during polling. It consists of three parts:
- Broker: A FastAPI + SQLite service that stores queues, runs the matcher, resolves project priorities and defaults, and exposes a small HTTP API and SSE stream. It is the single source of truth.
- Workers: One lightweight polling agent per host, announcing live capacity via heartbeats, claiming runnable jobs and executing them (shell=False: the submitted argv is run as-is, bypassing the shell; however job submit --stdin and the MCP jobd_submit tool accept a command string and run it with bash -c), reporting logs back, and responding to preemption signals.
- Clients: The job CLI, the jobd-mcp MCP server, or any client using the HTTP API.
Python ≥ 3.11 is required. All components are included in the jobd package: broker (jobd), CLI (job), MCP server (jobd-mcp), worker (jobd-worker). The worker's extra runtime dependencies (psutil, nvidia-ml-py) are in the [worker] extra. scripts/install-worker.sh can install the worker under ~/jobd-worker with a standalone venv and generated config.
Applicable scenarios and limitations
Suitable for small GPU home labs: multi-machine live VRAM-fit routing (tracking one GPU per host) + preemption/checkpoint windows + native MCP interface. Compared to single-machine tools (Pueue, task-spooler) and multi-machine HPC tools (HyperQueue), jobd fills the gap between "ssh in and run it manually" and "set up Slurm."
Limitations and caveats:
- Only GPU index 0 is tracked per host.
- The broker has no TCP-layer authentication beyond a shared bearer token, so it should run on a trusted network (loopback or a Tailscale tailnet) and must never be exposed on a public interface.
- Workers perform best on Linux + systemd user instances: memory limits, process reaping, and preemption depend on systemd-run --user scopes and cgroups. Non-systemd hosts can still execute jobs,but will silently give up these guarantees. GPU functionality requires NVIDIA + nvidia-ml-py.
- There is no pause/resume, staging, or editing of queued jobs (you must cancel and resubmit); if a worker dies mid-job, running jobs not marked idempotent become orphaned and are not automatically rerun.
- The three endpoints /livez, /readyz, /metrics are exempt from source IP checks and tokens, and will publish the broker version, job counts by state, and each worker's hostname and version, potentially exposing the fleet inventory.
- job adopt can make processes started outside jobd (nohup, tmux) visible to the broker, occupying slots and VRAM until they exit, but the exit code is unknown, and the final state is orphaned rather than completed.
- job submit --explain can dry-run resolution (priority, profile, project defaults, host pinning) and print the effective config without enqueuing.
- Supports submitting N jobs from a template via --count N (members are independently routed, run, preempted, and checkpointed, with {i} replaced by a zero-based index), or a Cartesian-product sweep via --sweep KEY=v1,v2,v3 (mutually exclusive with --count, member limit 1000, i is a reserved axis key).
- By default each worker runs one job at a time (JOBD_WORKER_MAX_CONCURRENT_JOBS=1), which can be raised to allow resource-aware concurrent bin packing.
- By default all job records and .log files are retained forever, with optional cleanup based on terminal-state time.
- Three optional YAML config files (projects.yaml, profiles.yaml, classifier.yaml) live in JOBD_CONFIG_DIR for project defaults, named resource configs, and automatically suggested profiles.
Licensed under MIT.