Getting it into your agent
One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.
npx skills add fortunto2/solo-factory --skill model-shrinkgit clone --depth 1 https://github.com/fortunto2/solo-factoryWrote 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/skills/fortunto2/solo-factory/model-shrink)<a href="https://agentmods.dev/skills/fortunto2/solo-factory/model-shrink"><img src="https://agentmods.dev/badge/skills/fortunto2/solo-factory/model-shrink/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/skills/fortunto2/solo-factory/model-shrink"><img src="https://agentmods.dev/badge/skills/fortunto2/solo-factory/model-shrink.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.00120 | $0.01571 |
| Opus 5.5 | $0.00048 | $0.00628 |
| Sonnet 5.5 | $0.00024 | $0.00314 |
| Haiku 4.5 | $0.00012 | $0.00157 |
Grade A, and why
solo-model-shrink scanned grade A with 1 finding 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.
Makes network callslowCapability
Not a fault in itself. Listed so you know the mod talks to something, and to what.
one-curl measurement on a real device over Wi-Fi. How it starts
The opening of the file, as written. The whole thing — 101 lines — stays where its author put it; the contents beside it link to each section on GitHub.
model-shrink — ship a trained model to phones and browsers
A PyTorch checkpoint becomes: an eval, an ONNX int8 file (web/Android), a Core ML package (Apple), an on-device number, and a download-on-demand delivery. Every step below was paid for once; the order is the method.
Workflow
- Eval before anything. Ground truth + one scalar metric (F-measure, accuracy — whatever the task has) + a script that runs any model variant against it. Every later decision — quantize? fp16? distill? — is this script's output, never a guess. Keep 5–10 held-out samples as a smoke set.
- Export ONNX at a fixed shape (
torch.onnx.export, one export per batch size — see Gotchas). Verify against the original: max abs diff and the eval score.onnxruntimeCPU is the portable baseline: web (onnxruntime-webWASM), Android (ORT mobile), desktop. - Quantize weights to int8 (
onnxruntime.quantization/ct.optimize.coreml.linear_quantize_weights). Weights-only int8 is usually free — measured twice on a 20M-param transformer: F 0.872→0.871 (ONNX) and 0.864→0.863 (Core ML), 4x smaller. Re-run the eval anyway; "usually" is not "always". - Apple: convert to native Core ML (
coremltools), never the ORT Core ML execution provider (see Don't). Conversion of transformer-ish models fails on Python-int shape math; the fixes that work:- Replace einops layers/
rearrangewith explicitpermute/reshape. - Bake shapes as constants: capture
tuple(int(s) for s in x.shape)on a module attribute during a warm eager pass, use those ints inforward— the trace then contains zeroaten::size/aten::Intops. Fixed export shape makes this sound. - Derive dims from weights (
linear.out_features), not from tensors. - After EVERY replacement: run the model, assert max abs diff ≈ 0 vs the original. A stack of "obviously equivalent" rewrites drifts; a stack of asserted ones doesn't.
- Replace einops layers/
- Identify failing ops by graph census, not by reading code. When the
converter names a node (
blocks/0/partial/76), dumpts.inlined_graph, filter nodes by scope and kind (aten::Int,aten::size,prim::NumToTensor), and match. The class you think is in the call path may be a similarly-named neighbour that is never called — a patch that changes nothing (diff 0.000e+00 because the code never ran) looks exactly like a patch that is perfectly equivalent. - Benchmark on the target device, with the model's native window size and
deterministic non-zero input. Compare compute units (
cpuOnly, GPU, ANE) per model — a rotary-attention transformer measured 2x FASTER on iPhone CPU than on the ANE, and the ANE's first load cost 43s of one-time compilation. Dev-machine numbers do not transfer; a busy dev machine's numbers don't even reproduce. - Deliver as a download, not in the bundle. Tens of MB belong in a
FaceModelStore-style on-demand store: download →
MLModel.compileModel→ Application Support (excluded from backups) → validate by loading before declaring installed. An.mlpackageis a directory: host it as its files under one base URL (Manifest.json, Data/com.apple.CoreML/model.mlmodel, Data/com.apple.CoreML/weights/weight.bin) and pin that list with a test. - Leave a bench door open: a debug HTTP endpoint in the app that loads the installed model and times N predicts turns every future variant into a one-curl measurement on a real device over Wi-Fi.
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 · 101 lines · 120 tokens per session scan A a8d911568dc3
solo-model-shrink is a skill published in the GitHub repository fortunto2/solo-factory (19 stars, last pushed 4d ago), licensed MIT. It adds 120 tokens to every session and 1,571 once invoked, about $0.0005 per session on Opus 5.5. A static security scan graded it A with 1 finding (makes network calls). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.
Other skills, from other repositories
ml-kit-genai-prompt-api
Analyzes Android codebases to implement ML Kit GenAI Prompt API. Use this skill to send natural language requests on-device to Gemini Nano, use structured output with Prompt API, implement prefix caching, optimize the current prompt, or apply best practices.".
working-with-coreai
Use this skill whenever the user mentions coreai-torch, TorchConverter, coreai-build, AIModel, AIProgram, .aimodel, or wants to export/compile/run a PyTorch model on Apple silicon (iPhone, iPad, Mac). Also triggers for "deploy on device", "optimize for on-device performance", onboarding new models to Core AI, or…
litert-runtime
Configures and implements LiteRT (.tflite) on-device inference on Android in Kotlin using the CompiledModel API on CPU and GPU. Use this skill for any Android LiteRT or .tflite task, including Gradle setup, image classification or vision/audio/embedding helpers, TensorBuffer reuse, CPU memory optimization, Bitmap…
model-authoring
Empirical rules for authoring PyTorch models for on-device execution on Apple platforms, covering energy-efficient inference, scalable compute, and correctness testing. Use this skill whenever the user is writing, debugging, or reviewing PyTorch model code intended for on-device execution — even if they don't…
datachain-knowledge
Use whenever datasets, cloud storage buckets, or data pipelines are mentioned — creating, saving, querying, listing, exploring, deleting, or processing data in S3, GCS, Azure Blob, or local storage. Also use when running any script that may create datasets as a side effect. Maintains a knowledge base at dc-knowledge/…
foundation-models-on-device
Apple FoundationModels framework for on-device LLM — text generation, guided generation with @Generable, tool calling, and snapshot streaming in iOS 26+.