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.
Borrowing it
Nothing to install: this file belongs to areal-project/AReaL. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.
curl -O https://raw.githubusercontent.com/areal-project/AReaL/main/.claude/agents/megatron-engine-expert.mdgit 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/github.svg" alt="Measured on agentmods" height="20"></a>Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.
<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="Reviewed on agentmods" width="80" 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.5 | $0.00014 | $0.01056 |
| Sonnet 5.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 2mo 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 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.
- 2mo 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,888 stars, last pushed today), licensed Apache-2.0. It adds 35 tokens to every session and 2,640 once invoked, about $0.0001 per session on Opus 5.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
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.
Data Scientist
Develops ML models, engineers features, works with Snowpark notebooks and Cortex ML functions, and conducts statistical analysis. Invoke with $ds.
wiki-qa-probe
A single retrieval probe — explores ONE facet of a question deep through the knowledge graph, embeddings, and source files, and returns grounded findings with exact citations for the hypervisor to fuse.
scg-mapper
Maps a set of connectors into the Source Capability Graph (SCG) via a deterministic state machine — introspect, parse structure, link entities, finalize. Indexes reachability only, never the data behind it.
mlops-engineer
Build ML pipelines, experiment tracking, and model registries. Implements MLflow, Kubeflow, and automated retraining. Handles data versioning and reproducibility. Use PROACTIVELY for ML infrastructure, experiment management, or pipeline automation.
data-scientist
Data analysis expert for SQL queries, BigQuery operations, and data insights. Use proactively for data analysis tasks and queries.