Commit 1e4f853
committed
feat(kilo): 接入 Kilo Gateway 免费层作为第四渠道
Kilo Gateway(api.kilo.ai/api/gateway)对外是标准 OpenAI 兼容协议
(/chat/completions + /models),无需登录、无门禁伪装(与 Zen 的关键差异:
Zen 要伪造 UA/session/tools 并过滤伪工具调用,Kilo 不需要)。
- 免费模型由上游 /models 的权威 isFree 布尔直接过滤(实测 395 个模型中
17 个为 true,含 kilo-auto/free、stealth/space-bunny-alpha、openrouter/free
等无 :free 后缀者),**不做探活**:探活会白耗本就极小的免费配额且结果
随上游免费池波动不稳定;上游增删自动跟随,无静态白名单。
- 免费模型显式标 x0 倍率;name/context_length/max_completion_tokens/
supported_parameters/input_modalities 透传为中立 Model 元数据。
- 思考字段是 delta.reasoning(不是 Zen 的 reasoning_content)。
- 匿名请求头**不带 Authorization**:Kilo 把任何 Authorization 头当真实凭证
校验,带 Bearer public 占位符反而回 401 INVALID_TOKEN(与 Zen 相反)。
- 虚拟凭证行(同 Zen):probe_quota 恒 probe_failed=True → health NULL
「未知」而非耗尽;删除后重启复活,也可在凭证页「添加 Kilo Gateway」补回。
- 错误分类同 Zen:401/400/404/422→INVALID、429→SOFT、403→REQUEST;
限流交引擎软冷却换模型,本包不自建熔断。
- 独立 pacer(KILO_CHAT_MIN_INTERVAL,热更项,默认 0),与 zen/CB/TRAE
互不排队;stream_chat 在 finally 归还并发名额。
- 新增 KILO_API_ENDPOINT / KILO_ALLOWED_ENDPOINTS(端点白名单,仅防误配)。
- 前端补 Provider 联合类型、渠道元数据(KL / --chart-2)、KiloCode Mono
图标、凭证页一键补回与签到隐藏、API Key 绑定与 Playground 强制渠道选项、
quotaSemantics 免费层文案。
- 文档同步 README / PROPOSAL(Q46) / TECHNICAL(§3.15) / docker-compose env。1 parent 289d769 commit 1e4f853
30 files changed
Lines changed: 1377 additions & 58 deletions
File tree
- src
- api
- engine
- provider/kilo
- stats
- tests
- web/src
- api
- __tests__
- components
- pages
- __tests__
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
| 3 | + | |
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
| |||
51 | 51 | | |
52 | 52 | | |
53 | 53 | | |
| 54 | + | |
54 | 55 | | |
55 | 56 | | |
56 | 57 | | |
57 | 58 | | |
58 | 59 | | |
59 | | - | |
| 60 | + | |
60 | 61 | | |
61 | 62 | | |
62 | 63 | | |
| |||
65 | 66 | | |
66 | 67 | | |
67 | 68 | | |
68 | | - | |
| 69 | + | |
69 | 70 | | |
70 | 71 | | |
71 | 72 | | |
| |||
0 commit comments