跳到正文
ZeroClaw

个人与自主智能体

在 ZeroClaw 中使用 Shannon

在 ZeroClaw 的 config.toml 中将 Shannon 添加为自定义提供商槽位,为智能体指定该槽位和一个风险配置,然后运行。

  • 测试于 2026年11月7日
  • OpenAI Chat Completions
  • 约 4 分钟

关于 ZeroClaw

ZeroClaw 是用 Rust 编写的小型快速智能体运行时,智能体可绑定聊天渠道,并带有网关、定时任务和各智能体独立的风险配置。提供商是 config.toml 中的命名槽位;custom 槽位接受任何兼容 OpenAI 的端点,因此智能体可以运行在 Shannon 模型上。

你需要准备

Shannon API 密钥
密钥与用量
基础 URL
https://api.shannon-ai.com/v1 端点: /v1/chat/completions
下面的所有代码示例都会随你的选择而变化。

设置步骤

  1. 描述 Shannon 和一个智能体

    编写 ~/.zeroclaw/config.toml。提供商槽位本身不起作用:智能体通过 custom.<alias> 引用它,并且每个智能体都需要一个存在的 risk_profile。请使用你的版本所需的 schema_version(zeroclaw config migrate --json 会报告它);0.8.7 读取版本 3。

    ~/.zeroclaw/config.toml
    schema_version = 3
    
    [providers.models.custom.shannon]
    uri            = "https://api.shannon-ai.com/v1"
    model          = "Kimi-K3-uncensored-NVFP4"
    context_window = 1022976
    max_tokens     = 262144
    
    [agents.main]
    model_provider = "custom.shannon"
    risk_profile   = "trusted"
    
    [risk_profiles.trusted]
    level          = "full"
    workspace_only = true
  2. 传入密钥并运行智能体

    该变量在启动时设置 providers.models.custom.shannon.api_key,因此密钥不会出现在文件中。

    Shell
    export ZEROCLAW_providers__models__custom__shannon__api_key=YOUR_API_KEY
    zeroclaw agent -a main -m "Create a file hello.txt that says: the brown dog digs."
    终端中的 ZeroClaw 0.8.7:自定义 Shannon 槽位上的智能体 main 写入 hello.txt 并报告
    使用上述配置在 ZeroClaw 0.8.7 上的真实运行:一次工具调用,两次请求。

检查是否正常工作

发送: 你好!你是哪个模型?

你应该看到: 通过智能体 main 收到来自 Shannon 模型的回复。

适合 ZeroClaw 的模型

下面的每个 id 都满足 ZeroClaw 的要求。第一个是代码示例中的默认值。

模型 id上下文窗口最大输出图像输入
Kimi-K3-uncensored-NVFP4 1,022,976 262,144 是
Kimi-K3.1-Pro-uncensored-NVFP4 1,022,976 262,144 是
MiMo-V2.6-Pro-uncensored-NVFP4 1,022,976 131,072 是
Kimi-K3-uncensored-3BIT-REAP 225,280 225,280 是
shannon-3 196,608 65,536 是

模型设置

ZeroClaw 会要求填写这些值。它们取决于你选择的模型。

设置项值原因
context_window 1022976 模型的窗口大小,用于 ZeroClaw 的本地预算。
max_tokens 262144 最长的回答。

须知

  • main 分支上的文档显示 schema_version = 4;0.8.7 版本会拒绝它,提示 "config schema_version 4 is newer than this binary supports (3)",然后忽略整个文件。
  • 没有配置 risk_profile 的智能体无法启动:"agents.main.risk_profile does not name a configured risk_profiles entry"。
  • 设置 level = "full" 时,工具无需询问即可运行;使用 supervised 可自行批准中等风险的操作。
  • 请在槽位上设置 context_window。在我们设置它(连同运行时配置中的 max_context_tokens)之前,第二轮会在 ZeroClaw 内部失败,提示 "This request exceeds the selected model's context window",而且不会发出请求。
  • 启动时,ZeroClaw 会调用 GET /v1/models 来预热连接;该请求不会使用模型。

提示

  1. zeroclaw quickstart 以交互方式生成相同的配置,并把密钥存入 ZeroClaw 的机密存储。
  2. 带有 max_tool_iterations 的 [runtime_profiles.<alias>] 块可限制一轮最多可以产生多少次请求。
  3. 将智能体绑定到某个渠道,即可在 Telegram 或 Discord 中使用同一个 Shannon 模型。

故障排查

现象原因解决办法
"config section <entire-config> … is malformed and was reset to defaults" 出现了该版本不认识的 schema 版本或键。 运行 zeroclaw config migrate --json 查看解析错误,然后修正文件。
zeroclaw agent --agent main 未配置 文件没有加载,因此不存在 [agents.main]。 请先修复上面的配置错误。
404 Not Found uri 缺少 /v1。 请使用 https://api.shannon-ai.com/v1。
401 Unauthorized 密钥缺失、输入有误或已被轮换。 从密钥与用量重新复制密钥;它以 sk- 开头。
报错 context_length_exceeded 或 “prompt is too long”(提示词过长) 对话长度超出了模型的上下文窗口。 开启新对话、让工具压缩对话,或选择窗口更大的模型。
insufficient_quota 你的余额不足以支付该请求。 充值或更换计划;该请求不会自动重试。

常见问题

ZeroClaw 能与 Shannon 配合使用吗?

可以,通过 custom 提供商槽位,设置 uri = "https://api.shannon-ai.com/v1"。

不同的智能体可以使用不同的 Shannon 模型吗?

可以:每个模型添加一个槽位,并将每个智能体的 model_provider 指向它的槽位。

选择你的语言

所有语言一视同仁。请选择你想使用的语言。

欧洲

中东和北非

南亚

东南亚

东亚

中亚和高加索

非洲

大洋洲

人造语言和古典语言