Skip to content

Instantly share code, notes, and snippets.

@linyanm
Last active August 19, 2026 07:56
Show Gist options
  • Select an option

  • Save linyanm/02cd12d9ff28f67c83357ccae4bf5e22 to your computer and use it in GitHub Desktop.

Select an option

Save linyanm/02cd12d9ff28f67c83357ccae4bf5e22 to your computer and use it in GitHub Desktop.
pi 配置 Muse Spark 1.2 Contributor

pi 配置 Muse Spark 1.2 Contributor

仅记录 pi 侧配置,无需关注中转实现

前置

  • 已有中转地址与令牌(示例:http://YOUR_SUB2API_HOST:8080/v1 + YOUR_MUSE_TOKEN
  • pi 配置目录:~/.pi/agent/

1. models.json 新增独立 muse 提供商

~/.pi/agent/models.json,参考 xai 的覆盖写法:

{
  "providers": {
    "muse": {
      "baseUrl": "http://YOUR_SUB2API_HOST:8080/v1",
      "apiKey": "YOUR_MUSE_TOKEN",
      "models": [
        {
          "id": "muse-spark-1.2-contributor",
          "name": "Muse Spark 1.2 Contributor",
          "api": "openai-responses",
          "reasoning": true,
          "input": ["text", "image"],
          "contextWindow": 1048576,
          "maxTokens": 131072,
          "cost": { "input": 0.1, "output": 0.2, "cacheRead": 0.002, "cacheWrite": 0 },
          "compat": { "sessionAffinityFormat": "openai-nosession" },
          "thinkingLevelMap": {
            "off": null, "minimal": "minimal", "low": "low",
            "medium": "medium", "high": "high", "xhigh": "xhigh", "max": null
          }
        }
      ]
    }
  }
}
  • baseUrl 指向你的中转 /v1
  • apiKey 填该 muse 分组绑定的令牌(不要提交真实 key,用占位符)
  • api: openai-responses 与官方 https://opencode.ai/zen/go/v1 一致

完整示例(与 xai/openai 共存):

{
  "providers": {
    "openai": { "baseUrl": "http://YOUR_SUB2API_HOST:8080/v1" },
    "xai": {
      "baseUrl": "http://YOUR_SUB2API_HOST:8080/v1",
      "models": [{ "id": "grok-4.6", "api": "openai-responses", "reasoning": true }]
    },
    "muse": { ...同上... }
  }
}

2. settings.json 启用

~/.pi/agent/settings.json

{
  "enabledModels": [
    "xai/grok-4.6",
    "openai/gpt-5.6-*",
    "muse/muse-spark-1.2-contributor"
  ]
}

保存后重开 /model 即可选 muse/muse-spark-1.2-contributor,无需重启 pi。

3. 验证

# 列表
curl -s http://YOUR_SUB2API_HOST:8080/v1/models \
  -H "Authorization: Bearer YOUR_MUSE_TOKEN" | jq .

# 推理(pi 实际走 openai-responses)
curl -s http://YOUR_SUB2API_HOST:8080/v1/responses \
  -H "Authorization: Bearer YOUR_MUSE_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"model":"muse-spark-1.2-contributor","input":[{"role":"user","content":[{"type":"input_text","text":"ping"}]}]}' | jq .

预期 status: completed / text: pong


占位符 YOUR_* 需替换为真实中转地址与令牌,切勿公开 sk-...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment