npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@henryqw/pi-task-models

v10.1.0

Published

Shared task model profiles and routing for HenryQW Pi extensions.

Readme

@henryqw/pi-task-models

Configure shared Task Profiles for fast, balanced, frontier, ultra, and fav. Each Task Route pairs a model with a thinking level; each consumer owns its Model Tasks and defaults.

Pi showing task model profiles and task routes

Install

pi install npm:@henryqw/pi-task-models

Requires Pi 1.5.0 or later in the 1.x series. Update installed consumer packages before you assign ultra. Older consumers can ignore the assignment and use their default profile.

Works with

| Package | Relationship | Purpose | | --- | --- | --- | | @henryqw/pi-auto-compact | Consumer | Compaction defaults to fast. | | @henryqw/pi-herdr-tools | Consumer | Side-thread and rename tasks default to fast. | | @henryqw/pi-memory | Consumer | Candidate review, /remember preparation, and /dream promotion default to balanced. | | @henryqw/pi-multi-codex | Improves | Numbered Codex slots become one route. |

Use

Type /task-models to see the available actions. The command without arguments opens profile and task settings.

Run /task-models, select fast, then choose a primary model and thinking level. Choose a different fallback model and thinking level, or None. Reopen /task-models: fast shows the saved route instead of not configured.

| Surface | Type | Purpose | | --- | --- | --- | | /task-models | command | Configure profiles and assign them to active tasks. | | /task-models check | command | Check configured routes against the current session's model scope. | | /task-models preset | command | Apply a saved profile setup. | | Option+S / Alt+S in /task-models | shortcut | Save configured profiles as a named preset in the interactive terminal. | | Session start | ui | Check route scope. Report route, config, and preset problems. |

Configure each profile your consumers require. fav has no fallback. Select an active task to override its declared profile; choosing its declared default removes the override.

Check routes

Pi checks configured primary and fallback routes each time a session starts, loads, or reloads. The automatic check reports route problems only. In modes without a user interface, Pi writes these warnings to standard error.

Run /task-models check to see every configured route. Each line shows the profile, route, model, thinking level, and result.

The check distinguishes a model outside the current session's scope from one absent from Pi's catalog. It also reports unavailable models, non-text models, and thinking levels the session cannot use. The check is read-only and uses the current session's scope. Delegate launches resolve separately.

Delegate routes

/task-models lists the billion-context acp_delegate roles. Researcher defaults to fast; reviewer, worker, planner, and oracle default to balanced. Assign a profile to each role as needed. The first available route supplies the model and thinking level.

For new launches from npm:billion-context, Pi resolves the role route at each tool call. Profile edits apply to the next launch. An explicit model takes priority; an explicit thinking level takes priority when the selected model supports it. Resume calls stay unchanged.

The delegate uses Pi's available text models, independent of the current session's model scope. Missing or invalid config and unusable routes block automatic launches with an error. A selected fallback is reported. A launched delegate is not retried when it fails.

Upgrade: remove /task-models sync-delegates from your workflow. This extension no longer writes billion-context or legacy delegate config. Existing external role settings remain in place, but automatic task routes take priority for new launches.

Presets

Run /task-models preset and choose a name. Included profiles replace complete routes, thinking levels, and fallbacks in one atomic update. Omitted profiles and task assignments stay unchanged. Applying can create missing active config.

To save, open /task-models, press Option+S (macOS) or Alt+S, then enter a name. The preset contains all configured profiles, not task assignments. Other presets stay unchanged. Cancelling a preset prompt writes nothing.

The shortcut requires an interactive terminal that sends Option/Alt as Meta (Escape); RPC does not support it.

Flow

A Model Task selects a Task Profile and resolves Task Routes; config and profile errors occur before resolution, and no-route follows it.

The menu shows effective profiles for active tasks. Disabled consumers' assignments remain stored but hidden.

Menus list your scoped models and pinned thinking levels, or all available text models when no scope is set. Duplicate numbered Codex aliases collapse into one choice; fallback choices exclude the primary.

Config

Package-owned: ~/.pi/agent/config/pi-task-models/config.json. Only explicit /task-models actions save it. Use exact model IDs from Pi's registry, not these placeholders:

{
  "profiles": {
    "fast": {
      "primary": { "model": "<provider>/<model>", "thinkingLevel": "low" }
    }
  },
  "tasks": {}
}

