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

opencode-copilot-cost-override

v0.1.2

Published

Custom GitHub Copilot provider model configuration with personalized cost values for the highest subscription tier

Downloads

38

Readme

opencode-copilot-cost-override

GitHub Copilot 提供商模型自定义配置 —— 按个人订阅类型调整 model cost 与参数

背景

GitHub Copilot 针对不同订阅类型提供不同的模型上限和计费标准。本插件按个人最高订阅类型的实际情况,硬编码了 Copilot provider 的模型列表和 cost 参数,不依赖内部插件的默认值(默认值为 0)或不准确的 API 返回。

方案

一个 OpenCode 用户侧插件,直接返回硬编码的模型定义(包含真实的 cost 值)。不走外部 /models API 调用,所有配置内聚在插件中,随时可手动调整。

安装与使用

方式一:从 npm 安装

opencode plugin install opencode-copilot-cost-override@latest

或手动在 ~/.config/opencode/opencode.jsonc 中添加:

{
  "plugin": ["opencode-copilot-cost-override@latest"]
}

方式二:从本地路径加载

{
  "plugin": [
    "file:///path/to/opencode-github-copilot-provider"
  ]
}

当前模型配置

| 模型 | input | output | cache_read | cache_write | context | |------|-------|--------|------------|-------------|---------| | gemini-3.1-pro-preview | 2 | 12 | 0.2 | 0 | 1,000,000 | | claude-haiku-4.5 | 1 | 5 | 0.1 | 1.25 | 200,000 | | gpt-5.4 | 2.5 | 15 | 0.25 | 0 | 1,050,000 | | claude-sonnet-4.6 | 3 | 15 | 0.3 | 3.75 | 200,000 | | claude-opus-4.6 | 5 | 25 | 0.5 | 6.25 | 1,000,000 |

以上 cost 对应个人最高订阅类型的实际计费标准。

验证

opencode models github-copilot

自定义模型

要添加/修改/删除模型,编辑 src/models.ts。每个模型需要包含完整字段:

  • id, providerID ("github-copilot")
  • api ({ id, url, npm: "@ai-sdk/github-copilot" })
  • name, family, release_date
  • cost ({ input, output, cache: { read, write } })
  • limit ({ context, input, output })
  • capabilities (temperature, reasoning, attachment, toolcall, input/output, interleaved)
  • options, headers, variants

本地开发用 file:// 路径加载即可,opencode 直接读取 .ts 源码。

发布到 npm

# 1. 更新版本号
pnpm version patch  # 或 minor / major

# 2. 发布(opencode 直接加载 .ts 源码,无需编译)
npm publish --access public --registry https://registry.npmjs.org/

License

MIT