

Pretrained transformer models in pure Keras 3, runnable on JAX, PyTorch and TensorFlow.
Loading comments…
Project Info
Product Keywords
KerasFormers is a library of pretrained transformer models built entirely in pure Keras 3, with weights converted from original checkpoints. It covers 118 model families—from object detection and segmentation to speech recognition and large language models—and runs the same code on JAX, PyTorch, or TensorFlow backends. No transformers or torch dependencies are needed at runtime, making it a lightweight, framework-agnostic alternative for working with modern architectures.
Every model is built with from_weights, then fed whatever its processor produces. Whether you're running a detector, a depth estimator, or an LLM, the workflow is identical—so switching between tasks costs you nothing in learning curve or code changes.
from_weights dispatches automatically: it accepts 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 like class counts are read from the repo config, so fine-tuned models work without extra setup.
Weight-only int8, int4, fp8, and mxfp4 are arguments to the same from_weights call, on any model. Large checkpoints like GPT-OSS 120B load at bfloat16 with MoE experts packed in MXFP4 and dequantized on the fly, keeping memory near 66 GB instead of ~130 GB in fp32.
Every figure and printed result on a model page comes from actually running the snippet beside it on the real image or audio clip shown. Nothing is hand-written to look plausible—what you read is exactly what you get when you run it yourself.
"Run any model, on any backend."
That's not marketing fluff. KerasFormers delivers on it by porting 118 model families to pure Keras 3 with converted weights, then letting you switch between JAX, PyTorch, and TensorFlow with a single environment variable. The combination of breadth, backend flexibility, and honest, reproducible documentation makes it a rare find in the ML library space.
You're building with Keras and want access to modern transformers without leaving the ecosystem, or if you need one codebase that runs across multiple backends for portability. It's also a strong fit if you work with large models and want straightforward quantization options, or if you value documentation that reflects real, runnable results rather than hand-crafted examples.
Other tools you might consider
Meet Mellum, a family of fast language models, including a next-generation model for ultra-low-latency and high-performance inference.
MiniMax H3 is an open multimodal model that generates 2K video with native stereo sound. It unifies text, image, and audio inputs, excelling at accurate text rendering, visual packaging, and complex instruction following for commercial content creation.
Vendo is an open-source customization layer in your product that lets every customer add the features and micro-apps they need, just by describing what they want. Until now software has been rigid, and every customer had to adapt to it. Vendo makes it dynamic, so your product shapes itself around each customer, built on your own API and inside the guardrails you set.
The moment an agent needs to deploy something, it slams face-first into a wall built for humans. Today we're rolling out Temporary Accounts on Cloudflare Workers. Any agent can now run wrangler deploy — temporary and get a live Worker in seconds.
Maker
sleepyfox
Loading comments…