Abstract
The rapid deployment of AI and ML at the far edge, particularly on microcontrollers, requires efficient serialization of complex data structures. Python’s pickle module is widely used but lacks native support in MicroPython, hindering seamless data transfer. We introduce mPickle, a MicroPython-compatible library enabling memory-optimized serialization of complex Python objects, supporting TinyMLOps workflows that transfer model artifacts from CPython to MicroPython targets. mPickle implements the Pickle Protocol 4 with a module/function mapping layer that enables interoperable binary serialization and deserialization between CPython and MicroPython. The library is validated via unit tests, benchmarks, and examples covering built-in types, custom classes, numerical arrays, and model-weight dictionaries.
