AReaL is an infrastructure system for training large language models with reinforcement learning, connecting model training to applications built around AI agents. Researchers and developers use it to train reasoning and agentic models through asynchronous workflows, and the catalogue add-ons support working with AReaL.
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 agentmods add agents/areal-project/areal/megatron-engine-expertgit clone --depth 1 https://github.com/areal-project/AReaLWrote 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/agents/areal-project/areal/megatron-engine-expert)<a href="https://agentmods.dev/agents/areal-project/areal/megatron-engine-expert"><img src="https://agentmods.dev/badge/agents/areal-project/areal/megatron-engine-expert.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.00035 | $0.02640 |
| Opus 5 | $0.00017 | $0.01320 |
| Sonnet 5 | $0.00007 | $0.00528 |
| Haiku 4.5 | $0.00003 | $0.00264 |
Grade C, and why
megatron-engine-expert scanned grade C with 1 finding 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 6d 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.
Hidden instructionshighPrompt injection
Directives inside HTML comments, invisible characters or bidirectional overrides are read by the model and not by the person reviewing the file.
<!-- ================================================================================ MAINTAINER GUIDE ================================================================================ Location: .claude/agents/megatron-en Copies of this mod
1 near-identical copy found in the catalogue:
- megatron-expert — 88% identical, 70 lines differ
How it starts
The opening of the file, as written. The whole thing — 314 lines — stays where its author put it; the contents beside it link to each section on GitHub.
MegatronEngine Usage Expert
You are an expert in MegatronEngine usage and integration in AReaL. Focus on configuration, workflows, and integration points rather than implementation details.
When to Activate
Use only for MegatronEngine usage and integration guidance:
MegatronEngineconfiguration and initialization- Pipeline parallel (PP) workflow integration
- Checkpointing and weight synchronization
- Parallel strategy selection and tuning
- Integration with rollout and evaluation workflows
- Performance optimization and troubleshooting
Do NOT use for general distributed training theory or low-level implementation details.
Core Concepts
MegatronEngine provides comprehensive distributed training capabilities through multiple parallelism dimensions. It coordinates TP (tensor), PP (pipeline), DP (data), CP (context), EP (expert), and ETP (expert tensor) parallelism strategies.
Key architectural principles:
- Pipeline Parallelism (PP): Splits model layers across stages for ultra-deep models
- Hybrid Parallelism: Combines multiple parallel dimensions for optimal resource utilization
- Unified Coordination: Manages communication across all parallel groups
Primary Classes
MegatronEngine(areal/engine/megatron_engine.py): Main engine class implementing distributed training coordinationParallelStrategy(areal/api/alloc_mode.py): Configuration dataclass for parallel dimensionsMegatronCheckpointManager(areal/engine/megatron_utils/checkpointer.py): Checkpoint handling for distributed state
Key Methods
Initialization: Initialize MegatronEngine with model, optimizer, parallel strategy, and additional configuration parameters as needed.
Training Operations:
forward()/backward(): Coordinated across all parallel dimensionsstep(): Weight update with gradient synchronizationstate_dict()/load_state_dict(): Distributed checkpoint handling
Configuration
1. Configuration Overview
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.
- 6d ago First seen · 314 lines · 35 tokens per session scan C 31c3b2974e7b
megatron-engine-expert is an agent published in the GitHub repository areal-project/AReaL (5,725 stars, last pushed yesterday), licensed Apache-2.0. It adds 35 tokens to every session and 2,640 once invoked, about $0.0002 per session on Opus 5. A static security scan graded it C with 1 finding (hidden instructions). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.
Other agents, from other repositories
llm_backends
AgentFly supports multiple LLM backends for text generation, each with their own configuration options. This module provides configuration classes for different backend types including vLLM, Verl, and OpenAI-compatible clients. Among them, Verl backend is designed for internal training usage. The Verl backend is the…
sft
Supervised fine-tuning pipeline reference. For config templates and dataset format examples, see getting-started.qmd and dataset-formats/.
fenic-feature-developer
Use this agent when the user requests help implementing new features, operations, expressions, or functionality for the Fenic DataFrame library. This includes:\n\n- Adding new DataFrame operations (e.g., 'add a pivot operation to DataFrame')\n- Creating new logical expressions (e.g., 'implement a regexextract…
Data Scientist
Develops ML models, engineers features, works with Snowpark notebooks and Cortex ML functions, and conducts statistical analysis. Invoke with $ds.
workflow-prompt-writer
Use this agent when writing, reviewing, or debugging LLM prompt files (.prompt). Specializes in Liquid.js template syntax, YAML frontmatter configuration, and Output SDK prompt conventions.
gke-cluster-runner
Launch a single TPU training workload on a GKE cluster via XPK, poll until completion or hang, capture xprof + HLO dumps to GCS, and report structured verdict signals back to the master agent. Stateless one-shot worker — does NOT write wiki pages, decide experiment verdicts, or update the model page. Use for every…