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 skills/axera-tech/magnetar/compilenpx skills add AXERA-TECH/Magnetar --skill compilegit clone --depth 1 https://github.com/AXERA-TECH/MagnetarWrote 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/axera-tech/magnetar/compile)<a href="https://agentmods.dev/skills/axera-tech/magnetar/compile"><img src="https://agentmods.dev/badge/skills/axera-tech/magnetar/compile.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 | $0.00024 | $0.00707 |
| Opus 5 | $0.00012 | $0.00353 |
| Sonnet 5 | $0.00005 | $0.00141 |
| Haiku 4.5 | $0.00002 | $0.00071 |
Grade A, and why
compile 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 4d 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.
What it actually says
COMPILE
执行
magnetar.stages.compile.run(task_dir, target_hw, pulsar_image)
关键约束
highest_mix_precision必须为falsecalibration_std用 255(非 0.004)——Pulsar2 用/std公式- 编译前确认 ONNX 为静态 shape
- 校准/输入格式先查
docs/input-format-cheatsheet.md(python magnetar/pulsar2_ref.py --cases),不要试新格式
LLM 分支(model_route=llm)
model_dir = magnetar.stages.llm.llm_build(task_dir, input_path=origin/<model>, chip=TARGET_HARDWARE, pulsar_image=..., max_context=..., prefill_len=..., weight_type=s8|s4, hidden_state_type=bf16)
内部流程:
pulsar2 llm_build2直接编译 HuggingFace 权重 →compile/llm_out/: 逐层*_l%d_*.axmodel+*post*.axmodel+model.embed_tokens.weight.bfloat16.bin, 自带逐层 decode/prefill cosine 校验(日志cos_sim is: X);ensure_axllm_build_tools克隆 ax-llm-build,embed_process.sh处理 embedding;- 组装
compile/llm_model_dir/:config.json(axllm 字段:tokenizer_type、 template_filename_axmodel、axmodel_num、filename_post_axmodel、 filename_tokens_embed、tokens_embed_num/size)+ tokenizer + axmodel + post_config.json + model_meta.json; - 生成
export/model_meta.json(route=llm,compile_cosine 取逐层 cosine 统计: min/mean/all_ge_0_99)与compile/compile_report.md。
失败处理:llm_build2 报架构/head_dim/算子不支持 → 回退 EXPORT 调整参数或拆分, 仍失败 STOP 由用户决定是否回退通用 ONNX 路径;逐层 cosine < 0.99 → 回退 COMPILE 重试(weight_type s8→s4、bf16→fp16、调 max_context/prefill)。
验证
compile/model.axmodel存在且非空compile/compile_report.md含 MACs、大小、压缩比、编译耗时- LLM 分支:
compile/llm_model_dir/含 config.json + tokenizer + 逐层/post axmodel + embedding bin;export/model_meta.jsoncompile_cosine.min ≥ 0.99
STOP
- Pulsar2 编译失败且需改 ONNX → 退回 EXPORT
- 输入预处理配置与导出验证不一致
- LLM 分支:llm_build2 不可用(Pulsar2 < 6.0)→ blocked;不支持架构且用户未定回退方向
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.
- 4d ago First seen · 49 lines · 24 tokens per session scan A d2718486d77f
compile is a skill published in the GitHub repository AXERA-TECH/Magnetar (22 stars, last pushed today), licensed MIT. It adds 24 tokens to every session and 707 once invoked, about $0.0001 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
systematic-debugging
Use when encountering any bug, test failure, or unexpected behavior, before proposing fixes.
brainstorming
You MUST use this before any creative work - creating features, building components, adding functionality, or modifying behavior. Explores user intent, requirements and design before implementation.
auto-perf-optimize
Run agent-driven VS Code performance or memory investigations. Use when asked to launch Code OSS, automate a VS Code scenario, run the Chat memory smoke runner, capture renderer heap snapshots, take workflow screenshots, compare run summaries, or drive a repeatable scenario before heap-snapshot analysis.
chat-perf
Run chat perf benchmarks and memory leak checks against the local dev build or any published VS Code version. Use when investigating chat rendering regressions, validating perf-sensitive changes to chat UI, or checking for memory leaks in the chat response pipeline.
chat-pet-sprite-creation
Use when creating or changing VS Code chat pet sprite art, sprite sheets, state animations, eye treatments, Stable/Insiders variants, or pet transitions under src/vs/workbench/contrib/chat/browser/widget/media/chatPet.
cpu-profile-analysis
Analyze V8/Chrome CPU profiles (.cpuprofile) and DevTools trace files (Trace-.json). Use when: profiling performance, investigating slow functions, comparing code paths, finding bottlenecks, analyzing timeToRequest, understanding call trees from sampling profiler data, analyzing layout/paint/rendering, investigating…