Getting it into your agent
One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.
npx skills add redai-infra/Relax --skill model-integrationgit clone --depth 1 https://github.com/redai-infra/RelaxWrote this? Show the measurements
A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.
[](https://agentmods.dev/skills/redai-infra/relax/model-integration)<a href="https://agentmods.dev/skills/redai-infra/relax/model-integration"><img src="https://agentmods.dev/badge/skills/redai-infra/relax/model-integration.svg" alt="Measured on agentmods" height="20"></a>What it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00076 | $0.03102 |
| Opus 5 | $0.00038 | $0.01551 |
| Sonnet 5 | $0.00015 | $0.00620 |
| Haiku 4.5 | $0.00008 | $0.00310 |
Grade A, and why
model-integration scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 7d ago.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
Nothing flagged
None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.
How it starts
The opening of the file, as written. The whole thing — 247 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Model Integration Guide
Overview
Relax 支持两种训练后端和两种执行模式,新模型接入需根据组合适配不同的模块。
后端 x 模式矩阵
| Colocate (共卡) | Fully-Async (全异步) | |
|---|---|---|
| Megatron | Bridge 自动转换;Actor/Rollout 时分共享 GPU | Bridge 或 raw 转换;独立 GPU 集群,DCS 权重同步 |
| FSDP | HF 原生权重名,DTensor 自动 redistribute | 暂不支持 |
决策树
新模型接入
├─ Megatron 后端?
│ ├─ Bridge 支持? → [快速路径] 仅需 Step 1-2
│ └─ Bridge 不支持 → [完整路径] Step 1-5
└─ FSDP 后端? → [FSDP 路径] Step 6
Megatron Backend
权重同步 Pipeline
训练完成后,权重需从 Megatron 内部格式同步到 Rollout 引擎(SGLang):
Training Step Complete
│
├─── [bridge 模式] ─────────────────────┐
│ AutoBridge.export_hf_weights() │
│ 自动处理 Megatron→HF 转换 │
│ ▼
├─── [raw 模式] ────────────────────────┐
│ all_gather_param (common.py) │ TP-sharded → full
│ │ │
│ ▼ │
│ convert_to_hf (__init__.py) │ Megatron name → HF name
│ │ │
│ ▼ │
├────────────┴──────────────────────────┘
│
├─── [共卡] UpdateWeightFromTensor
│ GPU→CPU serialize → Gloo gather → Ray IPC
│
└─── [全异步] UpdateWeightFromDistributed / DeviceDirectBackend
NCCL broadcast / HTTP push
│
▼
chunk_param (checkpoint_engine/utils.py)
full → TP-sharded (逆操作,仅全异步)
共卡 vs 全异步选择逻辑(actor.py:176):
update_weight_cls = UpdateWeightFromTensor if self.args.colocate else UpdateWeightFromDistributed
Step 1: Model Provider (Bridge 模式 — 快速路径)
前提:模型已有 Megatron Bridge 支持。
What ships with it
1 file beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.
What this file has done since we first saw it
Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.
- 7d ago First seen · 247 lines · 76 tokens per session scan A b5db74e984a7
model-integration is a skill published in the GitHub repository redai-infra/Relax (580 stars, last pushed 9d ago), licensed Apache-2.0. It adds 76 tokens to every session and 3,102 once invoked, about $0.0004 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.
Other skills, from other repositories
verl-rl-training
Provides guidance for training LLMs with reinforcement learning using verl (Volcano Engine RL). Use when implementing RLHF, GRPO, PPO, or other RL algorithms for LLM post-training at scale with flexible infrastructure backends.
openrlhf-training
High-performance RLHF framework with Ray+vLLM acceleration. Use for PPO, GRPO, RLOO, DPO training of large models (7B-70B+). Built on Ray, vLLM, ZeRO-3. 2× faster than DeepSpeedChat with distributed architecture and GPU resource sharing.
verl-rl-training
Provides guidance for training LLMs with reinforcement learning using verl (Volcano Engine RL). Use when implementing RLHF, GRPO, PPO, or other RL algorithms for LLM post-training at scale with flexible infrastructure backends.
openrlhf-training
High-performance RLHF framework with Ray+vLLM acceleration. Use for PPO, GRPO, RLOO, DPO training of large models (7B-70B+). Built on Ray, vLLM, ZeRO-3. 2× faster than DeepSpeedChat with distributed architecture and GPU resource sharing.
verl-rl-training
Provides guidance for training LLMs with reinforcement learning using verl (Volcano Engine RL). Use when implementing RLHF, GRPO, PPO, or other RL algorithms for LLM post-training at scale with flexible infrastructure backends.
openrlhf-training
High-performance RLHF framework with Ray+vLLM acceleration. Use for PPO, GRPO, RLOO, DPO training of large models (7B-70B+). Built on Ray, vLLM, ZeRO-3. 2× faster than DeepSpeedChat with distributed architecture and GPU resource sharing.