pi-flex-processing
v0.1.2
Published
Pi extension to switch OpenAI API requests between normal and Flex processing from chat UI.
Downloads
256
Maintainers
Readme
pi-flex-processing
A tiny pi extension that lets you switch OpenAI API requests between normal processing and Flex processing from the chat UI.
Flex processing lowers cost for supported OpenAI models in exchange for slower responses and occasional resource unavailability.
Install
pi install npm:pi-flex-processingUsage
Inside pi:
/flexOpens a simple selector for normal vs flex processing.
Direct commands:
/flex on # enable OpenAI flex processing where supported
/flex off # use normal OpenAI processing
/flex toggle # switch between modes
/flex status # show current modeAlias:
/openai-flexSupported OpenAI Flex models
As of 2026-05-29, OpenAI's Flex pricing table lists:
gpt-5.5gpt-5.5-progpt-5.4gpt-5.4-minigpt-5.4-nanogpt-5.4-pro
When flex mode is enabled on an unsupported OpenAI model, the extension warns once and sends normal processing instead (service_tier: "default"). The footer shows openai:flex n/a.
Behavior
- Applies only to pi's
openaiprovider, i.e. the provider that usesOPENAI_API_KEY. - Supported model + flex mode: sends
service_tier: "flex". - Unsupported model + flex mode: warns and sends
service_tier: "default". - Normal mode: sends
service_tier: "default". - The selected mode is persisted in the current pi session.
Publishing
This repo publishes to npm through GitHub Actions and npm Trusted Publishing when a version tag is pushed.
One-time setup: configure npm Trusted Publishing for this package with GitHub Actions, repository laxman-patel/pi-flex-processing, workflow filename publish.yml, and no environment name.
Release flow:
npm version patch
npm pack --dry-run
git push --follow-tagsThe pushed vX.Y.Z tag triggers .github/workflows/publish.yml, verifies the tag matches package.json, and runs npm publish --access public via OIDC trusted publishing.
Package metadata
This repo is structured as a pi package:
{
"keywords": ["pi-package"],
"pi": {
"extensions": ["./extensions/openai-flex.ts"]
}
}That makes it discoverable by the pi package gallery at https://pi.dev/packages once published/listed.
Security note
Pi extensions run with your full system permissions. Review any extension before installing it.
