@wacry/codeks-bridge 0.0.0-stage → 0.0.3
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 +202 -0
- package/NOTICE +13 -0
- package/README.md +40 -2
- package/catalog/README.md +63 -0
- package/catalog/claude-opus-5-5.json +194 -0
- package/catalog/claude-sonnet-5-5.json +194 -0
- package/catalog/deepseek-flash.json +203 -0
- package/catalog/gpt-5.6-sol.json +152 -0
- package/catalog/gpt-6-astra.json +184 -0
- package/catalog/gpt-6-luna.json +178 -0
- package/catalog/gpt-6-sol.json +182 -0
- package/catalog/gpt-6.1-sol.json +187 -0
- package/dist/adapter-options.d.ts +5 -0
- package/dist/adapter-options.js +41 -0
- package/dist/auth.d.ts +2 -0
- package/dist/auth.js +42 -0
- package/dist/backends/anthropic-tools.d.ts +13 -0
- package/dist/backends/anthropic-tools.js +41 -0
- package/dist/backends/anthropic.d.ts +9 -0
- package/dist/backends/anthropic.js +356 -0
- package/dist/backends/chat.d.ts +16 -0
- package/dist/backends/chat.js +284 -0
- package/dist/backends/deepseek.d.ts +6 -0
- package/dist/backends/deepseek.js +37 -0
- package/dist/backends/responses.d.ts +5 -0
- package/dist/backends/responses.js +227 -0
- package/dist/carrier.d.ts +22 -0
- package/dist/carrier.js +61 -0
- package/dist/catalog.d.ts +8 -0
- package/dist/catalog.js +40 -0
- package/dist/cli.d.ts +2 -0
- package/dist/cli.js +64 -0
- package/dist/compaction-handoff.d.ts +13 -0
- package/dist/compaction-handoff.js +126 -0
- package/dist/compaction-history.d.ts +7 -0
- package/dist/compaction-history.js +20 -0
- package/dist/compaction.d.ts +20 -0
- package/dist/compaction.js +134 -0
- package/dist/config.d.ts +6 -0
- package/dist/config.js +170 -0
- package/dist/errors.d.ts +43 -0
- package/dist/errors.js +141 -0
- package/dist/headers.d.ts +6 -0
- package/dist/headers.js +39 -0
- package/dist/history.d.ts +7 -0
- package/dist/history.js +85 -0
- package/dist/ids.d.ts +1 -0
- package/dist/ids.js +4 -0
- package/dist/index.d.ts +5 -0
- package/dist/index.js +4 -0
- package/dist/inspect/capture.d.ts +119 -0
- package/dist/inspect/capture.js +370 -0
- package/dist/inspect/http.d.ts +7 -0
- package/dist/inspect/http.js +149 -0
- package/dist/inspect/view.d.ts +239 -0
- package/dist/inspect/view.js +388 -0
- package/dist/model-catalog.d.ts +18 -0
- package/dist/model-catalog.js +16 -0
- package/dist/profiles.d.ts +6 -0
- package/dist/profiles.js +63 -0
- package/dist/prompts.d.ts +5 -0
- package/dist/prompts.js +118 -0
- package/dist/server.d.ts +4 -0
- package/dist/server.js +232 -0
- package/dist/sse.d.ts +12 -0
- package/dist/sse.js +93 -0
- package/dist/tool-history.d.ts +4 -0
- package/dist/tool-history.js +73 -0
- package/dist/tools.d.ts +35 -0
- package/dist/tools.js +193 -0
- package/dist/types.d.ts +125 -0
- package/dist/types.js +1 -0
- package/dist/upstream.d.ts +3 -0
- package/dist/upstream.js +89 -0
- package/dist/writer.d.ts +95 -0
- package/dist/writer.js +430 -0
- package/docs/backends-anthropic.md +88 -0
- package/docs/backends-deepseek-chat.md +75 -0
- package/docs/backends-responses.md +33 -0
- package/docs/compaction.md +180 -0
- package/docs/config.md +271 -0
- package/docs/design.md +97 -0
- package/docs/inspect.md +148 -0
- package/docs/reasoning.md +72 -0
- package/docs/releasing.md +50 -0
- package/docs/responses-stream.md +90 -0
- package/docs/testing.md +177 -0
- package/docs/tools.md +68 -0
- package/examples/config.json +35 -0
- package/examples/gpt-claude.json +27 -0
- package/package.json +46 -4
- package/ui/api.js +64 -0
- package/ui/app.css +379 -0
- package/ui/app.js +489 -0
- package/ui/detail.js +713 -0
- package/ui/diff.js +281 -0
- package/ui/dom.js +258 -0
- package/ui/events.js +376 -0
- package/ui/favicon.svg +1 -0
- package/ui/index.html +58 -0
- package/ui/labels.js +106 -0
- package/ui/list.js +180 -0
- package/ui/structure.js +285 -0
- package/ui/tree.js +158 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,202 @@
|
|
|
1
|
+
|
|
2
|
+
Apache License
|
|
3
|
+
Version 2.0, January 2004
|
|
4
|
+
http://www.apache.org/licenses/
|
|
5
|
+
|
|
6
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
7
|
+
|
|
8
|
+
1. Definitions.
|
|
9
|
+
|
|
10
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
11
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
12
|
+
|
|
13
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
14
|
+
the copyright owner that is granting the License.
|
|
15
|
+
|
|
16
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
17
|
+
other entities that control, are controlled by, or are under common
|
|
18
|
+
control with that entity. For the purposes of this definition,
|
|
19
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
20
|
+
direction or management of such entity, whether by contract or
|
|
21
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
22
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
23
|
+
|
|
24
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
25
|
+
exercising permissions granted by this License.
|
|
26
|
+
|
|
27
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
28
|
+
including but not limited to software source code, documentation
|
|
29
|
+
source, and configuration files.
|
|
30
|
+
|
|
31
|
+
"Object" form shall mean any form resulting from mechanical
|
|
32
|
+
transformation or translation of a Source form, including but
|
|
33
|
+
not limited to compiled object code, generated documentation,
|
|
34
|
+
and conversions to other media types.
|
|
35
|
+
|
|
36
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
37
|
+
Object form, made available under the License, as indicated by a
|
|
38
|
+
copyright notice that is included in or attached to the work
|
|
39
|
+
(an example is provided in the Appendix below).
|
|
40
|
+
|
|
41
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
42
|
+
form, that is based on (or derived from) the Work and for which the
|
|
43
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
44
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
45
|
+
of this License, Derivative Works shall not include works that remain
|
|
46
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
47
|
+
the Work and Derivative Works thereof.
|
|
48
|
+
|
|
49
|
+
"Contribution" shall mean any work of authorship, including
|
|
50
|
+
the original version of the Work and any modifications or additions
|
|
51
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
52
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
53
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
54
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
55
|
+
means any form of electronic, verbal, or written communication sent
|
|
56
|
+
to the Licensor or its representatives, including but not limited to
|
|
57
|
+
communication on electronic mailing lists, source code control systems,
|
|
58
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
59
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
60
|
+
excluding communication that is conspicuously marked or otherwise
|
|
61
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
62
|
+
|
|
63
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
64
|
+
on behalf of whom a Contribution has been received by Licensor and
|
|
65
|
+
subsequently incorporated within the Work.
|
|
66
|
+
|
|
67
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
68
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
69
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
70
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
71
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
72
|
+
Work and such Derivative Works in Source or Object form.
|
|
73
|
+
|
|
74
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
75
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
76
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
77
|
+
(except as stated in this section) patent license to make, have made,
|
|
78
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
79
|
+
where such license applies only to those patent claims licensable
|
|
80
|
+
by such Contributor that are necessarily infringed by their
|
|
81
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
82
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
83
|
+
institute patent litigation against any entity (including a
|
|
84
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
85
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
86
|
+
or contributory patent infringement, then any patent licenses
|
|
87
|
+
granted to You under this License for that Work shall terminate
|
|
88
|
+
as of the date such litigation is filed.
|
|
89
|
+
|
|
90
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
91
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
92
|
+
modifications, and in Source or Object form, provided that You
|
|
93
|
+
meet the following conditions:
|
|
94
|
+
|
|
95
|
+
(a) You must give any other recipients of the Work or
|
|
96
|
+
Derivative Works a copy of this License; and
|
|
97
|
+
|
|
98
|
+
(b) You must cause any modified files to carry prominent notices
|
|
99
|
+
stating that You changed the files; and
|
|
100
|
+
|
|
101
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
102
|
+
that You distribute, all copyright, patent, trademark, and
|
|
103
|
+
attribution notices from the Source form of the Work,
|
|
104
|
+
excluding those notices that do not pertain to any part of
|
|
105
|
+
the Derivative Works; and
|
|
106
|
+
|
|
107
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
108
|
+
distribution, then any Derivative Works that You distribute must
|
|
109
|
+
include a readable copy of the attribution notices contained
|
|
110
|
+
within such NOTICE file, excluding those notices that do not
|
|
111
|
+
pertain to any part of the Derivative Works, in at least one
|
|
112
|
+
of the following places: within a NOTICE text file distributed
|
|
113
|
+
as part of the Derivative Works; within the Source form or
|
|
114
|
+
documentation, if provided along with the Derivative Works; or,
|
|
115
|
+
within a display generated by the Derivative Works, if and
|
|
116
|
+
wherever such third-party notices normally appear. The contents
|
|
117
|
+
of the NOTICE file are for informational purposes only and
|
|
118
|
+
do not modify the License. You may add Your own attribution
|
|
119
|
+
notices within Derivative Works that You distribute, alongside
|
|
120
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
121
|
+
that such additional attribution notices cannot be construed
|
|
122
|
+
as modifying the License.
|
|
123
|
+
|
|
124
|
+
You may add Your own copyright statement to Your modifications and
|
|
125
|
+
may provide additional or different license terms and conditions
|
|
126
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
127
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
128
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
129
|
+
the conditions stated in this License.
|
|
130
|
+
|
|
131
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
132
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
133
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
134
|
+
this License, without any additional terms or conditions.
|
|
135
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
136
|
+
the terms of any separate license agreement you may have executed
|
|
137
|
+
with Licensor regarding such Contributions.
|
|
138
|
+
|
|
139
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
140
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
141
|
+
except as required for reasonable and customary use in describing the
|
|
142
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
143
|
+
|
|
144
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
145
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
146
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
147
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
148
|
+
implied, including, without limitation, any warranties or conditions
|
|
149
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
150
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
151
|
+
appropriateness of using or redistributing the Work and assume any
|
|
152
|
+
risks associated with Your exercise of permissions under this License.
|
|
153
|
+
|
|
154
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
155
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
156
|
+
unless required by applicable law (such as deliberate and grossly
|
|
157
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
158
|
+
liable to You for damages, including any direct, indirect, special,
|
|
159
|
+
incidental, or consequential damages of any character arising as a
|
|
160
|
+
result of this License or out of the use or inability to use the
|
|
161
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
162
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
163
|
+
other commercial damages or losses), even if such Contributor
|
|
164
|
+
has been advised of the possibility of such damages.
|
|
165
|
+
|
|
166
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
167
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
168
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
169
|
+
or other liability obligations and/or rights consistent with this
|
|
170
|
+
License. However, in accepting such obligations, You may act only
|
|
171
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
172
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
173
|
+
defend, and hold each Contributor harmless for any liability
|
|
174
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
175
|
+
of your accepting any such warranty or additional liability.
|
|
176
|
+
|
|
177
|
+
END OF TERMS AND CONDITIONS
|
|
178
|
+
|
|
179
|
+
APPENDIX: How to apply the Apache License to your work.
|
|
180
|
+
|
|
181
|
+
To apply the Apache License to your work, attach the following
|
|
182
|
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
|
183
|
+
replaced with your own identifying information. (Don't include
|
|
184
|
+
the brackets!) The text should be enclosed in the appropriate
|
|
185
|
+
comment syntax for the file format. We also recommend that a
|
|
186
|
+
file or class name and description of purpose be included on the
|
|
187
|
+
same "printed page" as the copyright notice for easier
|
|
188
|
+
identification within third-party archives.
|
|
189
|
+
|
|
190
|
+
Copyright [yyyy] [name of copyright owner]
|
|
191
|
+
|
|
192
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
193
|
+
you may not use this file except in compliance with the License.
|
|
194
|
+
You may obtain a copy of the License at
|
|
195
|
+
|
|
196
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
197
|
+
|
|
198
|
+
Unless required by applicable law or agreed to in writing, software
|
|
199
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
200
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
201
|
+
See the License for the specific language governing permissions and
|
|
202
|
+
limitations under the License.
|
package/NOTICE
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
codeks-bridge
|
|
2
|
+
Copyright 2026 David Zhang
|
|
3
|
+
|
|
4
|
+
This product includes text from OpenAI Codex (https://github.com/openai/codex),
|
|
5
|
+
licensed under the Apache License, Version 2.0:
|
|
6
|
+
|
|
7
|
+
- src/prompts.ts contains a summary prefix copied from:
|
|
8
|
+
codex-rs/prompts/templates/compact/summary_prefix.md
|
|
9
|
+
- src/prompts.ts contains handoff instructions adapted from:
|
|
10
|
+
codex-rs/prompts/templates/compact/prompt.md
|
|
11
|
+
- catalog/*.json contains model metadata and prompts copied or adapted from:
|
|
12
|
+
codex-rs/models-manager/models.json
|
|
13
|
+
Each catalog entry records its source tag, commit, and changes.
|
package/README.md
CHANGED
|
@@ -1,3 +1,41 @@
|
|
|
1
|
-
#
|
|
1
|
+
# codeks-bridge
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
给 [codeks](https://github.com/WAcry/codeks) 使用的本地模型桥接器。一个 Responses provider 可接入多个 GPT、Claude Messages 和 DeepSeek Chat 上游,支持工具、图片、流式回答和跨模型会话。
|
|
4
|
+
|
|
5
|
+
项目维护一份有限的[模型目录](catalog/README.md)。GPT 保留 Codex 源码中各自的条目,第三方模型采用经精调的现代模板。客户端使用 Responses Lite、Code Mode Only 和多代理;配置可分别指定模型别名、目录条目和真实部署名。
|
|
6
|
+
|
|
7
|
+
## 安装和使用
|
|
8
|
+
|
|
9
|
+
需要 Node.js ≥ 22.18 和已安装的 codeks。
|
|
10
|
+
|
|
11
|
+
```sh
|
|
12
|
+
npm install -g @wacry/codeks-bridge
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
把[示例配置](examples/config.json)复制到仓库外,填写端点与 API key 环境变量,保留需要的模型。`catalog` 选择受支持的模型,`upstream` 选择连接,`model` 是实际发给上游的部署名;窗口与参数可以覆盖目录默认值。
|
|
16
|
+
|
|
17
|
+
```sh
|
|
18
|
+
codeks-bridge serve --config /absolute/path/bridge.json
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
另一个终端生成客户端配置:
|
|
22
|
+
|
|
23
|
+
```sh
|
|
24
|
+
codeks-bridge config-snippet --config /absolute/path/bridge.json
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
将输出合并到 codeks 的 `config.toml`,顶层配置放在表定义前,替换已有同名项。codeks 会从 bridge 的 `/v1/models` 读取公开模型的完整目录,然后可按配置中的别名选择模型。专用预设可设 `expose: false`,保留内部调用而不占模型列表。已有 `model_catalog_json` 会优先使用本地文件;迁移到 HTTP 目录时应移除它。修改 bridge 配置后重启服务。
|
|
28
|
+
|
|
29
|
+
## 使用边界
|
|
30
|
+
|
|
31
|
+
- 上游错误保留原始详情交给客户端;bridge 不自动换端点、重试或更换压缩方式。
|
|
32
|
+
- Reasoning 默认只回放给原目标。原生压缩与 reasoning 的跨目标复用分别配置,实际兼容性由上游决定。
|
|
33
|
+
- GPT 默认使用 `compaction.mode: "native"`:先做原生加密压缩,需要文字表示时再向原来源复述并缓存。其他模型默认使用标准文字压缩,也可通过 [`compaction.model`](docs/config.md#压缩模式与执行模型) 委托常用 GPT 执行原生压缩,直接复用已有模型配置;见 [GPT+Claude 双模型示例](examples/gpt-claude.json)。
|
|
34
|
+
- 历史由 codeks 保存;按需复述的成功结果另存本地缓存。封装只是编码,文字 reasoning、摘要及复述配方可读。
|
|
35
|
+
- Lark/regex 转为工具描述约束。图片理解由模型支持,客户端配置关闭网页搜索和图片生成。
|
|
36
|
+
|
|
37
|
+
## 调试
|
|
38
|
+
|
|
39
|
+
`serve` 加 `--capture` 后打开日志里的 `/inspect/` 地址,可以逐条查看 codeks 请求、发往上游的请求、上游原始响应和写回 codeks 的响应,以及 reasoning 与压缩状态的回放决定。记录只在内存中,也可以在页面上开关捕获、清空或导出。详见[调试检查器](docs/inspect.md)。
|
|
40
|
+
|
|
41
|
+
[配置与模型目录](docs/config.md) · [整体设计](docs/design.md) · [Reasoning](docs/reasoning.md) · [压缩](docs/compaction.md) · [工具](docs/tools.md) · [调试检查器](docs/inspect.md) · [验证](docs/testing.md) · [发布](docs/releasing.md)
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
# 已审阅模型目录
|
|
2
|
+
|
|
3
|
+
这里保存运行时使用的完整模型条目。每个文件对应一个受支持的 catalog key;显示别名、连接和实际发给上游的模型名由用户配置。未知 key 直接报错,不使用通用模板猜测模型能力。
|
|
4
|
+
|
|
5
|
+
当前来源是 OpenAI Codex 的 [`rust-v0.163.0`](https://github.com/openai/codex/tree/rust-v0.163.0),commit `83086188ae0614bd882818ff1aa23f3194962012`,文件 `codex-rs/models-manager/models.json`。不从订阅账号请求远端目录,也不在用户启动时读取本机 codeks 的最新模板。
|
|
6
|
+
|
|
7
|
+
| Catalog key | 来源条目 | Adapter |
|
|
8
|
+
| --- | --- | --- |
|
|
9
|
+
| `gpt-6-astra` | 同名条目 | `gpt-responses` |
|
|
10
|
+
| `gpt-6.1-sol` | 同名条目 | `gpt-responses` |
|
|
11
|
+
| `gpt-6-sol` | 同名条目 | `gpt-responses` |
|
|
12
|
+
| `gpt-6-luna` | 同名条目 | `gpt-responses` |
|
|
13
|
+
| `gpt-5.6-sol` | 同名条目 | `gpt-responses` |
|
|
14
|
+
| `claude-opus-5-5` | `gpt-6.1-sol`,经精调 | `claude-messages` |
|
|
15
|
+
| `claude-sonnet-5-5` | `gpt-6.1-sol`,经精调 | `claude-messages` |
|
|
16
|
+
| `deepseek-flash` | `gpt-6.1-sol`,经精调 | `deepseek-chat` |
|
|
17
|
+
|
|
18
|
+
每份 JSON 包含:
|
|
19
|
+
|
|
20
|
+
- `source`:上游仓库、tag、commit、文件路径和源模型名。
|
|
21
|
+
- `adjustments`:相对于源条目的精调说明,供审阅和更新时核对。
|
|
22
|
+
- `adapter`:协议转换实现。
|
|
23
|
+
- `effort_map`:第三方模型显式提供的客户端档位到原生参数映射;GPT 从原始模型条目推导,不重复填写。
|
|
24
|
+
- `max_output_tokens`:为上游必填输出参数提供的默认预算;配置和请求可以覆盖。
|
|
25
|
+
- `model`:完整的 Codex 模型条目,包括提示词和工具元数据。
|
|
26
|
+
|
|
27
|
+
`model` 是运行时的唯一模板来源。运行时只展开别名与用户的明确覆盖,不重新生成这些精调内容,也不维护第二套完整上游副本。
|
|
28
|
+
|
|
29
|
+
## 当前精调
|
|
30
|
+
|
|
31
|
+
五个 GPT 的 `model` 对象分别完整保留对应上游条目,包括各自的提示词、默认 effort、摘要设置、服务档位和多代理设置。运行时从各自的 `supported_reasoning_levels` 推导普通档位;`ultra` 是客户端模式,按 `multi_agent_reasoning_effort` 解析,源条目未指定时使用 `max`,不会把 `ultra` 直接作为 GPT 原生 effort。不能用 GPT-6.1 Sol 的默认值覆盖 Luna 或其他 GPT 的差异。
|
|
32
|
+
|
|
33
|
+
Claude 和 DeepSeek 从 GPT-6.1 Sol 的完整条目开始,只做各自 JSON 中列出的修改:底层模型与展示信息、工作窗口、reasoning 档位,以及当前 adapter 尚未转换的参数和 GPT 专属的服务展示信息。提示词仅将首句的 `based on GPT-6` 换成 `based on Claude` 或 `based on DeepSeek`;`You are Codex`、`As Codex` 和其余客户端指令保留。`default_reasoning_summary` 保持源条目的 `none`,由用户在 codeks 中选择摘要展示方式。
|
|
34
|
+
|
|
35
|
+
预算默认值遵循与 GPT-6.1 Sol 模板对齐的维护原则:仅保留模板已有字段,或为上游必填参数补充默认值;公布的能力上限本身不要求新增默认配置。窗口字段沿用模板结构:三个第三方条目的 `context_window` 与 `max_context_window` 均为 `1000000`。压缩阈值保留模板的 `auto_compact_token_limit: null`,由客户端按窗口计算。Claude Messages 要求 `max_tokens`,因此两个 Claude 条目提供 `128000` 默认预算;GPT 和 DeepSeek 的输出预算由请求、用户配置或上游默认值决定。
|
|
36
|
+
|
|
37
|
+
依据:[Claude 模型规格](https://platform.claude.com/docs/en/models/sonnet-5-5/overview)、[Messages 必填参数](https://platform.claude.com/docs/en/api/messages/create)、[DeepSeek 模型规格](https://api-docs.deepseek.com/quick_start/pricing/)。这些是第三方精调的依据,`source` 仍记录 Codex 模板来源。
|
|
38
|
+
|
|
39
|
+
Claude 的默认 effort 为 `medium`,DeepSeek 为 `high`。DeepSeek 的 `none` 请求关闭 thinking;Claude 两个条目从 `low` 开始:Opus 5.5 始终启用 thinking,Sonnet 5.5 的最低模式 `between_tools` 仍保留工具之间的思考,因此不能用 `none` 表示。需要 Sonnet 的这一模式时,使用 [Messages 原生 options](../docs/backends-anthropic.md#历史与-thinking) 显式配置。目录列出的档位应与已审阅模型匹配;未列出的显式请求值仍交给上游裁决。[Claude thinking 规则](https://platform.claude.com/docs/en/build-with-claude/thinking)
|
|
40
|
+
|
|
41
|
+
`ultra` 保留 Codex 的自动分工提示词和档位说明:Opus 5.5 使用原生 `xhigh`,Sonnet 5.5 与 DeepSeek Flash 使用 `max`;各条目的 `multi_agent_reasoning_effort` 与映射一致。
|
|
42
|
+
|
|
43
|
+
这些源模型都明确设置 `supports_search_tool: true`,本目录保持原值。Code Mode Only 如何暴露工具由客户端源码决定,不能因为没有独立的外层 `tool_search` 就把此字段改为 false。网页搜索和图片生成有各自的客户端设置,不通过这个字段控制。
|
|
44
|
+
|
|
45
|
+
`comp_hash: "3000"` 与 `prefer_websockets: true` 也保留源值。前者标记客户端压缩兼容组,bridge 检查点的文字表示使跨目标恢复可行;原生密文是否复用仍由独立策略决定。后者是模型偏好,实际传输受 provider 的 WebSocket 能力开关控制。详见[压缩兼容组](../docs/compaction.md#comp_hash-与原生状态兼容性)和[客户端配置](../docs/config.md#http-发现)。
|
|
46
|
+
|
|
47
|
+
## 更新流程
|
|
48
|
+
|
|
49
|
+
先取得明确版本的 Codex 源码,再导入需要检查的单个模型,输出到独立候选文件:
|
|
50
|
+
|
|
51
|
+
```sh
|
|
52
|
+
node scripts/import-catalog.ts \
|
|
53
|
+
--source /path/to/codex/codex-rs/models-manager/models.json \
|
|
54
|
+
--tag rust-v0.163.0 \
|
|
55
|
+
--model gpt-6.1-sol \
|
|
56
|
+
--output /path/to/review/gpt-6.1-sol.candidate.json
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
脚本验证源文件与指定 tag 的内容一致,并记录实际 commit。输出文件必须尚不存在,因此不会覆盖已审阅文件。导入结果默认使用 `gpt-responses`,保留源条目自身的 reasoning 设置,不添加独立的 `effort_map`;第三方条目仍需人工或 Agent 根据模板变化重新精调。
|
|
60
|
+
|
|
61
|
+
比较候选文件与现有条目,重点审查提示词、Code Mode、Responses Lite、多代理、reasoning、窗口、`comp_hash` 和工具元数据。字段含义或客户端传输行为变化时,应同时核对对应源码。决定采用新版本后,将调整落实到完整条目、更新 `source` 与 `adjustments`,运行项目检查并提交审阅。新增 key 时还需加入 `src/model-catalog.ts` 的有限目录。不要只改生成给客户端的 `models.json`,否则下次展开配置会丢失修改。
|
|
62
|
+
|
|
63
|
+
所有源文本遵循 OpenAI Codex 的 Apache-2.0 许可,归属说明见根目录 `NOTICE`。
|