@machina.ai/ch-llm-reboot 0.1.5-alpha.1.c1

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 ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 DeepSeek
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.
@@ -0,0 +1,6 @@
1
+ # Bilingual-pair consistency record (docs/i18n/README.md): the git blob hash of each
2
+ # side as of the last confirmed-consistent state. Both languages carry equal authority;
3
+ # after editing either side, bring the other along and re-record with:
4
+ # pnpm run verify-translation-pairing --write packages/llm/llm-reboot/README.md
5
+ README.md: ca4802d316b8c06f120bb89808224e7046c79e78
6
+ README.zh.md: 7ad5f88484d8d570acacdfd457dccdb3851ea908
package/README.md ADDED
@@ -0,0 +1,113 @@
1
+ ---
2
+ description: "Zero-API-Key Multi-Model LLM Provider for DeepSeek Harness with dynamic routing across Google Gemini, Anthropic Claude, OpenAI, xAI Grok, and Amazon Bedrock."
3
+ kind: "package-reference"
4
+ ---
5
+
6
+ # @machina.ai/ch-llm-reboot
7
+
8
+ English | [中文](README.zh.md)
9
+
10
+ ## Summary
11
+
12
+ The `@machina.ai/ch-llm-reboot` package provides a multi-model LLM adapter and dynamic routing engine for DeepSeek Harness and Cell Harness. It translates standard Cordis `LlmRequest` calls into provider-specific wire protocols across Google Gemini, Anthropic Claude, OpenAI, xAI Grok, and Amazon Bedrock. All requests are routed through `ctx.rebootAuth.fetch` without local API keys, supporting SSE streaming, reasoning tokens, and tool call delta normalization.
13
+
14
+ ## Table of Contents
15
+
16
+ - [Use this package](#use-this-package)
17
+ - [Understand the implementation](#understand-the-implementation)
18
+ - [Further Exploration](#further-exploration)
19
+ - [Model Experience](#model-experience)
20
+ - [Known Limitations and Deferred Work](#known-limitations-and-deferred-work)
21
+ - [Dev Note](#dev-note)
22
+
23
+ -----
24
+
25
+ <a id="use-this-package"></a>
26
+ ## Use this package
27
+
28
+ Load `@machina.ai/ch-llm-reboot` into your Cordis container or declare it in your `cordis.yml` profile:
29
+
30
+ ```yaml
31
+ plugins:
32
+ "@machina.ai/ch-auth-reboot-sso":
33
+ auth:
34
+ keycloak_url: "https://sso.reboot.vc/realms/cell-prod"
35
+ keycloak_client_id: "cell-cli"
36
+ agent:
37
+ agent_api_url: "https://api.machina.ai"
38
+ "@machina.ai/ch-llm-reboot":
39
+ agent:
40
+ agent_api_url: "https://api.machina.ai"
41
+ timeout_seconds: 1200
42
+ default_model: "auto-gemini-3.8"
43
+ provider_name: "reboot"
44
+ ```
45
+
46
+ -----
47
+
48
+ <a id="understand-the-implementation"></a>
49
+ ## Understand the implementation
50
+
51
+ <details>
52
+ <summary>Implementation internals — click to expand</summary>
53
+
54
+ ### Architectural Seams
55
+
56
+ - **Model Catalog & Dynamic Routing**: Maps static models and task-tier aliases (`auto`, `pro`, `flash`, `auto-gemini-3.8`, `auto-grok-4.6`, `auto-gpt-5.6-frontier`) to provider families.
57
+ - **Provider Serializers & Parsers**: Tailored JSON payload formats and SSE stream parsers for Gemini, Anthropic, OpenAI, xAI, and Bedrock.
58
+ - **Zero-Key HTTP Transport**: Uses `ctx.rebootAuth.fetch` for automatic bearer token injection and 401 retry handling.
59
+ - **Unified Error Mapping**: Maps upstream status codes and failure payloads into strongly-typed `LlmError` instances.
60
+
61
+ ### Source map
62
+
63
+ | File | Role |
64
+ |---|---|
65
+ | [`src/index.ts`](src/index.ts) | Plugin entrypoint, Config schema, and Cordis registration |
66
+ | [`src/types.ts`](src/types.ts) | Type interfaces for model catalog, config, and route mappings |
67
+ | [`src/catalog.ts`](src/catalog.ts) | Model catalog definitions and dynamic alias resolution |
68
+ | [`src/adapter.ts`](src/adapter.ts) | Cordis `LlmAdapter` implementation |
69
+ | [`src/dispatcher.ts`](src/dispatcher.ts) | Upstream fetch dispatcher and stream normalizer |
70
+ | [`src/sse-parser.ts`](src/sse-parser.ts) | Resilient SSE stream chunk parser |
71
+ | [`src/errors.ts`](src/errors.ts) | Unified HTTP status to `LlmError` mapping |
72
+ | [`src/formatters/`](src/formatters/) | Provider-specific wire payload formatters and parsers |
73
+
74
+ </details>
75
+
76
+ -----
77
+
78
+ <a id="further-exploration"></a>
79
+ ## Further Exploration
80
+
81
+ - [llm group map](../README.md) — sibling packages and LLM group architecture.
82
+ - [dsh-auth-reboot-sso](../../identity/auth-reboot-sso/README.md) — SSO authentication provider.
83
+
84
+ <a id="model-experience"></a>
85
+ ## Model Experience
86
+
87
+ None, as the adapter translates Cordis model requests to upstream HTTP endpoints and registers nothing model-facing.
88
+
89
+ #### KV Cache effect
90
+
91
+ None; upstream gateway dispatch and SSE normalization are transport layers and do not alter prompt token cache alignment.
92
+
93
+ ## Known Limitations and Deferred Work
94
+
95
+ <a id="known-limitations-and-deferred-work"></a>
96
+
97
+ - **Upstream Gateway Availability** — Requires network connectivity to the upstream Reboot AI gateway; local offline inference is handled by other dedicated providers.
98
+
99
+ <a id="dev-note"></a>
100
+ ### Dev Note
101
+
102
+ <details>
103
+ <summary>Working context for maintainers — click to expand</summary>
104
+
105
+ This Dev Note is working context for maintainers: open questions and directions that are not decided.
106
+
107
+ #### Open: Direct WebRTC Audio Streaming
108
+
109
+ Future versions may bridge real-time multimodal audio streaming for native Gemini/OpenAI voice protocols.
110
+
111
+ </details>
112
+
113
+ **Runtime invariant:** No companion is published. The adapter transforms each request and stream in place without retaining cross-request state; its observation surface is the upstream HTTP exchange, and the per-provider wire formatters and SSE parser are asserted by behavior specs.
package/README.zh.md ADDED
@@ -0,0 +1,113 @@
1
+ ---
2
+ description: "适用于 DeepSeek Harness 的零 API 密钥多模型 LLM 提供方插件,支持跨 Google Gemini、Anthropic Claude、OpenAI、xAI Grok 及 Amazon Bedrock 动态路由。"
3
+ kind: "package-reference"
4
+ ---
5
+
6
+ # @machina.ai/ch-llm-reboot
7
+
8
+ [English](README.md) | 中文
9
+
10
+ ## 概述
11
+
12
+ `@machina.ai/ch-llm-reboot` 包为 DeepSeek Harness 和 Cell Harness 提供了多模型 LLM 适配器与动态路由引擎。它将标准的 Cordis `LlmRequest` 调用转换为面向 Google Gemini、Anthropic Claude、OpenAI、xAI Grok 及 Amazon Bedrock 的各提供方特定通信协议。所有请求均通过 `ctx.rebootAuth.fetch` 传输,无需本地 API 密钥,并完整支持 SSE 流式传输、推理思考 Token 以及工具调用增量规整。
13
+
14
+ ## 目录
15
+
16
+ - [使用本包](#use-this-package)
17
+ - [了解实现细节](#understand-the-implementation)
18
+ - [进一步探索](#further-exploration)
19
+ - [模型体验](#model-experience)
20
+ - [已知限制与后续工作](#known-limitations-and-deferred-work)
21
+ - [开发备注](#dev-note)
22
+
23
+ -----
24
+
25
+ <a id="use-this-package"></a>
26
+ ## 使用本包
27
+
28
+ 将 `@machina.ai/ch-llm-reboot` 加载到您的 Cordis 容器中,或在 `cordis.yml` 配置文件中声明:
29
+
30
+ ```yaml
31
+ plugins:
32
+ "@machina.ai/ch-auth-reboot-sso":
33
+ auth:
34
+ keycloak_url: "https://sso.reboot.vc/realms/cell-prod"
35
+ keycloak_client_id: "cell-cli"
36
+ agent:
37
+ agent_api_url: "https://api.machina.ai"
38
+ "@machina.ai/ch-llm-reboot":
39
+ agent:
40
+ agent_api_url: "https://api.machina.ai"
41
+ timeout_seconds: 1200
42
+ default_model: "auto-gemini-3.8"
43
+ provider_name: "reboot"
44
+ ```
45
+
46
+ -----
47
+
48
+ <a id="understand-the-implementation"></a>
49
+ ## 了解实现细节
50
+
51
+ <details>
52
+ <summary>实现细节 — 点击展开</summary>
53
+
54
+ ### 架构接缝
55
+
56
+ - **模型目录与动态路由**:将静态模型和任务层别名(`auto`、`pro`、`flash`、`auto-gemini-3.8`、`auto-grok-4.6`、`auto-gpt-5.6-frontier`)映射至对应的提供方家族。
57
+ - **提供方序列化与解析器**:针对 Gemini、Anthropic、OpenAI、xAI 及 Bedrock 定制的 JSON 载荷与 SSE 流解析器。
58
+ - **零密钥 HTTP 传输**:通过 `ctx.rebootAuth.fetch` 自动注入 Bearer Token 并处理 401 重试。
59
+ - **统一错误映射**:将上游 HTTP 状态码与错误载荷映射为强类型的 `LlmError` 实例。
60
+
61
+ ### 源码映射
62
+
63
+ | 文件 | 角色 |
64
+ |---|---|
65
+ | [`src/index.ts`](src/index.ts) | 插件入口、Config Schema 与 Cordis 注册 |
66
+ | [`src/types.ts`](src/types.ts) | 模型目录、配置和路由映射类型接口 |
67
+ | [`src/catalog.ts`](src/catalog.ts) | 模型目录定义与动态别名解析 |
68
+ | [`src/adapter.ts`](src/adapter.ts) | Cordis `LlmAdapter` 实现 |
69
+ | [`src/dispatcher.ts`](src/dispatcher.ts) | 上游请求分发器与流规整器 |
70
+ | [`src/sse-parser.ts`](src/sse-parser.ts) | 弹性 SSE 流数据块解析器 |
71
+ | [`src/errors.ts`](src/errors.ts) | 统一 HTTP 状态码至 `LlmError` 映射 |
72
+ | [`src/formatters/`](src/formatters/) | 提供方特定格式化器与解析器 |
73
+
74
+ </details>
75
+
76
+ -----
77
+
78
+ <a id="further-exploration"></a>
79
+ ## 进一步探索
80
+
81
+ - [llm 分组导图](../README.zh.md) — 兄弟包与 LLM 组架构。
82
+ - [dsh-auth-reboot-sso](../../identity/auth-reboot-sso/README.zh.md) — SSO 认证提供方。
83
+
84
+ <a id="model-experience"></a>
85
+ ## 模型体验
86
+
87
+ 无,因为适配器将 Cordis 模型请求转换为上游 HTTP 端点请求,未注册面向模型的上下文。
88
+
89
+ #### KV Cache 效应
90
+
91
+ 无;上游网关分发与 SSE 规整属于传输层,不会改变 Prompt Token 缓存对齐。
92
+
93
+ ## 已知限制与后续工作
94
+
95
+ <a id="known-limitations-and-deferred-work"></a>
96
+
97
+ - **上游网关可用性要求** — 需要与上游 Reboot AI 网关的网络连通性;本地离线推理交由其他专用提供方处理。
98
+
99
+ <a id="dev-note"></a>
100
+ ### 开发备注
101
+
102
+ <details>
103
+ <summary>维护者工作上下文 — 点击展开</summary>
104
+
105
+ 本开发笔记是维护者的工作上下文:待决的开放问题和方向。
106
+
107
+ #### 待决:直接 WebRTC 音频流式传输
108
+
109
+ 未来版本可能会为 Gemini/OpenAI 原生语音协议桥接实时多模态音频流。
110
+
111
+ </details>
112
+
113
+ **运行时不变式:** 不发布伴生入口。适配器就地转换每个请求与流,不保留跨请求状态;其观察面是上游 HTTP 交换,各提供方的报文格式化器与 SSE 解析器由行为测试覆盖。