omp packages

@nobadwords/pi-openai-fast0.1.3

Session-scoped Fast and Ultrafast requests for Pi's native OpenAI provider, gated by the ChatGPT account's advertised model tiers.

nobadwords Published 3 hours ago MIT ~473 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

Pi OpenAI Fast

한국어 안내

An account-aware /speed command for Pi’s native OpenAI Responses provider. Request Fast or Ultrafast without changing your model, reasoning effort, sign-in, or transport. Tested with Pi 1.7.0 and Node.js 22.

This independent extension is not affiliated with OpenAI or Pi. It does not support the legacy openai-codex provider, Codex CLI, other providers, or OpenAI-compatible proxies.

Install or try it

Install from npm:

pi install npm:@nobadwords/pi-openai-fast

Version 0.1.0 was published as pi-openai-speed. From a local checkout, load the extension for one invocation:

pi --offline --no-extensions -e "$PWD"

--offline skips automatic Pi startup requests; it is not a network sandbox. Checking available speeds or sending a prompt can still contact OpenAI.

Choose a speed

  1. Select a model from openai. If you use Sign in with ChatGPT, open /speed and choose Check available speeds. Opening or closing the picker does not query the account. The check uses your existing Pi login for one GET https://api.openai.com/v1/models request and does not generate a response.
  2. Choose Fast or Ultrafast if shown for the current model. A check always resets the selection to Standard. Even a successful check does not restore a previous premium selection automatically.
  3. Use /speed status to inspect the current selection. Use /speed standard to stop the extension from adding a tier. Premium requests may increase charges or plan usage, including background requests.
Command Behavior
/speed Pick a speed or check the account’s advertised options.
/speed standard Leave the request unchanged. This does not force service_tier: "default".
/speed fast Add service_tier: "priority" if supported and the request has no tier.
/speed ultrafast Add service_tier: "ultrafast" if supported and the request has no tier.
/speed status Show the current selection and availability in this session.

The choice is session-local. A fresh, resumed, or forked session starts at Standard. In the same live session, /reload keeps a verified choice and catalog in memory if the OpenAI route and authentication scope still match. Switch speeds while the session is idle. Switching to a model without the selected speed makes the choice inactive. A failed catalog check, authentication loss, or detected change in authentication kind or source clears verified speeds. After changing ChatGPT accounts or plans, check again.

With a native API key, GPT‑6.2 Sol and Astra use a small local compatibility list. Direct Fast and Ultrafast commands work without querying the catalog.

The footer and /speed status show your selection. The extension preserves any tier already set on the request. /speed status separates the last payload-hook decision from the tier reported by a completed response. For example, Fast can show priority inserted and last reported tier: default. A selection is not proof of processing speed or billing. A missing or unobserved tier is not inferred.

Scope and data handling

  • The OAuth check uses Pi’s resolved OAuth bearer for the fixed public OpenAI /v1/models endpoint. There is no redirect, retry, separate login, or API-key fallback. Pi itself may refresh a credential while resolving authentication. The extension does not store credentials, raw catalogs, prompts, or diagnostics on disk and has no telemetry or runtime dependencies.
  • An eligible catalog entry must match the exact model slug, be visible, not be marked API-unsupported, and list the recognized tier in service_tiers. Duplicate, malformed, and legacy-only entries do not grant premium options. There is no startup lookup or persistent catalog cache.
  • The payload hook checks the selected native openai route and the shape and model of the streaming Responses body. It skips ambiguous same-ID routes, re-registered openai providers, and conflicting OAuth account headers. Pi 1.7.0’s hook does not expose final request credentials or destination; the check does not bind the catalog lookup to every later POST. See Pi’s hook documentation.

Development and distribution

The @nobadwords/pi-openai-fast package manifest exposes only /speed. Run npm pack --dry-run to inspect the archive. Tests are available from source but are not part of the npm package. The pi-package keyword makes a published npm package eligible for discovery on Pi Packages.

Run npm test for the unit tests, which use synthetic catalog data. The Pi integration tests exercise the real provider with fake credentials and mock HTTP/SSE, including the serialized POST. On Linux with a managed Pi 1.7.0 installation, run them in an isolated home and network namespace:

env -i /usr/bin/bwrap --unshare-net --unshare-pid --die-with-parent --new-session \
  --ro-bind /usr /usr --symlink usr/lib64 /lib64 --symlink usr/lib /lib --symlink usr/bin /bin \
  --dev /dev --proc /proc --tmpfs /tmp --dir /home/test \
  --ro-bind "$(readlink -f "$(command -v node)")" /node --ro-bind "$PWD" /work \
  --ro-bind "$HOME/.pi/agent/install/releases/1.7.0/node_modules" /pi/node_modules \
  --chdir /work --setenv PATH /usr/bin:/bin --setenv HOME /home/test --setenv PI_OFFLINE 1 \
  --setenv PI_AGENT_PACKAGE_DIR /pi/node_modules/@earendil-works/pi-coding-agent \
  /node --test tests/speed.test.mjs tests/speed.pi.test.mjs

The design was informed by pi-fast and @buyong/pi-codex-fast-mode. No code from either project was copied.

License

MIT.