agentleFS
michaelnealemichaelneale/mesh-llm/.agents/skills/benchmark-tune/SKILL.md

benchmark-tune

Skill3.8k starsChanged 20 days agoApache-2.0View on GitHub

Use this skill when running, debugging, interpreting, or documenting mesh-llm benchmark tune model-serving throughput trials, including choosing ctx/batch/ubatch/mmap/mlock/speculative-decoding sweeps, running benchmark tune on local or SSH hosts, collecting JSON evidence, and applying tolerance-aware recommendations. Trigger for requests mentioning benchmark tune, tuning tok/s, ctx_size tradeoffs, mmap or mlock tuning, speculative decoding, MTP, ngram, draft models, or replacing old gpu tune usage.

We split this skill into the rules it gives an agent

18 rules. About 0 are common, 6 are distinctive, and 12 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈6

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 12

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Use mesh-llm benchmark tune for model-serving throughput tuning.

    line 8
  2. Distinctive:

    Verify the command surface from the current checkout before long runs:

    line 15
  3. Very specific:

    If the run is on a remote node over SSH and will take time, use the remote-observable-process skill.

    line 37
  4. Distinctive:

    Start with a bounded sweep, then expand around promising values:

    line 57
  5. Very specific:

    If --mmap-values is omitted, tune tries auto, true, and false.

    line 79
  6. Very specific:

    If --mlock-values is omitted, tune tries false and only tries true when the current mlock probe says the evaluated budget can be locked.

    line 80
  7. Very specific:

    If --speculative-types is omitted, tune uses auto: it tries mtp first when the model target looks like an MTP model, tries discovered local …

    line 82
  8. Very specific:

    Use --no-speculative-tune when you need to reproduce the older fit-only/disabled-speculation behavior or isolate non-speculative …

    line 86
  9. Very specific:

    Use --speculative-types mtp,draft,ngram,disabled to force an explicit speculative sweep.

    line 88
  10. Very specific:

    Use longer --max-tokens when decode throughput is noisy.

    line 95
  11. Very specific:

    Keep --throughput-tolerance-pct near the default 10 unless the user asks for stricter raw throughput optimization.

    line 97
  12. Very specific:

    Add --debug-telemetry when you need proof that speculative decoding is actually active.

    line 99
  13. Distinctive:

    Call out tradeoffs explicitly:

    line 137
  14. Distinctive:

    If raw best and recommended differ, explain the tok/s delta and context gain.

    line 139
  15. Very specific:

    If mmap or mlock changes the winner, report those controls separately.

    line 140
  16. Very specific:

    If speculative decoding changes the winner, report both tok/s and the active speculative candidate.

    line 141
  17. Distinctive:

    If all trials fail, summarize the shared failure reason and link the trial log paths rather than claiming no viable configuration exists.

    line 146
  18. Distinctive:

    If results are close, avoid overfitting decimals.

    line 148

≈ “Common” is an estimate: at least 1 in 5 of the 308,232 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Benchmark Tune

Use mesh-llm benchmark tune for model-serving throughput tuning. Do not use mesh-llm gpu tune or mesh-llm gpus tune; the GPU namespace is for hardware inventory and raw fingerprinting (mesh-llm gpus, mesh-llm gpus detect, and hidden gpus run-benchmark).

Preflight

Verify the command surface from the current checkout before long runs:

target/release/mesh-llm benchmark --help
target/release/mesh-llm benchmark tune --help
target/release/mesh-llm gpus --help

For performance work, use a release build on the target host:

just release-build

On NVIDIA remote hosts, verify that the selected CUDA native runtime is actually in use before recording performance results. For Jetson/Orin-style aarch64 CUDA hosts, build the normal backend-neutral product with a CUDA runtime, for example just build backend=cuda cuda_arch=87, with the CUDA toolkit paths exported as needed. The host itself must remain backend-neutral; a generic CPU runtime is not valid performance evidence for GPU tune work. Confirm mesh-llm runtime list selects the intended CUDA runtime before benchmarking.

If the run is on a remote node over SSH and will take time, use the remote-observable-process skill. Prefer a TTY/login shell and tee logs over detached first attempts.

Targets

Benchmark tune accepts already-downloaded local/configured model targets only. It will not fetch remote-only refs. If no explicit target is passed, it uses configured local models from ~/.mesh-llm/config.toml.

Use one of:

mesh-llm benchmark tune --model /models/model.gguf
mesh-llm benchmark tune --models /models/a.gguf,/models/b.gguf
mesh-llm benchmark tune

Candidate Sweep

Start with a bounded sweep, then expand around promising values:

