Magnetar: Skill for Codex

.codex/skills/magnetar/hidden/export/SKILL.md

export is a skill for Codex from AXERA-TECH/Magnetar. It costs 35 tokens per session (735 once invoked), scanned A, original, MIT.

A workflow stage for exporting a machine-learning model into a deployable format and checking that it still matches the original.

In plain words
What is it for?
Building static-shape ONNX files, validating them with ONNX Runtime, preparing language-model builds and tokenizers, and generating calibration data.
Why use it?
It creates the required model metadata and validation evidence while handling regular models, language models, and combined models differently.

Skill for Codex

Written for Codex: installed under .codex/.

This is AXERA-TECH/Magnetar's own configuration. It tells Codex how to work on Magnetar itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything Magnetar configures →

Reuse

Borrowing it

Nothing to install: this file belongs to AXERA-TECH/Magnetar. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.

Copy the file
curl -O https://raw.githubusercontent.com/AXERA-TECH/Magnetar/main/.codex/skills/magnetar/hidden/export/SKILL.md
Clone the repo
git clone --depth 1 https://github.com/AXERA-TECH/Magnetar

Made for: Codex.

Wrote 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.

agentmods badge for export

README.md
[![agentmods](https://agentmods.dev/badge/skills/axera-tech/magnetar/export/github.svg)](https://agentmods.dev/skills/axera-tech/magnetar/export)
Your own site
<a href="https://agentmods.dev/skills/axera-tech/magnetar/export"><img src="https://agentmods.dev/badge/skills/axera-tech/magnetar/export/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.

agentmods 80×15 button for export

Your own site · 80×15
<a href="https://agentmods.dev/skills/axera-tech/magnetar/export"><img src="https://agentmods.dev/badge/skills/axera-tech/magnetar/export.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 35 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 735 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe. Third-party audits
  • NVIDIA SkillSpector pass 7 Sept 2026
How audits are shown
Origin original No closer match found in the catalogue.
Token cost

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.

ModelPer sessionOnce invoked
Fable 5.1 $0.00035 $0.00735
Opus 5.5 $0.00014 $0.00294
Sonnet 5.5 $0.00007 $0.00147
Haiku 4.5 $0.00003 $0.00073

Measured 1mo ago against content hash a429ff6f5251, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

export 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 1mo 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.

.codex/skills/magnetar/hidden/export/SKILL.md · 46 lines

What it actually says

EXPORT

执行

MobileNet 可直接调用 sample = magnetar.stages.export.run_mobilenet(task_dir)。 其他模型需 Agent 自行实现:导出静态 ONNX → onnx.checker 验证 → ONNX Runtime 与原模型对分(cosine ≥ 0.99)→ 生成 model_meta.json 和校准数据。 校准数据尽量用真实业务数据(run_generic(calibration_data=…) 或 scripts/export_onnx.py --calib-dir); 随机/扰动数据仅兜底,需在 export_report.md 标注来源。

LLM 分支(model_route=llm,自回归/类 LLM 模型)

不导出 ONNX,改为:

  1. 验证 HuggingFace 权重可推理:跑通一次 source 生成(greedy),保存参考输出到 export/llm_reference.txt 或 npy;
  2. 生成可复现 export/llm_build.sh:完整 pulsar2 llm_build2 命令 (--input_path origin/<model> --output_path compile/llm_out --chip <chip> --max_context <LLM_MAX_CONTEXT> --prefill_len ... --weight_type s8|s4 --hidden_state_type bf16,Pulsar2 ≥ 6.0);
  3. 确认 tokenizer:origin 中已有 tokenizer.txt/*_tokenizer.txt 直接用; 没有则按 ax-llm 文档从 HF tokenizer 转换(third_party/tokenizer.axera 工具), 无法生成时 STOP 说明;
  4. 记录模型参数(model_type、num_hidden_layers、hidden_size、vocab_size、 tokenizer_type)到 export_report.md。

hybrid 组合模型(AR-TTS 等):LLM/AR 子模型按本分支准备,非 LLM 子模型 (vocoder/encoder 等)继续走本文件上方的通用 ONNX 导出,拆分开的产物分别记录。

验证

  • export/model.onnx 为静态 shape,onnxruntime 可加载
  • export/model_meta.json 含完整 input/output name/shape/dtype/layout
  • Torch/ONNX cosine ≥ 0.99
  • export/calib_data/input.tar.gz 存在(≥3 组样本)
  • export/export_report.md 标注校准来源(real 业务数据 / perturbed 兜底)
  • LLM 分支:export/llm_build.sh 存在且命令完整可复制;参考输出已保存; tokenizer 已确认

STOP

  • ONNX 对分失败(cosine < 0.99)
  • 模型含动态 shape 且静态化失败
  • 仅有随机/扰动校准数据且用户未确认(校准集应尽量用真实业务数据,随机数据可能在真实业务上崩)
  • LLM 分支:tokenizer 无法生成;llm_build2 不支持该架构且用户未确认回退方向
Changes

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.

  1. 1mo ago First seen · 46 lines · 35 tokens per session scan A a429ff6f5251

Subscribe to this mod's changes

export is a skill published in the GitHub repository AXERA-TECH/Magnetar (22 stars, last pushed 1mo ago), licensed MIT. It adds 35 tokens to every session and 735 once invoked, about $0.0001 per session on Opus 5.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.

Related

Other skills, from other repositories

spark-training-gotchas

Preflight and diagnose the ten known failure modes for ML training on NVIDIA DGX Spark. Use when a training run on DGX Spark fails to start, OOMs below the 128GB limit, slows down mid-run, or before any multi-hour training job on GB10.

wshobson/agents · 63 tokens

chief-data-officer-advisor

Chief Data Officer advisory for startups: AI training data rights and consent provenance, data product strategy (warehouse vs lakehouse vs mesh, build-vs-buy), B2B customer-data-as-asset valuation and M&A readiness, data team org evolution. Use when deciding whether to train models on customer data, choosing data…

alirezarezvani/claude-skills · 131 tokens

foundry-config-setup

Resolve missing setup caused by a hardcoded Foundry project endpoint or model in a sample. Use when a sample fails because it uses a placeholder/hardcoded projectendpoint (for example "https://your-project.services.ai.azure.com") or a hardcoded model instead of reading them from the environment.

microsoft/agent-framework · 65 tokens

cdf-anomalygen

Use when running the CDF AnomalyGen pipeline over a defect dataset — mask placement, fine-tuning, synthetic defect-image generation (SDG), evaluation, quality refinement, and pseudo-labeling — even when the user names only one stage.

NVIDIA/skills · 54 tokens

cdf-event-video-generation

Run the CDF Orchestration Event Video Generation DAG on Kubernetes or OSMO - image-to-video anomaly generation, auto-labeling, and anomaly dataset generation. Select for requests about event video generation, anomaly video generation, image-to-video synthesis, Cosmos3 image2video, anomaly dataset creation…

NVIDIA/skills · 167 tokens

deepstream-sop

Use this skill when building, deploying, evaluating, debugging, or measuring latency for the DeepStream SOP Inference Microservice — a GPU-accelerated FastAPI service that detects whether operators perform assembly-line steps in order via event boundary detection (GEBD) plus VLM classification. Trigger even if the…

NVIDIA/skills · 219 tokens