OpenAICodexFast ModeExtension@piex-dev/gpt-fast-mode

gpt-fast-mode — Codex Fast Mode, Safely Scoped

TL;DR

Use /gpt-fast to enable the priority service tier for supported ChatGPT Codex models while strictly rejecting the wrong provider, API, authentication, or model.

Overview

OpenAI Codex Fast mode is not a reasoning level and does not select a different model. It sets service_tier: "priority" on the request. pi's openai-codex-responses transport can already send that field, but has no built-in Fast control. @piex-dev/gpt-fast-mode adds /gpt-fast on|off|status and --fast; the specific command name avoids occupying the overly broad /fast namespace.

Quota impact

Fast mode is generally faster, but can consume subscription quota faster. The extension changes only the service tier, never the model, reasoning level, tools, or prompts.

How it works

The extension hooks before_provider_request, cloning the serialized payload and adding service_tier: "priority" immediately before transport. Injection must pass six fail-closed gates: provider is openai-codex; API is openai-codex-responses; model is on the explicit allowlist; authentication is ChatGPT OAuth; payload model matches the selected model; and no service_tier already exists.

SupportedExplicitly rejected
gpt-5.4, gpt-5.5, gpt-5.6-sol, gpt-5.6-terra, gpt-5.6-luna, gpt-6-astragpt-5.4-mini, gpt-5.3-codex-spark

Unsupported models are never guessed into compatibility. The preference may stay on while requests remain unchanged; switching to a supported model activates it automatically.

Usage

Install

bash
pi install npm:@piex-dev/gpt-fast-mode

Source: extensions/gpt-fast-mode

Commands

pi
/gpt-fast             Toggle Fast mode
/gpt-fast on          Enable for this session
/gpt-fast off         Disable for this session
/gpt-fast status      Show mode, eligibility, and last-request outcome

pi --fast         Start enabled

A fast status segment means the switch is enabled, the current model is eligible, and the payload observed by this extension's request hook has no tier conflict. A non-priority service_tier already set by another component is preserved and clears the status. Hooks from extensions loaded later can still change the final payload, so /gpt-fast status reports this extension's injection or observation rather than server confirmation. OAuth is rechecked before every turn and request.

Verify

bash
bun test extensions/gpt-fast-mode/test/gpt-fast-mode.test.ts
pi -e ./extensions/gpt-fast-mode/src/gpt-fast-mode.ts --fast -p "say hi" --no-session

Implementation

The single src/gpt-fast-mode.ts file keeps an in-session enabled state. session_start reads --fast, model_select recomputes the status segment, and before_provider_request runs eligibility gates and clones the payload.

flow
/gpt-fast / --fast ──► enabled
                      ├─► model_select ──► status: fast / clear
                      └─► before_provider_request
                              └─► six gates ──► service_tier: priority

No parallel provider is registered: the extension reuses pi's built-in Codex OAuth refresh, model catalog, and transport. It reads no token, makes no network request, writes no file, and has no runtime dependency. Existing service_tier values from earlier payload hooks are preserved; a conflicting non-priority tier clears the status and is reported by /gpt-fast status. Final rewrites by later hooks are outside the public API's observable scope, so the status text does not claim that the final request definitely used priority.

Local cost estimates

The public before_provider_request hook can replace the serialized payload but cannot set the provider's separate serviceTier request option. Fast still reaches Codex, but if the response reports default or omits the tier, pi's local session cost and telemetry may retain standard-tier estimates. Backend subscription quota is authoritative. Overriding the whole provider only to repair estimates would break extension composition, so this package does not do that.

Design notes

ReferenceAdoptedNot adopted
@diegopetrucci/pi-openai-fastprovider/API/OAuth gates; preserve existing tierproject/global configuration
@benvargas/pi-openai-faston/off/status semantics, --fast, allowlist/fast name, API-key OpenAI, and file persistence
@tunnckocore/pi-gpt-fast-modesingle file, dependency-freeincorrect Codex mini entry and shortcut
pi-openai-codex-fastpriority service tierparallel provider and version coupling

The central tradeoff is a safely narrow feature over a general configuration layer. Fast is one request property and does not justify duplicating a provider; an explicit allowlist is more reliable than fuzzy gpt-* matching.

Changelog

Roadmap

  • Generate the allowlist from the model catalog once upstream exposes a stable capability field.
  • Add a default-state config under the PieX standard directory only after real demand, never by writing files implicitly.
  • Optionally surface quota impact from @piex-dev/usage while keeping the packages decoupled.

Versions

VersionDateChanges
0.1.02026-08-26/gpt-fast on|off|status, --fast, status and request-conflict indicators; priority injection only for supported ChatGPT OAuth Codex models; six fail-closed gates; 15 unit tests