mesh-llm benchmark tune \
  --model /models/model.gguf \
  --ctx-sizes 8192,32768,131072,262144 \
  --batch-sizes 512,1024,2048 \
  --ubatch-sizes 256,512,1024 \
  --mmap-values auto,true,false \
  --mlock-values false,true \
  --speculative-types auto \
  --throughput-tolerance-pct 10 \
  --max-tokens 128 \
  --debug-telemetry \
  --json

Rules:

  • ubatch must be less than or equal to batch; invalid pairs are skipped.
  • mmap and mlock are separate controls. Sweep them independently when diagnosing load/runtime behavior.
  • If --mmap-values is omitted, tune tries auto, true, and false.
  • If --mlock-values is omitted, tune tries false and only tries true when the current mlock probe says the evaluated budget can be locked.
  • If --speculative-types is omitted, tune uses auto: it tries mtp first when the model target looks like an MTP model, tries discovered local draft-model candidates when available, tries ngram candidates as a model-free fallback, then includes a disabled baseline.
  • Use --no-speculative-tune when you need to reproduce the older fit-only/disabled-speculation behavior or isolate non-speculative regressions.
  • Use --speculative-types mtp,draft,ngram,disabled to force an explicit speculative sweep. draft requires either --spec-draft-models, a configured draft_model_path, or a local sibling GGUF whose filename looks like a draft/EAGLE model for the target.
  • MTP and draft sweeps use --spec-draft-max-tokens and --spec-draft-min-tokens. Ngram sweeps use --spec-ngram-min and --spec-ngram-max.
  • Use longer --max-tokens when decode throughput is noisy; use shorter values only for smoke checks.
  • Keep --throughput-tolerance-pct near the default 10 unless the user asks for stricter raw throughput optimization.
  • Add --debug-telemetry when you need proof that speculative decoding is actually active. It runs trial children with Skippy debug telemetry mirrored into target/gpu-tune/.../serve.log.

Evidence

Capture machine-readable output and trial logs:

mkdir -p target/benchmark-tune
mesh-llm benchmark tune ... --json \
  | tee target/benchmark-tune/$(hostname)-$(date +%Y%m%d-%H%M%S).json

For remote hosts, include host, branch, commit, binary path, command, and output path in the final report. Benchmark tune keeps per-trial logs under target/gpu-tune/; inspect those logs when a trial fails or startup readiness is slow.

Useful JSON fields:

  • benchmarks[].best: tolerance-aware recommendation.
  • benchmarks[].raw_best: highest observed decode tok/s.
  • benchmarks[].pareto_frontier: tradeoff set for decode tok/s vs ctx_size.
  • benchmarks[].trials[].decode_tok_s: measured decode throughput.
  • benchmarks[].trials[].candidate.speculative: speculative mode and settings used for that isolated trial.
  • benchmarks[].trials[].timings: lifecycle timing stats: setup_ms, readiness_ms, request_ms, shutdown_ms, total_ms, and readiness_attempts.
  • benchmarks[].trials[].error and log_path: first stop for failures.

Interpretation

Report both raw best and recommended settings. The recommendation is tolerance-aware: candidates within --throughput-tolerance-pct of raw best are treated as throughput-equivalent, then larger ctx_size is preferred.

Call out tradeoffs explicitly:

  • If raw best and recommended differ, explain the tok/s delta and context gain.
  • If mmap or mlock changes the winner, report those controls separately.
  • If speculative decoding changes the winner, report both tok/s and the active speculative candidate. For MTP, inspect trial logs/telemetry for llama_stage.native_mtp.enabled, drafted/accepted/rejected counts, and accept rate before concluding it is helping. Use --debug-telemetry if those attributes are not present in the trial log.
  • If all trials fail, summarize the shared failure reason and link the trial log paths rather than claiming no viable configuration exists.
  • If results are close, avoid overfitting decimals; prefer the setting with the better context or operational posture.

Download now (ZIP)

Trending

Steady: 0 new projects took it in the last 4 weeks, none the 4 weeks before.thin data

Week of Aug 30: 0 new projectsWeek of Sep 6: 0 new projectsWeek of Sep 13: 0 new projectsWeek of Sep 20: 0 new projectsWeek of Sep 27: 0 new projectsWeek of Oct 4: 0 new projectsWeek of Oct 11: 0 new projectsWeek of Oct 18: 0 new projects
Aug 2026Sep 2026Oct 2026
New projects taking a version of this file each week, over the 8 weeks our latest run read: only 0 in all, so this is a hint, not a trend.

Who's talking about michaelneale/mesh-llm

The biggest 5 of 18 mentions linking to the repository that our crawl found. Each line is their own headline.

See all 18

Talked about on GitHub, Bluesky and Hacker News (18 times).

On GitHub · 15

10 more on GitHub

On Hacker News · 1

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.