# dsh-llm-chatcode-config
**Repository Path**: shiguifeng/dsh-llm-chatcode-config
## Basic Information
- **Project Name**: dsh-llm-chatcode-config
- **Description**: 把 ChatCode CLI 自定义模型作为一个只读提供方安装到 DeepSeek Harness profile。
- **Primary Language**: Unknown
- **License**: MIT
- **Default Branch**: master
- **Homepage**: None
- **GVP Project**: No
## Statistics
- **Stars**: 0
- **Forks**: 1
- **Created**: 2026-09-02
- **Last Updated**: 2026-09-23
## Categories & Tags
**Categories**: Uncategorized
**Tags**: None
## README
---
description: "把 ChatCode CLI 自定义模型作为一个只读提供方安装到 DeepSeek Harness profile。"
kind: "package-bundle"
---
# dsh-llm-chatcode-config
[English](README.md) | 中文
## 概述
此 bundle 从 ChatCode CLI `settings.json` 加载 `customModels`,并统一发布到一个 `ChatCode CLI` 提供方。它把凭据保存在一份不可变激活快照中,从不写入来源文件或 Harness 设置。包内含已修改 pi-ai 适配器源码的完整副本,因此不会导入或要求安装环境中的 `@deepseek-ai/dsh-llm-pi-ai` 包。
## 目录
- [使用本包](#use-this-package)
- [理解实现](#understand-the-implementation)
- [进一步探索](#further-exploration)
- [模型体验](#model-experience)
- [已知限制与后续工作](#known-limitations-and-deferred-work)
-----
## 使用本包
把 bundle 安装到需要公开导入模型的 profile。包 manifest 会贡献 [`cordis.patch.yml`](cordis.patch.yml),因此 `dsh plugin` 会把 bundle 加入 profile 层列表并挂载适配器。
```text
dsh plugin --profile web add dsh-llm-chatcode-config
dsh plugin --profile web remove dsh-llm-chatcode-config
```
Cordis fiber 激活时,适配器读取 `~/.chatcode-cli/settings.json`。当 ChatCode 使用其他文件时,在 profile 后应用的 `cordis.patch.yml` 层中覆盖路径:
```yaml
- id: llm-chatcode-config
config:
settingsPath: C:/path/to/settings.json
```
每个条目需要非空 `model`、显式 `apiKey` 和 HTTP(S) `baseUrl`。`protocol` 接受 `OpenAI` 或 `Anthropic`;省略协议时,仅 `provider` 为 `anthropic` 才使用 Anthropic。文件不可用或任一条目非法时,bundle 保持激活但不提供 ChatCode 模型;warning 不会引用路径或来源值。修复完整文件并重启 profile 后才会导入模型。
-----
## 理解实现
实现内部机制 — 点击展开
[`src/source.ts`](src/source.ts)把模型元数据与请求凭据分离,并派生稳定的私有连接路由。[`src/adapter.ts`](src/adapter.ts)只公开一个 `chatcode-custom` 路由,同时通过私有路由分派请求。[`vendor/dsh-llm-pi-ai/`](vendor/dsh-llm-pi-ai/)包含这些模块使用的完整已修改 pi-ai 适配器包;构建会把可达的复制模块打包进 `lib/index.js`。
OpenAI 请求使用条目 API key。Anthropic 请求发送 `Authorization: Bearer`,不发送 `x-api-key`。MiniMax M2 OpenAI 请求携带 `reasoning_split: true`。Harness 归属 header 始终为保留字段,复制的适配器使用隔离的 pi-ai 内存凭据存储。
-----
## 进一步探索
- [`docs/chatcode-models.zh.md`](docs/chatcode-models.zh.md)说明用户流程和来源字段。
- [`docs/decisions/2026-08-31-chatcode-model-source.zh.md`](docs/decisions/2026-08-31-chatcode-model-source.zh.md)记录凭据归属和路由身份。
- [`vendor/README.md`](vendor/README.md)记录复制的适配器源码和更新规则。
-----
## 模型体验
模型通过所选导入端点接收普通 Harness 系统提示、消息和工具。配置路径、标签和凭据不会进入模型消息。导入的上下文容量决定请求上下文大小,导入的输出限制成为请求默认值和上限。
## 已知限制与后续工作
- 来源是一份激活快照;编辑文件后需要重新挂载或重启 profile。
- 导入模型声明文本输入,不公开可选推理强度。
- 任一条目非法(包括模型 ID 重复)都会抑制完整导入目录;bundle 不会发布部分有效的来源。
- 包会跟踪复制的 pi-ai 适配器源码及其 DSH peer API;升级时必须执行显式 vendor 刷新和兼容性测试。
### 开发备注
维护者工作上下文 — 点击展开
无。