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/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/rightnow-ai/automegakernel/amk-megakernel-optimizer"><img src="https://agentmods.dev/badge/agents/rightnow-ai/automegakernel/amk-megakernel-optimizer.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.00062 | $0.01759 |
| Opus 5.5 | $0.00025 | $0.00704 |
| Sonnet 5.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 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.
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.
- 2mo 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 (161 stars, last pushed 1mo ago), licensed MIT. It adds 62 tokens to every session and 1,759 once invoked, about $0.0002 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.
amk-megakernel-optimizer compared with agents from other repositories
| Mod | Type | Stars | Last push | Licence | Scan | Tokens | Works with |
|---|---|---|---|---|---|---|---|
| amk-megakernel-optimizerRightNow-AI/AutoMegaKernel | Agent | 161 | 1mo ago | MIT | A | 62 | Claude Code |
| edge-ai-engineerpjt222/agent-almanac | Agent | 43 | yesterday | MIT | A | 38 | Claude Code |
| kernel-optimizerpjt222/agent-almanac | Agent | 43 | yesterday | MIT | A | 30 | Claude Code |
| google-colab-expertandisab/swe-marketplace | Agent | 21 | yesterday | MIT | A | 282 | Claude Code |
| intel-gpu-ai-skills-agentintel/gpu-ai-skills | Agent | 49 | yesterday | Apache-2.0 | A | 37 | Claude Code |
| iot-data-specialistatretyak1985/swarmery | Agent | 7 | yesterday | Apache-2.0 | A | 20 | Claude Code |
| kpzpunt-labs/vox | Agent | 3 | today | MIT | A | 37 | Claude Code |