| Name | Description | Values | Default | | --- | --- | --- | --- | | profiles | Stores shared routes. | Object keyed by fast, balanced, frontier, ultra, or fav. | {} | | profiles.<profile>.primary.model | Required primary model. | Canonical provider/model without whitespace or NUL. | — | | profiles.<profile>.primary.thinkingLevel | Required primary thinking level. | off, minimal, low, medium, high, xhigh, or max; model support required at resolution. | — | | profiles.<profile>.fallback | Route to try when the primary is unavailable. | Object requiring model and thinkingLevel, with primary rules. Forbidden for fav. | No fallback. | | tasks | Explicit profile overrides. | Object mapping <package>/<task> IDs to profiles. | {} | | tasks.<taskId> | Overrides the declared profile. | fast, balanced, frontier, ultra, or fav. | Task declaration's defaultProfile. |

Task defaults belong to consumer declarations. Existing overrides equal to those defaults remain valid.

Preset file

You can edit ~/.pi/agent/config/pi-task-models/presets.json manually. It maps preset names to any subset of the five profiles, each in the profiles.<profile> format above. The picker sorts names alphabetically.

Missing, empty, or invalid files do not change active config. Invalid names, presets, and profiles produce warnings and are ignored; valid entries remain available.

Saving never overwrites a preset file that has problems; a conflict message asks you to try again.

API

| Surface | Type | Purpose | | --- | --- | --- | | PROFILE_NAMES, THINKING_LEVELS | constant | List the profile names and thinking levels. | | ProfileName, ThinkingLevel, ModelTask, TaskModelRoute, TaskModelProfile, TaskModelsConfig, AvailableModel, ResolvedTaskRoute, TaskRouteErrorCode, TaskRouteError | type | Name profiles, thinking levels, Model Tasks, Task Routes, Task Profiles, config, registry models, resolved routes, and route errors with taskRouteCode and optional profileName. | | registerModelTask(pi, task) | function | Registers a consumer declaration at extension load. | | loadTaskModelsConfig(agentDir?) | function | Reads and validates config; throws when disabled. | | registerTaskModelsConfigReporting(pi, agentDir?) | function | Reports problems at session start; returns report(ctx) for later problems. | | canonicalModelReference(model) | function | Validates and canonicalizes provider/model, including numbered Codex aliases. | | modelReference(model) | function | Formats provider/model. | | dedupeAvailableModels(models, preferredProvider?) | function | Removes duplicate canonical references, with optional provider preference. | | resolveAvailableModel(models, reference, preferredProvider?) | function | Finds a reference, including numbered Codex aliases. | | availableTaskModels(ctx) | function | Lists scoped text models, or registry models when scope is empty. | | taskThinkingLevels(ctx, model) | function | Lists supported levels, respecting session-pinned thinking. | | resolveTaskModelRoute(ctx, route, thinking?) | function | Resolves one available route. | | resolveConfiguredTaskRoute(ctx, task, agentDir?, thinking?, onFallback?) | function | Resolves the first usable task route. | | resolveConfiguredTaskRoutes(ctx, task, agentDir?, thinking?, onFallback?) | function | Resolves configured task route candidates. | | executeTaskRoutes(routes, attempt, { shouldFallback, signal? }) | function | Tries resolved routes in order; returns first success. | | orderedProfileRoutes(profile) | function | Returns primary, then optional fallback. | | createTaskModelsExtension(pi, options?) (also default export) | function | Registers /task-models, missing-config warnings, and issue reporting. |

Profile thinking is authoritative; resolution uses config.tasks[task.id] ?? task.defaultProfile.

The optional onFallback(profileName, route) callback reports when the first usable route is the configured fallback. It does not run when the primary is usable or when no route is usable. It does not report execution failures or retries. Consumers own warning delivery and duplicate suppression.

Consumers must not read or write shared config; call report(ctx) before resolution.

executeTaskRoutes() rejects empty lists and checks signal before each route. Cancellation or shouldFallback(error) === false stops execution. Allowed failures end with the final error unchanged. Each route call must be atomic and safe to repeat.

Limits and recovery

Problems appear at session start and when /task-models opens. For the shared rules, see Config files. Resolution throws TaskRouteError with a taskRouteCode:

| Problem | Code | Recovery | | --- | --- | --- | | Unknown key, misspelled tasks, unknown profile name, invalid task ID or task profile. | None | None needed. Tasks without valid overrides use declared defaults. | | Config is absent. | config-missing | Run /task-models to create it. | | File problem, non-object profiles, misspelled profiles such as profile. Routing is disabled for every task. | config-disabled | Repair the file or save through /task-models. | | Profile is absent, or Pi warns and ignores an invalid profile, route, or fallback in fav. | profile-missing | Configure the profile in /task-models. | | No available route. | no-route | Choose an available model and thinking level in /task-models. |

Saves retain only valid settings, including valid tasks when profiles is invalid. If the file changed while /task-models was open, saving writes nothing; reopen /task-models.

Saving refuses oversized, unreadable, or non-regular files. Fix, shrink, or remove the file first.

Consumers may silence only config-missing, and only with a safe current-session fallback.