selfhost.directory

The index of self-hostable projects — ranked, categorized and served with live updates.
Own your data and stop giving it to big tech.

GitHub
pi-dispatch logo

Self-host pi-dispatch

admin-v4.3.1

Queue and budget layer for pi coding agent

ReleaseOpen SourceMIT
Updated9 hours ago
LanguageJavaScript
Setup difficultyAdvanced
Stars
188
Requires
Node.js
Install with Podman
Insights page with KPI tiles, budget dials, budget split, spend charts, per-flow trends, and five cost breakdowns

What is pi-dispatch?

pi-dispatch is a self-hosted service that runs the pi coding agent as background jobs. It accepts work from cron schedules, the command line, or events from four major code forges. Every job executes inside a throwaway Docker or Podman container that has no root access, no Linux capabilities, and a read-only instruction mount. Before any model call happens, the system checks turn limits, token budgets, and dollar caps set per day, week, or month. A Valkey queue handles durability and concurrency. Repositories can be grouped into projects that share a budget and get their own memory and CPU allocation. The admin interface loads as a pi extension and shows the live queue, budget breakdown, host capacity, and detailed cost analytics. Workflows are defined as pi skills — Markdown files stored in each repo under .pi/skills/. A separate receiver component ingests forge webhooks or can poll for events, so no public URL is required. The software runs on Linux servers, VMs, or developer machines with Docker Desktop, and multiple hosts can share one queue. It requires Node 22.19 or newer and a container runtime.

Should you self-host pi-dispatch?

pi-dispatch scores 50/100 on selfhost.directory (how scoring works) and ranks #50 of 125 in AI. It has 188 GitHub stars.

It shipped 10 stable releases in the past year. The latest, v4.3.1, came out on 14 October 2026.

Setup is advanced: plan for several services and some ongoing maintenance. It is MIT-licensed and written mostly in JavaScript.

Its closest alternative on selfhost.directory is ComfyUI (93/100, 143 668 stars). It scores higher overall, so compare the two before you pick. See pi-dispatch vs ComfyUI side by side.

Features

  • Admin panel (pi extension)Loads into pi session; no separate daemon, web app, or network port.
  • Container isolation per job
  • Custom job image
  • Egress allowlist proxyAllowed hosts must be configured by the user.
  • Insights with cost breakdowns
  • Job steering
  • Model allow lists
  • Multi-host queue sharing
  • Multiple trigger types
  • Project budget split with allocation
  • Project resource sizing
  • Sandbox reopening
  • Session recovery and checkpointsNot for repos with pi extensions.
  • Spend limits (turn, token, dollar caps)
  • Trigger/flow topology graph

pi-dispatch README

How to install pi-dispatch

Install pi-dispatch with Podman

Environment variables
PI_BACKENDS=podman, PI_PROVIDER, PI_MODEL, ANTHROPIC_API_KEY, etc.

sudo loginctl enable-linger export PI_BACKENDS=podman podman pull pi-dispatch up pi-dispatch service install pi-dispatch doctor --live

Rootless Podman on Linux only. No daemon as root; worker needs no root-equivalent group. Each job runs as worker's UID in account's container store.

How to configure pi-dispatch

  • ANTHROPIC_API_KEYAPI key for Anthropic provider

    API key for Anthropic provider

  • AZURE_AUTH_SOURCEpatAzure DevOps auth source (only 'pat' supported)

    Azure DevOps auth source (only 'pat' supported)

    values: pat

  • FORGEJO_AUTH_SOURCEpatForgejo/Gitea auth source (only 'pat' supported)

    Forgejo/Gitea auth source (only 'pat' supported)

    values: pat

  • FORGEJO_PERMISSION_TOKENRead-only admin token for Forgejo permission checks

    Read-only admin token for Forgejo permission checks

  • GEMINI_API_KEYAPI key for Google Gemini provider

    API key for Google Gemini provider

  • GITHUB_AUTH_SOURCEghGitHub auth source: 'app' (GitHub App) or 'gh' (gh CLI token)

    GitHub auth source: 'app' (GitHub App) or 'gh' (gh CLI token)

    values: app, gh

  • GITLAB_AUTH_SOURCEpatGitLab auth source (only 'pat' supported)

    GitLab auth source (only 'pat' supported)

    values: pat

  • GITLAB_URLSelf-hosted GitLab instance URL

    Self-hosted GitLab instance URL

  • PI_ALLOWED_MODELSComma-separated list of models allowed for all jobs deployment-wide

    Comma-separated list of models allowed for all jobs deployment-wide

  • PI_AUTH_FROM_PI1Whether to read API keys from host pi's auth.json (1=yes, 0=no)

    Whether to read API keys from host pi's auth.json (1=yes, 0=no)

    values: 0, 1

  • PI_BACKENDSlocalContainer backend: 'local' (Docker/rootful Podman) or 'podman' (rootless Podman) or 'openshell' (NVIDIA OpenShell)

    Container backend: 'local' (Docker/rootful Podman) or 'podman' (rootless Podman) or 'openshell' (NVIDIA OpenShell)

    values: local, podman, openshell

  • PI_CAPTURE_JOB_LOGS0Enable raw job log capture (1=yes)

    Enable raw job log capture (1=yes)

    values: 0, 1

  • PI_FORWARD_ENVExtra environment variables to forward into job containers (e.g., custom provider keys)

    Extra environment variables to forward into job containers (e.g., custom provider keys)

  • PI_GLOBAL_PI_DIRPath to staged global pi overlay from import-pi

    Path to staged global pi overlay from import-pi

  • PI_LOG_RETENTION_DAYSHow long to keep job logs

    How long to keep job logs

  • PI_LOGS_DIR~/.pi-dispatch/logsDirectory for job logs

    Directory for job logs

  • PI_MODELDefault model version for the provider

    Default model version for the provider

    values: e.g., claude-sonnet-5-5

  • PI_ON_FAILUREHook command to run when a paid forge job fails

    Hook command to run when a paid forge job fails

  • PI_PROVIDERDefault AI provider for pi (e.g., anthropic, openai, google, groq)

    Default AI provider for pi (e.g., anthropic, openai, google, groq)

    values: anthropic, openai, google, groq, and about thirty more

  • PI_WORKER_NAMEhostname (lowercased, non-alphanumeric replaced with dash)Unique name for this worker when sharing a queue across multiple hosts

    Unique name for this worker when sharing a queue across multiple hosts

  • VALKEY_URLgenerated by up with passwordConnection URL for the Valkey queue database

    Connection URL for the Valkey queue database

pi-dispatch releases & version history

More in CI/CD

Rate this project

Click to rate — no account needed.

0 comments

Posting as guest
Loading comments…