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

@winterchenhuan/pi-hide-hf

v1.0.0

Published

Hide HuggingFace models extension for Pi. Filter HF models from the model selector when HF_TOKEN is present.

Downloads

44

Readme

Hide HuggingFace Models Extension

问题

pi 只要检测到 HF_TOKEN 就会把 huggingface 下所有 22 个模型都标记为「可用」。 但 HF 是 marketplace — 一个 token 不等于所有模型都有权限。 pi 的模型可见性是 provider 粒度(有 token = 该 provider 所有模型可见), 而 HuggingFace 是 marketplace(一个 token ≠ 所有模型可用),两者不匹配。

解决方案

两层策略:

  1. 扩展插件 — 在 session_start 时 patch getAvailable(),过滤掉 HF 模型
  2. Shell 包装脚本 — pi-nohf 启动前去掉 HF_TOKEN(--list-models 也能生效)

使用方法

方案 A:扩展插件(推荐)

通过 npm 安装:

pi install npm:@winterchenhuan/pi-hide-hf

通过 git 安装:

pi install git:github.com/winterhuan/pi-hide-hf

⚠️ 安装后需要新启动 pi 或在已有会话中输入 /reload 才能加载新扩展。

启动后 [hide-hf] Patched getAvailable() to hide HF models 即生效。

# 默认行为:HF_TOKEN 存在时自动隐藏所有 HF 模型
pi

# 不隐藏,显示 HF 模型
HF_HIDE_MODELS=0 pi

# 只保留指定模型
HF_ALLOWED_MODELS="moonshotai/Kimi-K2.6,zai-org/GLM-5" pi

方案 B:Shell 包装脚本

~/.local/bin/pi-nohf          # 启动 pi,不带 HF_TOKEN
~/.local/bin/pi-nohf -p "hi"  # 同上,-p 模式

优点:pi --list-models 也不会显示 HF 模型。 缺点:HF_TOKEN 在 pi 内部完全不可用(如 huggingface-cli)。

配置项

| 变量 | 默认值 | 说明 | |---|---|---| | HF_HIDE_MODELS | HF_TOKEN 存在时为 1 | 是否隐藏 HF 模型 | | HF_ALLOWED_MODELS | (空) | 逗号分隔的模型 ID 白名单 | | HF_UNSET_TOKEN | 0 | 如果设为 1,同时从进程环境中移除 HF_TOKEN |