100milionseek 0.0.0-stage → 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +118 -2
- package/README.zh-CN.md +108 -0
- package/index.mjs +4 -0
- package/opencode.mjs +5 -0
- package/opencode2.mjs +620 -0
- package/package.json +53 -5
- package/src/index.mjs +380 -0
- package/src/load.mjs +28 -0
- package/src/models.mjs +179 -0
- package/src/quota.mjs +73 -0
- package/src/systemone.mjs +70 -0
- package/test/all.mjs +13 -0
- package/test/load-report.test.mjs +92 -0
- package/test/load.test.mjs +54 -0
- package/test/models.test.mjs +153 -0
- package/test/plugin.test.mjs +278 -0
- package/test/quota.test.mjs +86 -0
- package/test/systemone.test.mjs +69 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 100milionseek plugin authors
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,3 +1,119 @@
|
|
|
1
|
-
#
|
|
1
|
+
# 100milionseek
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
A [magpie](https://usemagpie.ai) provider plugin for
|
|
4
|
+
[100milionseek](https://100milionseek.top) — the relay that gives every key a
|
|
5
|
+
free **DeepSeek V4.1 Flash** allowance of 100 million tokens a day.
|
|
6
|
+
|
|
7
|
+
What the plugin adds beyond a plain `providers.json` entry:
|
|
8
|
+
|
|
9
|
+
- **The daily allowance, read for real.** The service only ever reports what is
|
|
10
|
+
left in `x-quota-*` response headers, so `usage` reads one response and turns
|
|
11
|
+
it into the window magpie shows and routes on. Nothing is made up: when the
|
|
12
|
+
numbers cannot be read, the window shows no percentage instead of 0%.
|
|
13
|
+
- **A working reset time.** When the day is spent the service answers 429
|
|
14
|
+
without a `Retry-After`; the plugin writes one from the reset instant so the
|
|
15
|
+
key sits out until 00:00 UTC rather than for magpie's default guess.
|
|
16
|
+
- **The judge model as a classifier.** `jev-1.13-free` is a System One model
|
|
17
|
+
(`POST /v1/systemone`, one probability per question). The plugin rewrites its
|
|
18
|
+
answer into the shape magpie reads, so it can route
|
|
19
|
+
[routing groups](https://usemagpie.ai/docs/zh/plugins#decide).
|
|
20
|
+
- **Live load.** `/api/status` is polled every two minutes and the upstream's
|
|
21
|
+
inflight/capacity ratio is reported per model, so *Settings › Models › Routing
|
|
22
|
+
› busy models go later* can move work off a saturated relay.
|
|
23
|
+
|
|
24
|
+
## Install
|
|
25
|
+
|
|
26
|
+
```sh
|
|
27
|
+
magpie plugin add ./100milionseek
|
|
28
|
+
# or, once published: magpie plugin add 100milionseek
|
|
29
|
+
magpie plugin login hundred-milion-seek
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
Then pick `hundred-milion-seek/DeepSeek V4.1 Flash (free)` as an agent's model.
|
|
33
|
+
|
|
34
|
+
### Provider id
|
|
35
|
+
|
|
36
|
+
The plugin signs in to the provider id **`hundred-milion-seek`**, not
|
|
37
|
+
`100milionseek`, so it can sit beside a hand-written `100milionseek` provider in
|
|
38
|
+
`providers.json` without either one taking the other's id. Agents address it as
|
|
39
|
+
`hundred-milion-seek/<model>`.
|
|
40
|
+
|
|
41
|
+
If you would rather it took over an existing id, rename the hand-written
|
|
42
|
+
provider first, or sign in with `magpie plugin use` after adding both. Two
|
|
43
|
+
plugins claiming one id serve it one at a time — the chosen one, else the one
|
|
44
|
+
added last.
|
|
45
|
+
|
|
46
|
+
## Sign-in
|
|
47
|
+
|
|
48
|
+
One API key, from <https://100milionseek.top> (it starts with `hms-`). The key is
|
|
49
|
+
checked with `GET /v1/models` before it is saved:
|
|
50
|
+
|
|
51
|
+
- rejected by the service → the sign-in fails with the service's own words;
|
|
52
|
+
- service unreachable → the key is kept anyway, so a network blip cannot lock
|
|
53
|
+
you out.
|
|
54
|
+
|
|
55
|
+
Keys are stored by magpie in `plugin-auth.json` under `hundred-milion-seek`, and
|
|
56
|
+
one key is one account: sign in again with a second key and it is kept as
|
|
57
|
+
`hundred-milion-seek#xxxxxx`, each with its own allowance and its own
|
|
58
|
+
concurrency slots. `magpie plugin logout hundred-milion-seek` forgets it.
|
|
59
|
+
|
|
60
|
+
## Models
|
|
61
|
+
|
|
62
|
+
| Model | What it is |
|
|
63
|
+
| --- | --- |
|
|
64
|
+
| `deepseek-v4.1-flash-free` | The chat model. 198K context, 64K output, streaming, tool calls, OpenAI-compatible. |
|
|
65
|
+
| `jev-1.13-free` | The judge. Answers `POST /v1/systemone` with a probability per question; hidden from agents, used only by routing groups. |
|
|
66
|
+
|
|
67
|
+
Both draw on the same daily allowance (the judge at 0.2 tokens per token asked).
|
|
68
|
+
The list is fixed rather than fetched, because the sizes and the judge's role
|
|
69
|
+
are not in `GET /v1/models`; when an account's listing names a model the plugin
|
|
70
|
+
does not know, it is described with the chat model's shape instead of dropped.
|
|
71
|
+
|
|
72
|
+
Five requests at a time per key, which is the service's own limit — the plugin
|
|
73
|
+
declares it as `maxConcurrency`, so magpie queues rather than collects 429s.
|
|
74
|
+
|
|
75
|
+
## What it does not do
|
|
76
|
+
|
|
77
|
+
No check-in: the service has no daily-claim endpoint (signing up is a mailbox and
|
|
78
|
+
a Cloudflare Turnstile), so there is no `checkin` hook. No sign-in state to
|
|
79
|
+
refresh either — an API key does not expire, and a 401 means the key was
|
|
80
|
+
revoked, which the plugin reports as `signIn: "expired"`.
|
|
81
|
+
|
|
82
|
+
## Layout
|
|
83
|
+
|
|
84
|
+
```
|
|
85
|
+
index.mjs the entry magpie loads
|
|
86
|
+
opencode.mjs the OpenCode 1.x face
|
|
87
|
+
opencode2.mjs the OpenCode 2.x face (byte-identical to the community copy)
|
|
88
|
+
src/index.mjs the plugin: config, auth, provider.models
|
|
89
|
+
src/models.mjs the model table, in both the small and the full shape
|
|
90
|
+
src/quota.mjs x-quota-* headers → a usage window
|
|
91
|
+
src/systemone.mjs the judge's answer → the shape magpie reads
|
|
92
|
+
src/load.mjs /api/status → a load percentage
|
|
93
|
+
test/ the tests, run by `npm test`
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
## Development
|
|
97
|
+
|
|
98
|
+
```sh
|
|
99
|
+
npm test # every test, no network
|
|
100
|
+
npm run check # syntax check + tests
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
The tests use a `fetch` double; nothing talks to the service. To try the real
|
|
104
|
+
thing without touching your own magpie:
|
|
105
|
+
|
|
106
|
+
```sh
|
|
107
|
+
sb=$(mktemp -d)
|
|
108
|
+
m() { env HOME=$sb XDG_CONFIG_HOME=$sb/.config XDG_CACHE_HOME=$sb/.cache \
|
|
109
|
+
MAGPIE_ADDR=127.0.0.1:3499 magpie "$@"; }
|
|
110
|
+
m plugin add ./100milionseek
|
|
111
|
+
m plugin --json
|
|
112
|
+
m plugin login hundred-milion-seek
|
|
113
|
+
m provider test hundred-milion-seek
|
|
114
|
+
m quota
|
|
115
|
+
```
|
|
116
|
+
|
|
117
|
+
## Licence
|
|
118
|
+
|
|
119
|
+
MIT.
|
package/README.zh-CN.md
ADDED
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
# 100milionseek
|
|
2
|
+
|
|
3
|
+
一个给 [magpie](https://usemagpie.ai) 用的 [100milionseek](https://100milionseek.top)
|
|
4
|
+
供应商插件。100milionseek 给每个 key 每天 **1 亿 token** 的免费
|
|
5
|
+
**DeepSeek V4.1 Flash** 额度。
|
|
6
|
+
|
|
7
|
+
比手写一个 `providers.json` 条目多做的几件事:
|
|
8
|
+
|
|
9
|
+
- **真的去读每日额度。** 这个服务只在 `x-quota-*` 响应头里说还剩多少,所以
|
|
10
|
+
`usage` 钩子会发一次请求、把响应头变成 magpie 显示的用量窗口。不编数字:读不到
|
|
11
|
+
就不显示百分比,而不是显示 0%。
|
|
12
|
+
- **给得出正确的重置时间。** 额度用完后服务返回 429 但不带 `Retry-After`,插件用
|
|
13
|
+
重置时刻补上一个,于是这个 key 会歇到 UTC 00:00,而不是 magpie 默认的猜测。
|
|
14
|
+
- **把判定模型当分类器用。** `jev-1.13-free` 是 System One 模型(`POST
|
|
15
|
+
/v1/systemone`,每个问题一个概率)。插件把它的回答改写成 magpie 读的形状,于是
|
|
16
|
+
它就能给[路由组](https://usemagpie.ai/docs/zh/plugins#decide)做判断。
|
|
17
|
+
- **实时负载。** 每两分钟读一次 `/api/status`,把上游的 inflight/capacity 比例按
|
|
18
|
+
模型报给 magpie,*设置 › 模型 › 路由 › 繁忙的模型靠后* 就能把请求挪开一个挤爆的
|
|
19
|
+
中转站。
|
|
20
|
+
|
|
21
|
+
## 安装
|
|
22
|
+
|
|
23
|
+
```sh
|
|
24
|
+
magpie plugin add ./100milionseek
|
|
25
|
+
# 发布到 npm 之后:magpie plugin add 100milionseek
|
|
26
|
+
magpie plugin login hundred-milion-seek
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
然后在 agent 里选 `hundred-milion-seek/DeepSeek V4.1 Flash (free)`。
|
|
30
|
+
|
|
31
|
+
### 供应商 id
|
|
32
|
+
|
|
33
|
+
插件登录的供应商 id 是 **`hundred-milion-seek`**,不是 `100milionseek`。这样它可以
|
|
34
|
+
和你 `providers.json` 里手写的 `100milionseek` 并存,谁也不占谁的 id。agent 里写
|
|
35
|
+
`hundred-milion-seek/<模型>`。
|
|
36
|
+
|
|
37
|
+
想让插件接管已有的 id,就先改掉手写的那个,或者两个都加上之后用 `magpie plugin
|
|
38
|
+
use` 选。两个插件登录同一个 id 时只有一个在服务:选定的那个,否则是后加的那个。
|
|
39
|
+
|
|
40
|
+
## 登录
|
|
41
|
+
|
|
42
|
+
一个 API key,在 <https://100milionseek.top> 拿(以 `hms-` 开头)。保存前会用
|
|
43
|
+
`GET /v1/models` 验一次:
|
|
44
|
+
|
|
45
|
+
- 服务拒绝 → 登录失败,并显示服务自己给的原因;
|
|
46
|
+
- 服务连不上 → 照样保存,免得一次网络抖动把你锁在外面。
|
|
47
|
+
|
|
48
|
+
key 由 magpie 存在 `plugin-auth.json` 的 `hundred-milion-seek` 下。一个 key 就是一个
|
|
49
|
+
账号:再用第二个 key 登录会存成 `hundred-milion-seek#xxxxxx`,各自有各自的额度和
|
|
50
|
+
并发槽位。`magpie plugin logout hundred-milion-seek` 可以忘掉它。
|
|
51
|
+
|
|
52
|
+
## 模型
|
|
53
|
+
|
|
54
|
+
| 模型 | 是什么 |
|
|
55
|
+
| --- | --- |
|
|
56
|
+
| `deepseek-v4.1-flash-free` | 聊天模型。198K 上下文,64K 输出,流式,工具调用,OpenAI 兼容。 |
|
|
57
|
+
| `jev-1.13-free` | 判定模型。`POST /v1/systemone`,每个问题回一个概率;agent 看不到它,只给路由组用。 |
|
|
58
|
+
|
|
59
|
+
两者都吃同一份每日额度(判定模型按每个 token 0.2 计)。模型表是写死的而不是拉取
|
|
60
|
+
的,因为尺寸和判定模型的角色都不在 `GET /v1/models` 里;账号列表里出现了插件不认识
|
|
61
|
+
的模型时,会用聊天模型的形状描述它,而不是丢掉。
|
|
62
|
+
|
|
63
|
+
每个 key 同时 5 个请求,这是服务自己的上限——插件把它声明成 `maxConcurrency`,让
|
|
64
|
+
magpie 排队,而不是攒一堆 429。
|
|
65
|
+
|
|
66
|
+
## 不做什么
|
|
67
|
+
|
|
68
|
+
没有签到:这个服务没有每日领取的接口(注册是邮箱加 Cloudflare Turnstile),所以没
|
|
69
|
+
有 `checkin` 钩子。也没有需要刷新的登录态——API key 不会过期,401 意味着 key 被吊销
|
|
70
|
+
了,插件会报 `signIn: "expired"`。
|
|
71
|
+
|
|
72
|
+
## 目录
|
|
73
|
+
|
|
74
|
+
```
|
|
75
|
+
index.mjs magpie 加载的入口
|
|
76
|
+
opencode.mjs OpenCode 1.x 那一面
|
|
77
|
+
opencode2.mjs OpenCode 2.x 那一面(与社区那份逐字节相同)
|
|
78
|
+
src/index.mjs 插件本体:config、auth、provider.models
|
|
79
|
+
src/models.mjs 模型表,小形状和大形状各一份
|
|
80
|
+
src/quota.mjs x-quota-* 响应头 → 用量窗口
|
|
81
|
+
src/systemone.mjs 判定模型的回答 → magpie 读的形状
|
|
82
|
+
src/load.mjs /api/status → 负载百分比
|
|
83
|
+
test/ 测试,用 `npm test` 跑
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
## 开发
|
|
87
|
+
|
|
88
|
+
```sh
|
|
89
|
+
npm test # 全部测试,不联网
|
|
90
|
+
npm run check # 语法检查 + 测试
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
测试用假的 `fetch`,不碰真服务。想在不打扰自己 magpie 的情况下试真的:
|
|
94
|
+
|
|
95
|
+
```sh
|
|
96
|
+
sb=$(mktemp -d)
|
|
97
|
+
m() { env HOME=$sb XDG_CONFIG_HOME=$sb/.config XDG_CACHE_HOME=$sb/.cache \
|
|
98
|
+
MAGPIE_ADDR=127.0.0.1:3499 magpie "$@"; }
|
|
99
|
+
m plugin add ./100milionseek
|
|
100
|
+
m plugin --json
|
|
101
|
+
m plugin login hundred-milion-seek
|
|
102
|
+
m provider test hundred-milion-seek
|
|
103
|
+
m quota
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
## 许可
|
|
107
|
+
|
|
108
|
+
MIT。
|
package/index.mjs
ADDED
package/opencode.mjs
ADDED
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
// The package's OpenCode 1.x plugins, as OpenCode 1.x and magpie's host
|
|
2
|
+
// load them: its plugin functions and nothing else (1.x refuses a
|
|
3
|
+
// package whose exports include anything but plugins). OpenCode 2.x
|
|
4
|
+
// loads opencode2.mjs, which runs these.
|
|
5
|
+
export { HundredMilionSeekPlugin } from "./index.mjs"
|