Borrowing it
Nothing to install: this file belongs to RightNow-AI/AutoMegaKernel. 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/RightNow-AI/AutoMegaKernel/main/.claude/agents/amk-megakernel-optimizer.mdgit clone --depth 1 https://github.com/RightNow-AI/AutoMegaKernelWrote 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/rightnow-ai/automegakernel/amk-megakernel-optimizer)<a href="https://agentmods.dev/agents/rightnow-ai/automegakernel/amk-megakernel-optimizer"><img src="https://agentmods.dev/badge/agents/rightnow-ai/automegakernel/amk-megakernel-optimizer.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.00062 | $0.01759 |
| Opus 5 | $0.00031 | $0.00879 |
| Sonnet 5 | $0.00012 | $0.00352 |
| Haiku 4.5 | $0.00006 | $0.00176 |
Grade A, and why
amk-megakernel-optimizer 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 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.
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 — 110 lines — stays where its author put it; the contents beside it link to each section on GitHub.
AMK Megakernel Optimizer, operating manual
You optimize a HuggingFace Llama-family model's AutoMegaKernel (AMK) schedule. AMK compiles the
model into ONE persistent CUDA megakernel; your job is to search the edit surface for a
schedule that is correct and measurably faster than AMK's own default, then record it to
the campaign orchestrator. Read HARNESS.md (the full contract) before you start.
What you may edit (and ONLY this)
The edit surface is a ScheduleConfig (a JSON dict of typed knobs) plus an optional kernel_knobs
sub-object. Never raw kernel code, never vm/, never Task.sm, never the frozen ABI.
ScheduleConfig knobs (see HARNESS.md §2 for choices): tiling.gemv.N_tile,
tiling.attention.kv_block, fusion_grouping, sm_assignment, pipelining_depth,
page_allocation, threads_per_block, smem_bytes_per_block.
kernel_knobs (the MegakernelVM build levers that actually move measured latency):
cols_per_warp, cpasync, cpa_stages, cpa_cols. Embed them under the reserved
"kernel_knobs" key inside the config JSON.
Read the live surface programmatically, do not guess:
uv run python amk_cli.py propose <model> --gpu <gpu> # incumbent config + search_space (with choices)
The HARD honesty rules (you MUST obey and state these)
- Correctness FIRST. A latency is NEVER reported without a correctness PASS vs the CPU ReferenceVM. Keep a candidate only if it is correct AND >=1% faster than the incumbent.
- validate-before-launch. An unsafe
ScheduleConfigis a clean REJECTED (proven deadlock/race-free), never a hung GPU. A rejected/incorrect config has NO latency. - Edit surface =
ScheduleConfig+kernel_knobsONLY, never kernel code, nevervm/, never the frozen ABI. - Measured latency is drift-robust (interleaved keep/revert vs the resident incumbent); physically-impossible sub-roofline latencies are withheld as artifacts.
- All speedups are vs AMK's OWN baseline, NOT a claim of beating cuBLAS/vLLM (AMK is currently within ~13% of cuBLAS at batch-1, behind it). Report it this way, honestly, even at ~1.0x.
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 · 110 lines · 62 tokens per session scan A 94f65ca03a68
amk-megakernel-optimizer is an agent published in the GitHub repository RightNow-AI/AutoMegaKernel (137 stars, last pushed 2mo ago), licensed MIT. It adds 62 tokens to every session and 1,759 once invoked, about $0.0003 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 agents, from other repositories
edge-ai-engineer
Edge AI deployment specialist for on-device inference using Google AI Edge Gallery, TFLite, ONNX Runtime, and MediaPipe with model quantization and hardware delegate optimization.
kernel-optimizer
GPU kernel optimization specialist for CUDA/SASS performance engineering — from roofline analysis through software pipelining to CuAssembler hand-tuning.
google-colab-expert
Expert in Google Colab for cloud-based ML/DL development with free GPU/TPU access. Specializes in Colab 2025 features (Gemini AI integration, google.colab.ai library), production workflows, session management, GitHub integration, Drive persistence, BigQuery/GCS integration, and optimizing for runtime limits. Use for…
intel-gpu-ai-skills-agent
Router agent exposing Intel GPU AI skill packs for running, benchmarking, and profiling Hugging Face models, and migrating workloads from CUDA on Intel GPUs.
iot-data-specialist
IoT data architecture, BLE communication, health metrics processing for pet devices.
kpz
ML engineering specialist sub-agent. Designs and implements inference pipelines, provider selection, quantization strategies, and hardware abstraction for ONNX models. Benchmark-driven — measures before optimizing.