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

pi-byteplus-modelark-provider

v0.1.0

Published

Pi extension that exposes a BytePlus ModelArk Coding Plan subscription as a Pi provider (OpenAI Chat Completions wire). Discovers the plan's live model catalog, ships reasoning-effort support, and signs in through Pi's own /login flow instead of a hand-ex

Downloads

182

Readme

pi-byteplus-modelark-provider

test npm license

A Pi extension that registers your BytePlus ModelArk Coding Plan subscription as a model provider in Pi.

One API key covers the whole plan — Seed, GLM, Kimi, DeepSeek and GPT-OSS — and the model list is discovered from BytePlus rather than hardcoded, so new plan models appear without waiting for an extension release.

If you have used pi-byteplus-modelark, this is the same idea with two changes you might care about:

  • No export BYTEPLUS_API_KEY=… in your shell profile. You sign in with Pi's own /login, and the key is stored in ~/.pi/agent/auth.json.
  • No hand-maintained model list. The extension reads the model list BytePlus publishes for the Coding Plan, layers in context/output limits, and falls back gracefully when BytePlus changes that page.

Requirements

  • Pi 0.85.x or newer.
  • Node 20 or newer (what Pi itself requires).
  • A BytePlus ModelArk Coding Plan subscription. The Coding Plan endpoint rejects a pay-as-you-go-only key.

Quickstart

1. Install

From npm:

pi install npm:pi-byteplus-modelark-provider

Or straight from git, pinned to a tag:

pi install git:github.com/jstokke/[email protected]

Or over HTTPS:

pi install https://github.com/jstokke/[email protected]

Already have the old pi-byteplus-modelark installed? Remove it first — both register a provider, and the old one pins a stale model list:

pi remove npm:pi-byteplus-modelark

2. Sign in

Get an API key from the BytePlus ARK console (region ap-southeast-1), then inside Pi:

/login byteplus

Pi prompts with a masked secret input, checks the key, and saves it. You only do this once.

3. Pick a model

/model

You should see the current Coding Plan line-up under BytePlus ModelArk, for example byteplus/glm-5.2, byteplus/kimi-k2.5, byteplus/deepseek-v4-pro, or byteplus/ark-code-latest for the plan's auto-router.


What it does

| | | | :--- | :--- | | Provider id | byteplus | | Display name | BytePlus ModelArk | | Endpoint | https://ark.ap-southeast.bytepluses.com/api/coding/v3 (Coding Plan) | | Wire | OpenAI Chat Completions | | Auth | Pi /login (masked prompt → auth.json), env vars as fallback |

  • Uses the Coding Plan endpoint, so requests consume your subscription instead of being billed on top of it.
  • Discovers the plan's models from the list BytePlus publishes, cached 24h, with the live /models catalog as a metadata source and fallback, and ten known-good ids bundled as a last resort.
  • Knows each model's limits — context window, output cap, vision and reasoning support — instead of shipping every model as "128k, text only".
  • Sends reasoning correctly. ModelArk accepts reasoning_effort (none | minimal | low | medium | high | xhigh | max), so Pi's thinking picker actually works, and glm-5.2 gets the extra off/xhigh levels BytePlus documents for it.
  • No runtime dependencies. Plain Node built-ins; the HTTP surface is fully mocked in tests.

Managing it

pi update --extensions   # update, whichever source you installed from
pi remove npm:pi-byteplus-modelark-provider
pi remove git:github.com/jstokke/pi-byteplus-modelark-provider

Alternatives and escape hatches

Headless / CI setups can skip /login and use an environment variable:

export BYTEPLUS_API_KEY="ark-…"   # or ARK_API_KEY, the name BytePlus uses

Raising the output cap if Pi reports Response was truncated before completion.:

export BYTEPLUS_DEFAULT_MAX_TOKENS=65536

Per-model caps go in ~/.pi/agent/byteplus-model-overrides.json:

{
  "deepseek-v4-pro": { "maxTokens": 200000 },
  "Seed 2.0 Lite":   { "contextWindow": 262144 }
}

If BytePlus restructures its docs page, point the discovery at a mirror rather than waiting for a release:

export BYTEPLUS_PLAN_DOC_URL="https://mirror.example.com/coding-plan"
export BYTEPLUS_NO_ENRICHMENT=1   # or skip the scrape entirely

Every environment variable, the discovery layers, the curated limits and their provenance, and the troubleshooting messages are documented in src/README.md.


Notes and limitations

  • Built and tested against Pi 0.85.x. @earendil-works/pi-coding-agent and @earendil-works/pi-ai are optional peer dependencies: Pi provides both at runtime, and the extension installs no runtime dependencies of its own.
  • I only have a Coding Plan subscription, so that is the only tier this has been exercised against. A pay-as-you-go-only key will be rejected by the Coding Plan endpoint — that is BytePlus' behaviour, not the extension's.
  • BytePlus does not document a model-listing endpoint for the Coding Plan. The live /models call is therefore treated as best-effort: it is used for metadata and as a fallback, never as the authority on what the plan serves.
  • Only the OpenAI-compatible wire is registered. The plan also exposes an Anthropic-protocol endpoint, but it serves the same models, so registering it would just duplicate every entry in the picker.
  • The model list is parsed out of a public BytePlus documentation page, and the Coding Plan endpoint is undocumented. Either can change without notice; npm run smoke is what reports drift.

Development

git clone https://github.com/jstokke/pi-byteplus-modelark-provider.git
cd pi-byteplus-modelark-provider
npm install
npm test          # 113 unit tests, fully mocked, ~0.6s
npm run typecheck
npm run smoke     # parses the live BytePlus docs page

To iterate without reinstalling, symlink the source into Pi's extension directory:

mkdir -p ~/.pi/agent/extensions
ln -s "$(pwd)/src" ~/.pi/agent/extensions/byteplus

See CONTRIBUTING.md for the project layout and the conventions this repo cares about.


Disclaimer

Not affiliated with, endorsed by, or sponsored by BytePlus, ByteDance or Zhipu AI. "BytePlus", "ModelArk", "Seed", "GLM", "Kimi", "DeepSeek" and "GPT-OSS" are trademarks of their respective owners, used here only to describe what this extension interoperates with.

The extension targets an undocumented Coding Plan endpoint and parses a public BytePlus documentation page to discover models. Check that this fits BytePlus' terms for your own use.


License

MIT © Joachim Stokke