KerasFormers

Pretrained transformer models in pure Keras 3, runnable on JAX, PyTorch and TensorFlow.

Last verified:

Visit KerasFormers

What is KerasFormers?

KerasFormers is a Python library that ports 118 AI model families to pure Keras 3, enabling the same code to run across JAX, PyTorch, and TensorFlow backends without requiring transformers or torch at runtime. It supports vision tasks (detection, segmentation, depth estimation, SAM), multi-modal tasks (OWLv2), speech recognition (Whisper), and text generation (Qwen3).

KerasFormers pricing

Pricing model: Freemium

Free and open source

KerasFormers pros

  • Unified API across three backends (JAX, PyTorch, TensorFlow) with identical code
  • 118 model families preconverted with weights from Hugging Face Hub
  • No external runtime dependencies (transformers/torch not required)
  • Flexible weight loading from preconverted Keras repos, bare variants, or any compatible HF repository
  • Covers diverse tasks: detection, segmentation, depth estimation, open-vocabulary detection, speech recognition, text generation

KerasFormers cons

  • Limited model coverage (118) compared to Hugging Face transformers library (thousands)
  • Requires Keras 3 which is newer and less mature than TensorFlow 2.x
  • Appears to be a small/single-person project with unknown long-term maintenance commitment
  • Limited documentation beyond getting started guide (architecture details sparse)

Frequently asked questions about KerasFormers

What backends does KerasFormers support?

JAX, PyTorch, and TensorFlow. Set the backend via KERAS_BACKEND environment variable.

Do I need transformers library installed?

No. KerasFormers requires only Keras 3 and can load weights independently from Hugging Face Hub.

Can I use models from Hugging Face Hub?

Yes. Use the 'hf:' prefix to load any compatible HF repo, or preconverted models from the kerasformers organization on Hub.

What types of models are included?

Vision (DETR, SegFormer, Depth Anything V2, SAM 3, OWLv2), speech (Whisper), and text generation (Qwen3), with 118 total model families.

Categories

Use cases

Browse all AI tools on NeedAnAI