omp packages

pi-accelgen0.1.0

Parallel subagent orchestration for pi: fan out, race, and chain subagents to finish tasks faster.

mikedtt Published 7 days ago MIT ~287 downloads/mo

Untested on omp

This is a pi package. No one has reported whether it works on omp yet. If you try it, add your result below.

Did it work for you?

Result

One report per person. A new report replaces your old one.

Reports 0

No reports yet.

Readme

accelerated-generation

Finish tasks faster by orchestrating parallel subagents. Each subagent runs in its own pi process with an isolated context window, so work fans out without polluting the parent conversation.

accelerated-generation/
├── index.ts       # extension entry: the `accelgen` tool, `/accelgen`, virtual model
├── agents.ts      # built-in agents + discovery of user/project agents
├── runner.ts      # spawns `pi --mode json` subprocesses and streams results
├── model.ts       # fast/strong model selection and the auto task splitter
├── profiles.ts    # regular/accelerated/turbo profiles and their colors
├── workflows.ts   # named multi-phase pipelines (feature, review, debug)
├── editor.ts      # profile-colored, animated input editor border
├── package.json
└── README.md

Install

pi install npm:pi-accelgen

Try it for one invocation without adding it to your settings:

pi -e npm:pi-accelgen

Tool: accelgen

Provide exactly one mode.

Mode Parameters Behavior
Auto-split fan-out goal A fast model splits the goal into independent subtasks, then they run in parallel.
Explicit fan-out tasks: [{ agent?, task, cwd? }] Runs known independent subtasks in parallel.
Speculative race race: { task, attempts?, agent? } Starts N attempts together; the first success wins and cancels the rest.
Chain chain: [{ agent?, task, cwd? }] Sequential handoff; use {previous} to inject the prior step's output.
Single task Delegates one task to one subagent.
Workflow workflow: { name, input? } Runs a named multi-phase pipeline (see Workflows).

Shared parameters: agent (default worker), scope (user | project | both), concurrency (1–4, default 4), model (dispatch override as provider/id), confirmProjectAgents.

Examples the model can issue:

// Split a goal and parallelize it
{ "goal": "Add pagination to every list endpoint and cover it with tests" }

// Run known independent subtasks
{ "tasks": [
  { "task": "Add input validation to src/auth/signup.ts" },
  { "task": "Add tests for src/auth/validate.ts" }
] }

// Best-of-3 when latency matters more than cost
{ "race": { "task": "Write a regex that matches ISO-8601 durations", "attempts": 3 } }

// Sequential handoff
{ "chain": [
  { "agent": "scout", "task": "Find the auth flow" },
  { "agent": "worker", "task": "Refactor it based on: {previous}" }
] }

// Named multi-phase pipeline
{ "workflow": { "name": "feature", "input": "Add pagination to the list endpoints" } }

Profiles

Pick a profile with /accelgen:

