NVIDIA Model Config Skill
Overview
This skill packages three reusable pieces:
- 1. A script (
scripts/merge_nvidia_config.py) that inserts the NVIDIA provider block into any openclaw.json file and configures apiKey as a SecretRef by default. - Model entries for Mixtral, Moonshot Kimi, Kimi K2.5, Nemotron Super (1M ctx), Llama 3.1 Nemotron Ultra 253B (128K ctx), and MiniMax M2.5 (204.8K ctx) — delete extras or add more from
openclaw models list --provider nvidia --all. - Instructions for backups, secrets, and where
NVIDIA_API_KEY must be set so the gateway can resolve it (this is not only openclaw.json).
Use the skill whenever you want to replicate the NVIDIA models.providers.nvidia entry without guessing which keys or nested objects to copy.
Quick start
- 1. Copy or download this skill (e.g.,
rsync -av skills/nvidia-model-config /path/to/other/workspace/skills/). - Obtain your NVIDIA API key and keep it secret (do not commit it).
- Run the script from the target workspace:
CODEBLOCK0
- -
--config defaults to openclaw.json in the current directory. - INLINECODE10 provides the API key (alternatively, set
NVIDIA_API_KEY in your shell). - INLINECODE12 writes the key to a dedicated environment file (e.g.,
~/.config/openclaw/gateway.env). - INLINECODE14 creates a systemd user override to load the environment file for the gateway.
- INLINECODE15 saves the original file as
openclaw.json.bak before overwriting. - By default, the script writes
models.providers.nvidia.apiKey as:
- INLINECODE18
Manual Environment Setup
If you prefer not to use --setup-systemd, you must set your key in the runtime environment where the OpenClaw gateway runs.
Interactive shell / CLI only (e.g. testing openclaw in a terminal):
CODEBLOCK1
Gateway under systemd (typical on Linux) — the service does not read ~/.bashrc. Put the key in a file the unit loads, for example:
- - File:
~/.config/openclaw/gateway.env (mode 600):
CODEBLOCK2
- - User unit drop-in
~/.config/systemd/user/openclaw-gateway.service.d/override.conf:
CODEBLOCK3
The empty Environment=NVIDIA_API_KEY= clears any inherited value so EnvironmentFile is the single source of truth. Then:
CODEBLOCK4
You can also keep a personal ~/.config/openclaw/secrets.env and source it from ~/.bashrc for CLI-only use; that does not replace the gateway env above.
If you want to preview the changes before writing, add --dry-run and capture the printed JSON.
What the script does
- 1. Removes legacy plaintext copies of
NVIDIA_API_KEY from config (env.vars.* and env.*) when present. - Creates or updates the
models.providers.nvidia block with bundled NVIDIA models (Nemotron Super 1M ctx, Nemotron Ultra 253B ~128K ctx, MiniMax M2.5 ~204.8K ctx, plus Mixtral/Kimi entries). NVIDIA may return 403 if your key is not entitled to a model; pick a model that matches your account and catalog. - Keeps the
api/baseUrl values in sync with NVIDIA’s integrate.api.nvidia.com endpoint. - Supports an explicit legacy mode when needed:
CODEBLOCK5
Use --inline-key only for short-lived local tests.
Optional adjustments
- - Set default model with
openclaw models set nvidia/<model-id> (full id is nvidia/ + provider model id, e.g. nvidia/nvidia/nemotron-3-super-120b-a12b when the provider entry id is nvidia/nemotron-3-super-120b-a12b). - If the target install manages agent defaults manually, add fallback entries under
agents.defaults.model.fallbacks so clients can recover if the primary model fails. - Double-check other agents’
models lists if they need aliases.
Distribution tips
- 1. Bundle this skill directory and any instructions or scripts you use into a
.zip/.skill file to share with teammates. - In your documentation, point operators to this SKILL so Codex can reload it and the script automatically when they ask to “add NVIDIA models.”
- Keep real API keys outside of Git. Use environment variables or SecretManagers and rely on the script to merge them at runtime.
NVIDIA 模型配置技能
概述
本技能包含三个可复用组件:
- 1. 一个脚本(scripts/mergenvidiaconfig.py),用于将 NVIDIA 提供商块插入任何 openclaw.json 文件,并默认将 apiKey 配置为 SecretRef。
- 模型条目,涵盖 Mixtral、Moonshot Kimi、Kimi K2.5、Nemotron Super(100万上下文)、Llama 3.1 Nemotron Ultra 253B(12.8万上下文)和 MiniMax M2.5(20.48万上下文)——可删除多余条目或通过 openclaw models list --provider nvidia --all 添加更多模型。
- 操作说明,涉及备份、密钥管理以及 必须设置 NVIDIAAPIKEY 的位置,以便网关能够解析该密钥(这不仅限于 openclaw.json)。
当您需要复制 NVIDIA 的 models.providers.nvidia 条目,而无需猜测需要复制哪些键或嵌套对象时,请使用本技能。
快速开始
- 1. 复制或下载本技能(例如:rsync -av skills/nvidia-model-config /path/to/other/workspace/skills/)。
- 获取您的 NVIDIA API 密钥并保密(不要提交到版本控制)。
- 在目标工作区运行脚本:
bash
python skills/nvidia-model-config/scripts/mergenvidiaconfig.py \
--config openclaw.json --key YOUR_KEY --setup-env ~/.config/openclaw/gateway.env --setup-systemd --backup
- - --config 默认为当前目录下的 openclaw.json。
- --key 提供 API 密钥(或者,在 shell 中设置 NVIDIAAPIKEY)。
- --setup-env 将密钥写入专用环境文件(例如 ~/.config/openclaw/gateway.env)。
- --setup-systemd 创建 systemd 用户覆盖配置,以便为网关加载环境文件。
- --backup 在覆盖前将原文件保存为 openclaw.json.bak。
- 默认情况下,脚本将 models.providers.nvidia.apiKey 写入为:
- {source:env,provider:default,id:NVIDIA
APIKEY}
手动环境设置
如果您不想使用 --setup-systemd,则必须在 OpenClaw 网关运行的运行时环境中设置您的密钥。
仅交互式 Shell / CLI(例如在终端中测试 openclaw):
bash
export NVIDIAAPIKEY=$YOUR_KEY
systemd 下的网关(Linux 典型情况)——该服务不会读取 ~/.bashrc。请将密钥放入单元加载的文件中,例如:
- - 文件:~/.config/openclaw/gateway.env(权限 600):
bash
NVIDIAAPIKEY=yourkeyhere
- - 用户单元覆盖配置 ~/.config/systemd/user/openclaw-gateway.service.d/override.conf:
ini
[Service]
Environment=NVIDIAAPIKEY=
EnvironmentFile=-/home/YOUR_USER/.config/openclaw/gateway.env
空的 Environment=NVIDIAAPIKEY= 会清除任何继承的值,使 EnvironmentFile 成为唯一的数据源。然后:
bash
systemctl --user daemon-reload
systemctl --user restart openclaw-gateway.service
您也可以保留个人 ~/.config/openclaw/secrets.env 并从 ~/.bashrc 中 source 它,仅用于 CLI 使用;这不能替代上述网关环境。
如果希望在写入前预览更改,请添加 --dry-run 并捕获打印的 JSON。
脚本功能
- 1. 移除配置中遗留的明文 NVIDIAAPIKEY 副本(env.vars. 和 env.)。
- 创建或更新 models.providers.nvidia 块,包含捆绑的 NVIDIA 模型(Nemotron Super 100万上下文、Nemotron Ultra 253B ~12.8万上下文、MiniMax M2.5 ~20.48万上下文,以及 Mixtral/Kimi 条目)。如果您的密钥无权访问某个模型,NVIDIA 可能返回 403;请选择与您的账户和目录匹配的模型。
- 保持 api/baseUrl 值与 NVIDIA 的 integrate.api.nvidia.com 端点同步。
- 在需要时支持显式的旧版模式:
bash
NVIDIAAPIKEY=$YOUR_KEY \
python skills/nvidia-model-config/scripts/mergenvidiaconfig.py \
--config openclaw.json --inline-key
仅对短期本地测试使用 --inline-key。
可选调整
- - 使用 openclaw models set nvidia/ 设置默认模型(完整 ID 为 nvidia/ + 提供商模型 ID,例如当提供商条目 ID 为 nvidia/nemotron-3-super-120b-a12b 时,使用 nvidia/nvidia/nemotron-3-super-120b-a12b)。
- 如果目标安装手动管理代理默认值,请在 agents.defaults.model.fallbacks 下添加回退条目,以便在主模型失败时客户端能够恢复。
- 如果其他代理需要别名,请仔细检查它们的 models 列表。
分发提示
- 1. 将本技能目录以及您使用的任何说明或脚本打包成 .zip/.skill 文件,以便与团队成员共享。
- 在文档中,向操作员指明此 SKILL,以便当要求“添加 NVIDIA 模型”时,Codex 可以重新加载它和脚本。
- 将真实的 API 密钥保留在 Git 之外。使用环境变量或 SecretManager,并依赖脚本在运行时合并它们。