omp packages

@timmyjl12/pi-fusion0.2.0

Selectable Pi fusion presets with full-tool coding workers and inexpensive judge selection

timmyjl12 Published 11 days ago MIT ~194 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

@timmyjl12/pi-fusion

Multi-model coding for Pi, modelled on OpenRouter Fusion. Two modes run as in-process subagents on Pi 1.0's own agent loop and tools: a relay of coding models that build on each other's verified changes, and a fusion panel whose independent answers an analyst compares for your lead model. Tested against Pi 1.0.4 and 1.1.0. Requires Node 22.19+.

Install and select

pi install npm:@timmyjl12/pi-fusion   # install
pi -e npm:@timmyjl12/pi-fusion        # try for one run without installing

Each preset appears in Pi's model selector as virtual models fusion/<preset>-relay and/or fusion/<preset>-fusion (starter: fusion/small-relay, fusion/small-fusion). Requests are routed to the preset's lead model (finalJudge, else the last worker), which gets the matching tool and a short instruction. Open /fusion for the preset editor; /fusion reload re-reads a JSON edit.

The starter uses illustrative IDs (neuralwatt/deepseek-v4.1-flash-flex:max, neuralwatt/glm-5.3-flash-flex:max workers; openai-codex/gpt-6-luna:max judge). Authenticate these models or edit the preset first.

Modes

Model Tool What happens Files
fusion/<preset>-relay fusion_relay Workers code in sequence (the chain repeats relay.passes times), then finalJudge reviews and fixes. Each stage gets the task plus the previous stage's report, the files it changed through edit/write, and their diff — never its transcript. Edited directly in your project, stage by stage.
fusion/<preset>-fusion fusion All workers answer the question in parallel with read-only tools (read, grep, find, ls). finalJudge compares (does not merge) the answers into consensus, contradictions, partial coverage, unique insights and blind spots. Unchanged by the panel; your lead model then edits them.

Only the tool's compact result (≤ 8,000 characters: one line per stage, final report or analysis, changed files, usage) enters your session. Full stage transcripts are written to a temporary run folder named in the result. Panelists are shown to the analyst as blind labels (Expert A, B, …). With one successful panelist the analyst is skipped; with none the tool reports failure.

Stages use Pi's built-in tools only (no extensions, so no recursive fusion), the host's authenticated model runtime, and these bounds per stage: maxTurns (then tools are removed and the model is asked for its report), workerTimeoutMs, and abort. The analyst is bounded by judgeTimeoutMs. Diffs need git on PATH; without it the handoff lists changed files only. Changes made through shell commands are not tracked in handoffs.

Configuration

Default file: getAgentDir()/pi-fusion/config.json (typically ~/.pi/agent/pi-fusion/config.json); PI_FUSION_CONFIG overrides it. /fusion saves atomically and refuses to overwrite external edits; a missing file is created with the starter. In /fusion, press / to search presets, Enter to edit, F2 in model fields to search authenticated models, Ctrl+S to save. The status line estimates model calls (for example relay 2×1+1=3 sequential; fusion 2+1=3), not dollars.

{
	"version": 1,
	"presets": [
		{
			"id": "small",
			"name": "Small",
			"workers": ["neuralwatt/deepseek-v4.1-flash-flex:max", "neuralwatt/glm-5.3-flash-flex:max"],
			"finalJudge": "openai-codex/gpt-6-luna:max",
			"relay": { "passes": 1 },
			"fusion": { "passes": 1 },
			"limits": {
				"maxTurns": 8,
				"maxConcurrency": 2,
				"workerTimeoutMs": 180000,
				"judgeTimeoutMs": 90000,
				"maxProposalChars": 8000
			}
		}
	]
}
  • workers (2–8): relay order and fusion panel. finalJudge (optional, one model): reviews and fixes last in relay, analyses the fusion panel and leads your session. Fusion requires it; without it, relay is workers only.
  • Remove relay or fusion to disable that variant; at least one is required.
  • maxConcurrency (1–4): parallel panelists. maxProposalChars: cap for each stage report, panel answer and diff passed on.
  • Model refs accept a thinking suffix provider/model:level (off … max), applied to that stage; other colon suffixes (e.g. :free) stay part of the id. The lead's suffix sets its thinking level.
  • Presets written for earlier versions (workersMode, judgeMode) load automatically as relay / finalJudge + fusion, and a judges list is dropped in favour of its finalJudge; the next save writes the new keys. Re-select your model: the old -workers/-judge ids are now -relay/-fusion.

Safety

Relay stages and shells are trusted, not sandboxed: relay workers edit your real project and can run shell commands; review the result with your usual tools (git diff). Fusion panelists cannot edit or run shells. Do not use this extension on untrusted projects. Image attachments are not forwarded to stages.

Development

npm install
npm run check

Host packages (@earendil-works/*, typebox) are peer dependencies supplied by Pi; npm never installs copies (.npmrc sets legacy-peer-deps). npm test and npm run typecheck first link them from the managed Pi install (npm run link:pi). Tests drive stages with pi-ai's faux provider; no paid model calls are made. A live run with authenticated models is a separate manual check.