Profile Subagents Model Editor border
regular (default) off — (stock pi) animated (#8a8a8a)
accelerated on subrouter/deepseek/deepseek-flash animated (#e1b30a)
turbo on subrouter/deepseek/deepseek-v4-pro animated (#e13e0a)
  • regular is the startup default: a pass-through where the accelgen tool is withdrawn and blocked, so the agent runs like stock pi. The editor effect stays on.
  • accelerated and turbo delegate to subagents on the listed model.
  • accelerated exposes the general-purpose agents (worker, scout, splitter); turbo exposes the specialized architect, reviewer, and debugger agents instead, described below.
  • Workflows run in accelerated and turbo, resolving roles to whichever agents the profile exposes (see Workflows).

The choice is stored on the session branch, so it survives reloads and forks. It applies to every subagent that does not carry its own model in an agent's frontmatter, and to the automatic task splitter. The accelgen tool also accepts a per-call profile: "accelerated" | "turbo" and a raw model override.

Definitions live in profiles.ts:

export const SPEED_PROFILES = [
  { id: "regular",     model: "" },
  { id: "accelerated", model: "subrouter/deepseek/deepseek-flash" },
  { id: "turbo",       model: "subrouter/deepseek/deepseek-v4-pro" },
];

Model priority for a subagent: tool model argument → agent frontmatter model → active profile model → the splitter's fast-model fallback.

/accelgen opens the menu; /accelgen regular|accelerated|turbo sets it directly; /accelgen status prints the agents and current profile.

Editor effect

The input editor's border is always themed by the active profile in interactive mode:

State Effect
Idle solid border in the profile color; accelerated and turbo instead scroll a gradient between the profile color and a darker shade
Working a bright highlight sweeps along the border
Profile Color
regular #8a8a8a
accelerated #e1b30a
turbo #e13e0a

It is implemented in editor.ts as a CustomEditor and only installs in tui mode; JSON/RPC/print modes keep the default editor. The idle and working looks crossfade over ~450 ms, so starting or finishing work morphs the border instead of snapping. Switching profiles eases the border color (and fades the idle gradient in or out) over the same window, so /accelgen changes never snap either. In accelerated and turbo the idle gradient animates continuously, so the border repaints even when no agent is running.

Virtual model: accelgen/generation

Select it with /model (provider accelgen, id generation). It routes each request to a physical model and is independent of the subagent speed profile:

  • Continuations and retries stay on the model that already answered, keeping the prompt cache and thinking signatures valid.
  • Small/simple requests go to the fastest available model with low thinking.
  • Large or high-effort requests go to the strongest available model.

Agents

Built-in agents are defined in agents.ts and work with no setup.

Agent Profiles Tools Purpose
worker accelerated all General-purpose subagent; the default for every mode.
scout accelerated read, grep, find, ls, bash Read-only recon that returns compressed context.
splitter accelerated read, grep, find, ls Internal: turns a goal into a JSON task list.
architect turbo read, grep, find, ls Designs multi-file plans and parallel work packages.
reviewer turbo read, grep, find, ls, bash Adversarial review with file:line findings.
debugger turbo all Reproduces a failure, isolates the root cause, applies a minimal fix.

Profile-gated agents are only offered while their profile is active. Asking for one elsewhere returns an explanatory error instead of running it; use /accelgen <profile> first (or pass profile: "accelerated" | "turbo" on the call).

Because worker and splitter belong to accelerated, turbo calls must name a specialist: pass agent: "debugger" (the only full-tool turbo agent), or architect/reviewer for read-only work, and prefer tasks over goal (the splitter is accelerated-only).

Override or add agents with Markdown files:

  • ~/.pi/agent/agents/*.md — user agents (loaded by default)
  • .pi/agents/*.md — project agents (loaded with scope: "both" or "project")
---
name: worker
description: General-purpose subagent
tools: read, grep, find, ls, bash, edit, write
model: subrouter/deepseek/deepseek-flash
profiles: [accelerated, turbo]
---

Your system prompt here.

profiles is optional: omit it (or leave it empty) to make the agent available in every profile, or list profiles (profiles: turbo or profiles: [accelerated, turbo]) to gate it. Later sources override earlier ones by name: built-ins < user < project. When model is omitted, the subagent inherits the dispatching session's model and thinking level.

Workflows

Workflows are named multi-phase pipelines for accelerated and turbo. Phases run in order; the steps inside a phase run in parallel. Each step names a role, and the role resolves to a profile-appropriate agent:

Role accelerated turbo
recon scout architect
plan worker architect
implement worker debugger
review worker reviewer
debug worker debugger
verify worker reviewer

A step can set agent: "<name>" instead of a role to override the mapping.

Built-in workflows (workflows.ts):

Workflow Phases Input
feature recon (parallel) → plan → implement → review required — the goal
review change recon → review → verify (optional) optional — extra focus
debug reproduce → fix → verify required — the bug
{ "workflow": { "name": "feature", "input": "Add pagination to the list endpoints" } }
{ "workflow": { "name": "review" } }
{ "workflow": { "name": "debug", "input": "Checkout returns 500 for empty carts" } }

Task templates support {input}, {previous} (the previous phase's combined output), and {phase:<id>} (an earlier phase's output). The output handed to the next phase is capped at 24 KB. A failed step fails its phase and stops the workflow unless the phase is marked optional. /accelgen workflows lists the phases and the agents they resolve to for the active profile.

Commands

  • /accelgen — open the profile menu (regular / accelerated / turbo).
  • /accelgen regular|accelerated|turbo — set the profile directly.
  • /accelgen status — list available agents (gated ones are marked [turbo only] and (inactive) outside their profile) and the current profile.
  • /accelgen workflows — list the built-in workflows with their phases and the agents they resolve to for the active profile.
  • /accelgen project — the status list including project-local agents.

Notes

  • Parallel model-visible output is capped at 50 KB per task; full results remain in tool details for the expanded view (Ctrl+O).
  • Subagent token usage is aggregated into the tool result so session totals stay accurate.
  • Project-local agents are repo-controlled prompts. They are only loaded with an explicit scope, and the tool confirms before running them in an untrusted project.