← Catalog

@pi-unipi/fusion

Devin-style model picker, fusion presets (lead + sidekick), and Local Fusion runtime for UniPi

Extension

Install

Install with PiG

pig install npm:@pi-unipi/fusion

Install with Pi

pi install npm:@pi-unipi/fusion
Review before installing

Packages run code with your permissions and influence agent behavior. Catalog inclusion is not a security audit. Review the source before installing a third-party package.

Pi manifest JSON

The pi field of package.json.

{
  "skills": [],
  "themes": [],
  "prompts": [],
  "extensions": [
    "./src/index.ts"
  ]
}

README

Written by the package's publisher, shown as published in version 3.0.3 (README.md). PiG does not review it.

Fusion

Fusion pairs a strong lead model with a lower-cost sidekick model, so the lead plans and the sidekick does the routine work.

@pi-unipi/fusion · part of UniPi

What it does

  • Gives /unipi:model, a keyboard model picker. It shows all available models, their prices and a thinking level for each model.
  • Lets you select one model, or a Fusion pair of a lead and a sidekick.
  • Runs one persistent sidekick for each lead session. The sidekick is a child Pi process. Its context and shells stay between handoffs.
  • Tells the lead to give work to the sidekick. In each turn, the first direct edit or write of the lead gets a reminder. Each 4 non-trivial bash calls of the lead also get a reminder.
  • Shows the estimated savings of the sidekick in /unipi:fusion-stats.

Quick start

  1. Install UniPi: pi install npm:@pi-unipi/unipi. You can also install this package alone: pi install npm:@pi-unipi/fusion.
  2. Open /unipi:settings. Select "Edit fusion presets…". Mark the lead and sidekick models.
  3. Type /unipi:model. Select the Fusion row. Push Enter.
  4. Give the agent a task. The lead calls the sidekick tool.

Commands

CommandWhat it does
/unipi:modelOpens the model picker. When you type /model, the picker is the first suggestion.
/unipi:fusion-statsShows sidekick tokens, costs, savings, handoffs and runtime state.

Picker keys

KeyWhat it does
Up, DownMoves the selection.
TypingFilters the models.
Left, RightChanges the thinking level of the selected row. Fusion keeps the level for each model.
Tab, Shift+TabOn the Fusion row, moves the focus: effort, lead, sidekick.
SpaceOn the Fusion row, selects lead effort or sidekick effort.
EnterApplies the selection.
Alt+EnterSaves the selected row as the startup model.
EscCloses the picker.

If you change the model with Pi's own /model or Ctrl+P, Fusion mode stops.

Agent tools

ToolWhat it does
sidekickGives a message to the sidekick. block: true (default) waits for the report. block: false returns now. The report comes later as a completion notice.
read_subagentReads or waits for a sidekick handoff.

A call to sidekick while the sidekick works sends the message as an interrupt. It does not start a second sidekick.

Settings

Namespace fusion. Open it with /unipi:settings.

KeyDefaultWhat it does
startup.modelemptyModel that Pi opens with. Empty uses Pi's default. Global only.
startup.thinkingnot setThinking level that Pi opens with. Global only.
default.leademptyLead model when you confirm the Fusion row with no change.
default.sidekickemptySidekick model for the same case.

The preset file holds the model lists, levels, recent models and badges:

  • Global: ~/.unipi/config/fusion/preset.json
  • Project: <project>/.unipi/fusion-preset.json. Its lists replace the global lists. Its objects merge with the global objects.

Add a prices object to the preset file when a provider gives no prices:

{"prices": {"provider/model": {"input": 0.2, "cachedInput": 0.02, "output": 1.2}}}

How it works

The sidekick session file is ~/.unipi/workspace/<id>/sessions/<sid>/fusion/sidekick/<lead-session-id>.jsonl. The sidekick compacts its own context. The child gets UNIPI_FUSION_CHILD=1 and UNIPI_SUBAGENT_CHILD=1, so it does not load Fusion tools or commands.

Read Delegation for the lead and sidekick flow.

See also