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-alibaba-bailian

v0.1.0

Published

Pi provider extension for Alibaba Cloud Model Studio (Bailian/DashScope) API keys

Readme

pi-alibaba-bailian

通过阿里云百炼(Model Studio / DashScope)的 API KeyPi 中直接使用千问及百炼托管的文本模型。Provider ID 为 bailian,使用 OpenAI Chat Completions 兼容接口。

快速开始

要求 Node.js 22.19+ 与 Pi 0.84.2+。

export DASHSCOPE_API_KEY="sk-..."

# 在本仓库直接试用
pi -e .

# 或安装本地包
pi install /absolute/path/to/pi-alibaba-bailian

启动 Pi 后运行 /model,选择 bailian/qwen3.8-maxbailian/qwen3.7-plusbailian/qwen3-coder-plus 等模型。也可以查看模型:

pi -e . --list-models bailian

插件只读取 DASHSCOPE_API_KEY 环境变量,不会保存或输出 API Key。

地域与 Endpoint

API Key 与地域绑定。默认使用中国内地通用地址:

https://dashscope.aliyuncs.com/compatible-mode/v1

可通过地域别名选择 Endpoint:

export DASHSCOPE_REGION=china         # cn / beijing / cn-beijing
export DASHSCOPE_REGION=singapore     # sg / intl / international / ap-southeast-1
export DASHSCOPE_REGION=us            # usa / virginia / us-east-1

阿里云建议北京、新加坡业务空间使用专属域名。请通过 DASHSCOPE_BASE_URL 配置控制台中显示的地址(优先级高于 DASHSCOPE_REGION):

export DASHSCOPE_BASE_URL="https://WORKSPACE_ID.cn-beijing.maas.aliyuncs.com"

仅提供 host 时,插件自动补充 /compatible-mode/v1;已经包含 /v1 的地址保持不变。出于 API Key 安全考虑,自定义地址必须使用 HTTPS。修改环境变量后请重启 Pi 或执行 /reload

模型发现

插件会用当前 API Key 请求 {baseUrl}/models,并将返回结果与实际可见 ID 相交。为了避免在 Pi 中显示无法用于 Agent 的媒体或任务专用模型,自动排除图像生成、Embedding、ASR/TTS、Audio、Realtime、翻译、搜索/研究、角色扮演、GUI、OCR、无工具长文本等模型,只保留适合 OpenAI Chat Completions 与 Function Calling 的:

  • Qwen 通用、Coder、VL 系列(含快照别名);
  • 百炼托管的 DeepSeek、Kimi、GLM、MiniMax、MiMo 文本模型。

网络刷新前提供一组推荐模型作为静态 fallback;刷新成功后列表严格使用 API 返回的可用 ID。模型列表打开时也会刷新,因此新模型通常无需更新插件。

模型上下文、输出上限与思考能力对已知型号使用明确元数据,新型号采用保守的系列推断。费用字段固定为 0,仅表示本插件不估算账单,不代表 API 免费;请以阿里云控制台计费为准。

覆盖模型元数据

如模型规格变化,可通过 ~/.pi/agent/models.json 覆盖插件注册的模型,例如:

{
  "providers": {
    "bailian": {
      "modelOverrides": {
        "qwen3.8-max": {
          "contextWindow": 1000000,
          "maxTokens": 131072
        }
      }
    }
  }
}

开发与验证

npm install
npm run check

English

Pi provider extension for Alibaba Cloud Model Studio (Bailian/DashScope) API-key access. Set DASHSCOPE_API_KEY, run pi -e ., and select a bailian/... model. Model discovery is dynamic and filtered to agent-capable Chat Completions models. API keys are region-specific.

License

MIT