Install
openclaw skills install @orionshaowswmw/edge-cpu-gguf-tunerEvidence-first, offline tuning of llama.cpp GGUF inference on CPU and constrained edge hosts. Inspects CPU topology, renders compatible benchmark plans, optionally runs an explicitly supplied local llama-bench, ranks pp/tg/pg results with variance-aware confidence, verifies output gates, and renders (never executes) a measured command. It does not install llama.cpp, download models, call APIs, or claim universal defaults.
openclaw skills install @orionshaowswmw/edge-cpu-gguf-tunerUse this skill when a user wants to improve llama.cpp GGUF inference on a CPU-only or constrained machine, especially when thread count, batch size, flash attention, KV-cache type, context depth, model compatibility, or token-generation throughput is in question.
This is an evidence-first local measurement workflow, not a collection of universal tuning folklore. The old registry artifact contained results from one 2-vCPU/2-GB environment; those numbers are not defaults here. A recommendation is valid only for the exact host, model, llama.cpp binary/build, benchmark metric, and conditions recorded in its report.
llama-bench executable and a local .gguf path. Do not search for or select a model implicitly.python3 scripts/edge_cpu_tuner.py; the runner invokes an argument vector with shell=False, a reduced environment, stdin closed, and a timeout. Never paste model paths into a shell command unquoted.-h output before using a rendered command. Current upstream documentation uses llama cli; other builds expose llama-cli or legacy llama-completion. Never assert that one name works everywhere.From the installed skill directory:
# 1. Read-only host and binary discovery
sh bin/edge-cpu-tuner inspect --json
# 2. Offline plan; no executable or model is opened
sh bin/edge-cpu-tuner plan --sweep all \
--model /path/to/model.gguf --binary /path/to/llama-bench --json
# 3. Explicit local measurement; choose one metric and keep reports
sh bin/edge-cpu-tuner bench \
--model /path/to/model.gguf \
--binary /path/to/llama-bench \
--sweep threads --repetitions 3 --metric tg \
--out reports/threads.json --json
# 4. Re-rank an existing report without rerunning inference
sh bin/edge-cpu-tuner recommend --report reports/threads.json --metric tg --json
# 5. Render a candidate command; this never launches inference
sh bin/edge-cpu-tuner deploy --report reports/threads.json \
--cli /path/to/llama-cli --prompt 'short user prompt' --tokens 128 --json
Run separate bench invocations for threads, batch, flash, kv, and context when attributing causality. all is convenient but still emits separate configurations; it is not permission to compare unrelated changes. Use --keep-going only when partial failures are useful. --allowed-root can require the model to be below a chosen directory.
The runner's current benchmark argv uses documented llama-bench options: -m, -p, -n, -t, -b, -ub, -fa, -ctk, -ctv, -d, -r, and -o json. If the exact binary rejects an option, stop and inspect its help or use a compatible binary; do not silently fall back to a guessed flag.
tg for decode/token-generation throughput, pp for prompt processing, or pg for prompt-plus-generation. Do not call one metric “overall speed.”llama-bench reports average and standard-deviation tokens/sec, and its timings exclude tokenization and sampling. Explain this whenever a user asks about end-to-end latency.winner, provisional_winner, no_clear_winner, or single_observation; low confidence means “keep the baseline or rerun,” not “guess.”deploy emits a command object with executed: false, the selected argv, a shell-rendered preview, and warnings. It does not alter files or launch the model. Confirm the exact CLI's help first, then run it yourself if desired.
For a deterministic output check, capture the baseline and candidate outputs using the exact same prompt, model, seed/temperature settings supported by that CLI, and token limit. Compare them locally:
sh bin/edge-cpu-tuner verify-output \
--baseline /tmp/baseline.txt --candidate /tmp/candidate.txt \
--mode bytes --json
identical: false means reject the candidate for an identity-gated change; it does not prove which output is semantically better. A byte-identical output is not a proof of correctness, safety, or quality. If the CLI is nondeterministic, document that and use a human/automated quality test rather than pretending identity is meaningful.
Every JSON response has a versioned schema. Important schemas are:
edge-cpu-gguf-tuner.host.v1 — host topology and discovered binaries.edge-cpu-gguf-tuner.plan.v1 — offline configurations and argv arrays.edge-cpu-gguf-tuner.report.v1 — exact host/model/binary metadata, attempts, parsed records, warnings, ranked metrics, and recommendation.edge-cpu-gguf-tuner.command.v1 — an unexecuted deployment argv and compatibility warnings.edge-cpu-gguf-tuner.quality-gate.v1 — hashes, sizes, identity decision, and explicit rejection/pass state.edge-cpu-gguf-tuner.error.v1 — safe error text and exit code.Agents should preserve these fields when summarizing:
status: plan | measured | failed | no_clear_winner
host: physical/logical CPUs, memory, architecture
model_and_build: exact path/size, binary path/version, optional model hash
metric: pp | tg | pg
recommendation: configuration, tokens_per_second, standard deviation, confidence
provenance: report path plus source/evidence scope
warnings: compatibility, thermal/noise, memory, quality, or failed attempts
next_action: one explicit rerun/verification step, or “none”
Be concise by default. Do not repeat the entire report when a compact JSON object or table answers the question; expand only when the user asks for methodology or troubleshooting.
The evidence ledger in references.json records retrieval date, source URLs, SHA-256 digests, claim scope, and whether a statement is upstream documentation or a local test. Current upstream references establish that:
llama cli, while upstream build examples also show llama-cli;llama-bench supports pp/tg/pg, repetitions, JSON/JSONL output, context depth, separate batch/ubatch, and -fa on|off|auto;cmake -B build followed by cmake --build build --config Release.Those sources do not authorize this skill to build/install anything, and they do not prove a performance result on the user's hardware. The historical registry copy is retained only in the private workspace's base/ directory, not as an authority for this skill.
The safe feedback loop is evidence accumulation, not autonomous code editing:
recommend to re-rank records and compare the new report to the old one;The skill never rewrites its own source, fetches “better” models, or learns from unverified model-generated suggestions. The deterministic regression suite is sh selftest.sh; its fake benchmark is only a parser/control-flow test and must never be reported as real throughput.
0: successful inspection/plan/render/quality pass, or a benchmark with structured records (even if warnings are present).1: benchmark produced no records or partial results; inspect warnings and rerun deliberately.2: invalid user input or missing explicit asset.124: subprocess timeout; stop and inspect model/binary/runtime conditions.127: executable could not be launched.130: user interruption.references.json — machine-readable evidence ledger and source hashes.README.md — full operational guide, threat model, schemas, and test checklist.scripts/edge_cpu_tuner.py — stdlib-only implementation.scripts/selftest.py / selftest.sh — deterministic static/behavioral smoke tests.