accelerated-generation

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

Packages

Package details

extension

Install accelerated-generation from npm and Pi will load the resources declared by the package manifest.

$ pi install npm:accelerated-generation
Package
accelerated-generation
Version
0.1.3
Published
Oct 18, 2026
Downloads
799/mo · 799/wk
Author
mikedtt
License
MIT
Types
extension
Size
107.8 KB
Dependencies
0 dependencies · 5 peers
Pi manifest JSON
{
  "extensions": [
    "./index.ts"
  ]
}

Security note

Pi packages can execute code and influence agent behavior. Review the source before installing third-party packages.

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:accelerated-generation

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

pi -e npm:accelerated-generation

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 depends on the profile), scope (user | project | both), concurrency (1–8, default 4; turbo 6, mega 8), 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 Default agent Editor border
regular (default) off — (stock pi) — animated (#8a8a8a)
accelerated on subrouter/deepseek/deepseek-flash worker animated (#e1b30a)
turbo on subrouter/deepseek/deepseek-v4-pro debugger animated (#e13e0a)
mega on subrouter/opencode/glm-5.3-flash sprinter animated (#a855f7)
  • 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, turbo, and mega delegate to subagents on the listed model.
  • All delegate models live on the subrouter provider. accelgen checks that provider at session start, on every /accelgen profile change, and before dispatch; if it is missing, unauthenticated, or does not expose the model id, it warns (or fails fast) instead of letting each subagent fail.
  • accelerated exposes the general-purpose agents (worker, scout, splitter); turbo exposes the specialized architect, reviewer, and debugger agents instead, described below.
  • mega is the all-hands fast profile: it exposes every agent (accelerated, turbo, and its own sprinter, triage, patcher) and defaults to sprinter.
  • Speed ranking: mega fastest, turbo second, accelerated third. mega runs glm-5.3-flash with thinking off and 8-way concurrency; turbo runs deepseek-v4-pro with thinking low and 6-way concurrency; accelerated keeps 4-way concurrency and inherits the session thinking level.
  • turbo and mega spawn subagents lean (--no-extensions --no-skills --no-prompt-templates --no-mcp --no-themes --offline), so their subagents do not load extensions, skills, prompt templates, or MCP tools and skip startup network work. accelerated spawns full agents.
  • Workflows run in accelerated, turbo, and mega, 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" | "mega" and a raw model override.

Definitions live in profiles.ts:

export const SPEED_PROFILES = [
  { id: "regular",     model: "" },
  { id: "accelerated", model: "subrouter/deepseek/deepseek-flash",    defaultAgent: "worker" },
  { id: "turbo",       model: "subrouter/deepseek/deepseek-v4-pro",   defaultAgent: "debugger" },
  { id: "mega",        model: "subrouter/opencode/glm-5.3-flash",     defaultAgent: "sprinter" },
];

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|mega 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, turbo, and mega 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
mega #a855f7

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, turbo, and mega 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; default for the accelerated profile.
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; turbo default.
sprinter mega all Speed-optimized implementer: minimal exploration, smallest change, terse report; mega default.
triage mega read, grep, find, ls Fastest recon: smallest set of targets and commands.
patcher mega read, grep, find, ls, edit, write Surgical edits only; no planning or refactoring.

Profile-gated agents are only offered while their profile is active, except in mega, which sees every agent regardless of its gate. Asking for a gated agent elsewhere returns an explanatory error instead of running it; use /accelgen <profile> first (or pass profile: "accelerated" | "turbo" | "mega" on the call).

Defaults: worker for accelerated, debugger for turbo, sprinter for mega. turbo has no worker/splitter, so goal mode uses the built-in splitter prompt; mega has every agent, including the accelerated splitter.

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. mega ignores gates and sees every agent. 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, turbo, and mega. 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 mega
recon scout architect triage
plan worker architect architect
implement worker debugger sprinter
review worker reviewer reviewer
debug worker debugger debugger
verify worker reviewer sprinter

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 / mega).
  • /accelgen regular|accelerated|turbo|mega — 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.