Run any model, on any backend (Website)
ZeroModels provides a unified Keras 3 library for running 100+ model families across JAX, PyTorch, and TensorFlow without requiring heavy transformer dependencies.
Deep dive
- Supports vision, text, multimodal, and speech tasks with one API.
- Uses
from_weightsto handle local Keras repos, Hugging Face checkpoints, or bare variant names. - Models are backend-agnostic (JAX/PyTorch/TensorFlow) and read configuration from a common metadata format.
- Features quantization for large models like GPT-OSS 120B to optimize memory footprint.
Decoder
- Backend: The underlying numerical computation library (JAX, PyTorch, or TensorFlow) that executes the model's math operations.
- Quantization: Reducing the precision of model weights (e.g., from 32-bit floats to 4-bit integers) to save memory and increase speed.
Original article
Run any model, on any backend
100+ model families ported to pure Keras 3, with weights converted from the original checkpoints. The same code runs on JAX, PyTorch and TensorFlow, and nothing from transformers or torch is needed at run time.
Two calls to a prediction
Build the model with from_weights, then feed it whatever its processor produces. Every model in the library follows this shape, so moving between a detector, a depth estimator and an LLM costs you nothing.
pip install -U zeromodels
Weights come from the zeromodels org on the Hub, and the same identifier builds both the model and its processor, so the resolution and normalization always match the checkpoint.
import os
os.environ["KERAS_BACKEND"] = "torch" # or "jax" / "tensorflow"
from PIL import Image
from zeromodels.models.detr import DETRDetect, DETRImageProcessor
model = DETRDetect.from_weights("zeromodels/detr-resnet-50")
processor = DETRImageProcessor.from_weights("zeromodels/detr-resnet-50")
image = Image.open("photo.jpg").convert("RGB")
output = model(processor(image)["pixel_values"], training=False)
results = processor.post_process_object_detection(
output, threshold=0.9, target_sizes=[(image.height, image.width)]
)[0]
One call, three sources
from_weights dispatches on what you hand it: a preconverted Keras repo on the Hub, a bare variant name that converts an upstream checkpoint on the fly, or any compatible Hugging Face repo behind the hf: prefix. Architecture details, including the class count of a fine-tune, are read from the repo config.
from zeromodels.models.qwen3 import Qwen3TextGenerate
from zeromodels.models.segformer import SegFormerSemanticSegment
# Preconverted Keras weights (zm_config.json)
SegFormerSemanticSegment.from_weights("zeromodels/segformer_b0_ade_512")
# Bare variant: converted from upstream on the fly
Qwen3TextGenerate.from_weights("qwen3-8b")
# Any Hub repo with a matching model_type
SegFormerSemanticSegment.from_weights("hf:nvidia/segformer-b0-finetuned-ade-512-512")
# Architecture only, randomly initialized
SegFormerSemanticSegment.from_weights(
"zeromodels/segformer_b0_ade_512", load_weights=False
)
Measured outputs, not illustrative ones
Every figure and every printed result on a model page comes from actually running the snippet beside it on the image or audio clip shown. Nothing is hand-written to look plausible, so what you read is what you get when you run it yourself.
Any backend, either data format
Set KERAS_BACKEND before importing Keras and the rest is unchanged. Models read keras.config.image_data_format() when they are constructed, so set that first too if you want channels_first; processors take a per-instance data_format argument.
import os
os.environ["KERAS_BACKEND"] = "jax" # or "torch" / "tensorflow"
import keras
keras.config.set_image_data_format("channels_first")
Large checkpoints, as they ship
- GPT-OSS 120B loads at bfloat16 with its MoE experts left packed in MXFP4 and dequantized on the fly, so it stays near 66 GB instead of the ~130 GB an fp32 expansion would cost.
- Weight-only int8, int4, fp8 and mxfp4 are arguments to the same
from_weightscall, on any model.
from zeromodels.models.gpt_oss import GptOssTextGenerate
# Experts stay packed in MXFP4, dequantized in the expert layer's call
model = GptOssTextGenerate.from_weights("zeromodels/gpt-oss-120b")
# Quantize weight-only on the way in, for a smaller footprint again
model = GptOssTextGenerate.from_weights("zeromodels/gpt-oss-120b", quantization="int8")
Where to start
Vision
Detection, segmentation, depth, and self-supervised backbones.
Text
Encoders and decoder LLMs, dense and mixture-of-experts.
Multimodal
Vision-language generation and grounding.
Speech
Transcription and speech-aware language models.
Ready to use ZeroModels?
One install, 118 model families, three backends.
Fresh dev news, AI-digested daily. Never miss a trend at devoured.fyi