More on the topic…
ZeroModels is a library that ports over 100 model families into pure Keras 3, letting you run the same code across JAX, PyTorch, and TensorFlow without needing transformers or torch installed at runtime. The setup is straightforward: you load a model and its processor with `from_weights()`, then pass the processor output directly to the model. Everything stays synchronized—the processor's normalization and image resolution always match the checkpoint it came from, so you don't have to manage those details yourself. Switching between different model types (object detection, depth estimation, language models) requires no code changes beyond swapping the model class.
The library handles weight loading flexibly. You can pull preconverted Keras weights from the zeromodels org on Hugging Face Hub, load a bare model name that gets converted on the fly from upstream checkpoints, or point to any compatible Hub repo using the `hf:` prefix. The architecture details automatically read from the repo config, including fine-tuning specifics like class counts. You can also load architecture-only versions with random initialization if you need that.
Memory efficiency gets real attention here. Large models like GPT-OSS 120B load at bfloat16 with MoE experts staying packed in MXFP4 and dequantized on demand, keeping memory around 66 GB instead of 130 GB for full fp32. Weight-only quantization—int8, int4, fp8, or mxfp4—works as a simple argument to the same `from_weights()` call on any model. All outputs shown in the documentation come from actually running the code snippets on real images and audio, not hand-crafted examples.
Questions about this article
No questions yet.