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-huggingface-oauth

v0.2.0

Published

Hugging Face OAuth and provider-specific model routes for Pi

Readme

Hugging Face OAuth for Pi

Hugging Face OAuth for Pi adds browser login and provider-specific Inference Provider routes to Pi's built-in Hugging Face integration.

The package keeps Pi's Hugging Face transport and token support. It adds device authorization for browser login and discovers live routes such as Novita and Fireworks from Hugging Face's public router catalog. Together and DeepInfra routes appear when available too.

Install and log in

This package requires Pi 0.82.1 or newer.

pi install npm:pi-huggingface-oauth

Restart Pi, run /login, choose Hugging Face, and select Hugging Face Inference Providers. Pi displays a browser URL and a short code. After approval, Pi stores the OAuth credential in its existing auth file.

The package includes its dedicated public Hugging Face OAuth client ID, so login needs no extra configuration. The application has no client secret and requests only the inference-api scope.

Developers can test another compatible public application by setting:

export PI_HUGGINGFACE_OAUTH_CLIENT_ID=<client-id>

The client ID is public configuration, not a secret. Do not use the Hugging Face CLI's client ID.

Pi's existing HF_TOKEN and pasted-token login remain available.

Choose an inference provider

Open /model and select a Hugging Face entry. The same picker contains the automatic route and provider-specific routes:

GLM-5.2 · Auto
GLM-5.2 · Novita
GLM-5.2 · Together
GLM-5.2 · Fireworks
GLM-5.2 · DeepInfra

Provider-specific entries use Hugging Face's exact suffixed model IDs. The unsuffixed model remains Hugging Face's automatic fastest route. A pinned provider entry does not silently change providers.

The package lists live, tool-capable routes only when Hugging Face supplies their context limits and prices. It refreshes the public catalog when Pi refreshes models and keeps the validated result in Pi's provider model store for offline startup.

Design

The package composes one huggingface provider through Pi's documented provider API. It uses Pi's canonical catalog, standard token authentication, and OpenAI-compatible transport. The extension adds OAuth and projects live provider routes into ordinary Pi model entries. Pi then records the selected suffixed model ID through its normal model selection and session behavior.

The specification defines OAuth and catalog validation, including route filters, cache behavior, and compatibility. Motivation explains why the standalone package exists.

Security

The OAuth application is public and uses no client secret. Device codes and OAuth tokens never appear in logs or diagnostics. Pi remains responsible for credential persistence in ~/.pi/agent/auth.json.

Model discovery uses Hugging Face's public https://router.huggingface.co/v1/models endpoint and sends no authorization header. The extension validates the response and its redirect behavior before checking body limits, deadlines, and model fields.

See SECURITY.md for reporting instructions and the package's security boundaries.

License

MIT