NingYuanLee/dsh-grok-byapi ↗★ 0

dsh-grok-byapi

通过api接入grok模型

套件
dsh-grok-byapi
相容性
待驗證
Harness 依賴範圍
0.2.0-rc.2
Cordis 依賴範圍
~4.0.4
版本
0.1.0-local
授權
MIT
最近更新
2026年10月17日

安裝

$npx -p @deepseek-ai/dsh dsh plugin --profile web add github:NingYuanLee/dsh-grok-byapi

安装与配置

兼容目标:dsh 0.2.0-rc.2、Node.js >=22.19.0。其他版本尚未承诺兼容。npm 账号注册受阻,「发布到 npm」已推迟,npm install dsh-grok-byapi 目前不可用。

方式一:从仓库安装(推荐,不需要 npm 账号)

dsh --profile grok-all-test --from-default-profile web --dump-config
dsh plugin --profile grok-all-test add "git+https://github.com/NingYuanLee/dsh-grok-byapi.git"

方式二:本地源码调试

git clone https://github.com/NingYuanLee/dsh-grok-byapi.git
cd dsh-grok-byapi
npm install --ignore-scripts
dsh --profile grok-all-test --from-default-profile web --dump-config
dsh plugin --profile grok-all-test add "$PWD"

--dump-config 只创建 profile 目录并打印组合后的配置,不启动服务。dsh plugin add 会自动把插件写进该 profile 的 dsh.profile.bundles,不需要手动编辑;卸载用 dsh plugin --profile grok-all-test remove dsh-grok-byapi。

在该 profile 的 cordis.patch.yml 添加配置覆盖:

- id: grok-byapi
  name: dsh-grok-byapi
  config:
    connection:
      baseURL: http://127.0.0.1:8317/v1
      apiKeyEnv: GROK_ALL_API_KEY
      timeoutMs: 60000
    media:
      imageModel: grok-imagine-image-2.0
      videoModel: grok-imagine-video-1.5
      speechModel: grok-tts
      dataDir: ''

调用密钥存入 dsh 凭据服务,或在启动进程的 GROK_ALL_API_KEY 环境变量提供。配置只填凭据引用,也可使用已有引用名称。不要把密钥写入 YAML 或仓库。连接和媒体字段可供 dsh 插件设置编辑。

dsh --profile grok-all-test --no-open

聊天模型选择 Grok 下的模型;grok_models 查看分类或刷新。公网使用自己的 HTTPS 网关地址;127.0.0.1 指 dsh Host 所在电脑。