Show HN: ShrinkRay – HandBrake for TinyML ShrinkRay, a new open-source command-line tool, compresses and quantizes small neural networks for microcontrollers, providing a fit verdict against a 12-chip database before firmware builds. The tool, installable via `pip install shrinkray-cli`, supports Keras/TFLite, scikit-learn, and ONNX models, outputs chip-ready artifacts (TFLite, C byte arrays, C99 headers, .espdl), and generates self-contained reports, all fully local with no network calls or telemetry. ShrinkRay's fit analysis measures actual artifact bytes on disk for flash and performs tensor-liveness analysis for peak RAM, issuing FITS, TIGHT, or TOO BIG verdicts per chip. HandBrake for TinyML β€” one tool that takes any small model and produces a chip-ready artifact, with a report proving it fits. πŸ“– New here? Read the full user guide β€” installation, every command, and troubleshooting. ShrinkRay compresses/quantizes small neural networks for microcontrollers and tells you β€” before you touch a firmware build β€” whether the result fits your target chip's flash and RAM. - βœ… FITS /⚠️ TIGHT / ❌ TOO BIG verdict per chip - Keras/TFLite β†’ int8/int16/float TFLite + C byte array .cc / .h for LiteRT-M / CMSIS-NN - scikit-learn β†’ single portable C99 header via emlearn; works even on ATmega328P - ONNX β†’ .espdl via ESP-PPQ optional extra - Self-contained report.md + report.html after every conversion - 100% local: no network calls, no telemetry, no account pip install shrinkray-cli shrinkray chips the 12-chip database shrinkray inspect model.keras params, size, ops, FLOPs shrinkray convert model.keras --target esp32s3 --method int8 --data cal.npy Output: wrote outputs/model int8.tflite 2.7 KiB wrote outputs/model int8.cc wrote outputs/model int8.h accuracy max-abs-error 0.002717, top-1 agreement 100.0% esp32s3: βœ… FITS β€” flash 2.7 KiB / 8192.0 KiB 0.0% , est. RAM 0.1 KiB / 512.0 KiB 0.0% wrote outputs/report.md wrote outputs/report.html --data cal.npy is a small float32 array of representative samples numpy.save "cal.npy", x :100 .astype "float32" . With it you get full-integer quantization and an accuracy-delta check; without it, int8 falls back to dynamic-range quantization. | Command | What it does | |---|---| shrinkray inspect