@diegopetrucci/pi-fast0.1.10
A pi extension that enables Fast mode for supported direct OpenAI API, OpenAI Codex, and Anthropic Claude models based on the currently selected model.
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.
Reports 0
No reports yet.
Readme
fast
A pi extension that provides /fast and /ultrafast toggles for supported direct OpenAI API, OpenAI Codex, and Anthropic Claude models. It selects the provider-specific Fast-mode request shape from the currently selected model.
For eligible direct OpenAI API-key models it injects:
{
"service_tier": "fast"
}
For eligible direct OpenAI ChatGPT OAuth models it injects:
{
"service_tier": "priority"
}
For eligible OpenAI Codex OAuth models it injects:
{
"service_tier": "priority"
}
For eligible Anthropic Claude models it injects:
{
"speed": "fast"
}
It also adds the required Anthropic beta header value:
anthropic-beta: fast-mode-2026-02-01
Eligibility
Direct OpenAI API Fast mode requires all of the following:
- Provider
openai. - API
openai-responsesoropenai-completions. - Model
gpt-6.1-sol,gpt-6-astra,gpt-6-sol, orgpt-6-luna. - API-key auth sets
service_tier: "fast"; Pi'sopenaiChatGPT OAuth setspriority. - No existing
service_tierfield in the request payload.
The direct OpenAI route stays on OpenAI's direct API contract but selects the tier by auth
type. OAuth uses priority because its endpoint rejected fast; acceptance or application
of priority on Pi's OAuth endpoint has not been live-verified. This direct route is never
forwarded to legacy openai-codex or its subscription-usage endpoint. The request shape is
support evidence, not certification; tests use mocked eligibility and payloads only, with
no live or paid provider calls.
Ultrafast support (initial, fail-closed)
Ultrafast is intentionally narrower than ordinary Fast mode. It requires all of the following on every activation and provider request:
- Provider
openai. - API
openai-responses. - Model
gpt-6-astra. - Direct API-key auth, not Codex OAuth or direct OpenAI OAuth.
- Base URL exactly
https://api.openai.com/v1(a single trailing slash is also accepted).
It does not support Chat Completions, preview models, regional or proxy endpoints,
or Anthropic Ultrafast. Eligible payloads receive the requested
service_tier: "ultrafast" only when they do not already contain a
service_tier field. Existing values and mismatched/malformed payloads are left
untouched. The extension reports a requested tier; it does not claim that OpenAI
accepted or applied it, and it never silently falls back to ordinary Fast.
OpenAI documents this request shape in the Ultrafast API guide and lists the account/model pricing in its API pricing. Actual Ultrafast API pricing is 6x Standard, while Pi's current cost display omits that premium. Treat the activation warning as a deliberate paid-usage warning.
OpenAI Codex Fast mode requires all of the following:
- Provider
openai-codex. - API
openai-codex-responses. - Model
gpt-5.5,gpt-5.6-sol,gpt-5.6-terra,gpt-5.6-luna,gpt-6-astra,gpt-6.1-sol,gpt-6-sol, orgpt-6-luna. - ChatGPT OAuth/subscription auth, not API-key auth.
- No existing
service_tierfield in the request payload.
Codex evidence, 2026-10-03: the maintainer's PR #103 review
reports that the Codex model list advertises Fast as priority for gpt-6-astra,
gpt-6.1-sol, gpt-6-sol, and gpt-6-luna. The official Codex CLI
sends Fast as priority.
The maintainer's live check through Pi 1.0.0 on that date returned HTTP 200 and
completed normally for gpt-6-astra and gpt-6.1-sol; gpt-6-sol and
gpt-6-luna are enabled based on the model list only. In that check,
response.completed always reported service_tier: "default", with or without
priority, so the response cannot confirm Fast was applied.
Pi trusts the requested tier and applies a 2× multiplier to its displayed cost
estimate for priority; this does not measure included subscription allowance
consumption or confirm Fast was applied. OpenAI's Codex speed documentation,
checked on 2026-10-03, lists gpt-6-sol and gpt-6-luna among supported Fast
models where available. It specifies 2.5× the Standard rate for included
subscription limits and 2× for purchased credits and Enterprise pay-as-you-go
billing. Treating Pi's 2× estimate as a subscription-limit multiplier would
understate the documented allowance consumption.
Anthropic Fast mode requires all of the following:
- Provider
anthropic. - API
anthropic-messages. - Model
claude-opus-4-8,claude-opus-5, orclaude-opus-5-5. - No existing
speedfield in the request payload.
Anthropic Fast mode supports both API-key and Claude Code OAuth access when the account has access to the research preview.
Commands
/fast
/ultrafast
/fast ultrafast
Run /fast to toggle ordinary Fast mode for the current session/runtime. The
enabled state follows model changes: switching between eligible OpenAI and
Anthropic models automatically changes the request format without resetting the
toggle. The footer shows fast only while the selected model is eligible and
Fast mode is enabled.
/ultrafast and /fast ultrafast are equivalent toggles for the session-only
Ultrafast override. Ultrafast defaults off, is never enabled by global or project
configuration, and can be undone with either command. Running ordinary /fast
while Ultrafast is selected turns Ultrafast off rather than silently switching to
another paid tier. Switching to an unsupported model or endpoint disables
Ultrafast and does not re-enable it when gpt-6-astra is selected again. The
footer uses ultrafast while an eligible request is selected; status text says
that the tier is requested, not remotely applied.
The extension defaults to off so installing the full collection does not accidentally spend Fast-mode credits. Ultrafast verification is mocked-only: tests use local eligibility checks, fake payloads, and a fake fetch through Pi's openai-responses streamSimple; they make no live or paid provider requests.
Config
Optional global config:
~/<pi-config-dir>/agent/extensions/fast.json
Optional project config, from the nearest ancestor of the working directory (the working directory itself counts):
<project>/<pi-config-dir>/fast.json
Here <pi-config-dir> is Pi's runtime config directory name (CONFIG_DIR_NAME; .pi by default). The loader uses that nearest ancestor fast.json, which overrides global config after Pi reports that the project is trusted.
{
"enabled": false,
"showStatus": true
}
enabled: default Fast-mode state when there is no session override.showStatus: show a compactfaststatus when Fast mode is active for the selected model.
The unified extension reads only fast.json. It does not read openai-fast.json or claude-fast.json.
Install
Standalone npm package
pi install npm:@diegopetrucci/pi-fast
Collection package
pi install npm:@diegopetrucci/pi-extensions
GitHub package
pi install git:github.com/diegopetrucci/pi-extensions
Then reload pi:
/reload
Legacy provider-specific packages
The collection package loads this unified extension only (extensions/fast/index.ts). openai-fast and claude-fast remain published as deprecated standalone leftovers. On session start they warn, clear their leftover footer status, and remove fast-mode-2026-02-01 from the current model header. They do not read config, register commands, or inject Fast fields into requests.
Notes
- Anthropic Fast mode has separate rate limits, costs more than standard speed, and does not share prompt-cache prefixes with standard-speed requests.
- Direct OpenAI Fast mode is limited to the confirmed GPT-6 API models above; Fast pricing, availability, and rate limits remain provider- and account-dependent.
- Authoritative support evidence: OpenAI Fast mode explicitly uses
gpt-6.1-solwithservice_tier: "fast"and documentspriorityas an equivalent alias for supported API models; the GPT-6.1 Sol model page documents the model itself. - Codex Fast availability depends on plan, client, workspace settings, and rollout. Local eligibility is not live-provider certification.
- Pi's provider catalog remains the source of reported model pricing, including any tiered pricing; this extension does not apply guessed discounts or rewrite cost metadata.
- OpenAI Codex Fast mode intentionally does not affect API-key models.
- Deprecated
openai-fastandclaude-fastpackages no longer implement Fast mode. New provider/auth behavior belongs only to this unified extension. - Existing
speedandservice_tierfields are never overwritten. - Pi's model catalog may not include a Fast-mode premium. Cost accounting depends on the provider reporting the effective tier in its streamed response, and this extension does not patch usage totals.