keras-hub
Pretrained models for Keras.
What it is and what it does
KerasHub is a library of pretrained neural network models built on Keras 3, designed to work seamlessly across JAX, TensorFlow, and PyTorch from a single model definition. It provides ready-to-use implementations of popular architectures (ResNet, BERT, and others) paired with pretrained checkpoints hosted on Kaggle Models, enabling developers to quickly load and fine-tune models for text, image, and audio tasks without rewriting code for different backends.
The library extends the core Keras API through Layer and Model implementations, so if you know Keras you can use KerasHub immediately. Models support fine-tuning on GPUs and TPUs out of the box, with built-in PEFT techniques for single-accelerator training and support for model and data parallel training at scale. Installation always includes TensorFlow for the tf.data preprocessing API, though training itself can happen on any configured backend.
Use it for:
- Load a pretrained ResNet or similar image classifier and fine-tune it on a custom dataset without rewriting for different backends.
- Fine-tune a BERT or other text model on domain-specific tasks like sentiment analysis or named entity recognition.
- Experiment with the same model architecture across JAX, TensorFlow, and PyTorch to compare performance and training efficiency.
- Build production inference pipelines using pretrained audio models (e.g., Whisper) for speech recognition or classification.
- Apply transfer learning and PEFT techniques to train large models on limited GPU memory.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
KerasHub provides Keras 3 implementations of pretrained model architectures for text, image, and audio tasks, with checkpoints available on Kaggle Models and support for JAX, TensorFlow, and PyTorch backends.
Yes, if you need pretrained models across multiple backends. KerasHub is actively maintained, has low install friction, and Apache-2.0 licensing is permissive. However, the library is in pre-release (0.31.0) with no backwards compatibility guarantees, so APIs may break. The mandatory TensorFlow dependency for tf.data preprocessing adds overhead even when training on JAX or PyTorch. Best suited for research and experimentation; production use should account for API instability.
Install
keras-hub on PyPI
pip
pip install keras-hubuv
uv add keras-hubpoetry
poetry add keras-hubInstalling keras-hub
Before you install
Low install friction with a pure-Python wheel. Active maintenance with a release 6 days old and last commit on 2026-08-14. Requires 11 runtime dependencies including keras, tensorflow-text, and tokenizers; TensorFlow is always pulled in for tf.data preprocessing even when training on other backends.
License in practice
Apache-2.0 permissive license allows commercial and private use with attribution. Third-party pretrained models (BART, BLOOM, DeBERTa, DistilBERT, GPT-2, Llama, Mistral, OPT, RoBERTa, Whisper, XLM-RoBERTa) are subject to separate licenses.
Quickstart
import os
os.environ["KERAS_BACKEND"] = "jax" # or "tensorflow" or "torch"
import keras_hub
import numpy as np
classifier = keras_hub.models.ImageClassifier.from_preset("resnet_50_imagenet")
image = keras.utils.load_img("path/to/image.jpg")
preds = classifier.predict(np.array([image]))
Requires Python 3.11+. KERAS_BACKEND environment variable must be set before importing any Keras libraries. TensorFlow is always installed for tf.data preprocessing.
Verify before relying
- Whether fine-tuning with PEFT techniques and distributed training (model/data parallel) work equally well across all three backends (JAX, TensorFlow, PyTorch).
- Performance characteristics and memory overhead of the 11 runtime dependencies in typical deployment scenarios.
- Stability guarantees for APIs given the pre-release 0.y.z development status and stated lack of backwards compatibility guarantees.
Package facts
| License | Apache-2.0 (permissive) |
| Python support | supports the current Python release (>=3.11) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 11 — keras, absl-py, numpy, packaging, regex, rich, kagglehub, kagglesdk, sentencepiece, tokenizers, tensorflow-text |
| Maintenance | actively maintained — 6 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 629,106/month — #5,669 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: keras_hub-0.31.0-py3-none-any.whl
Tags
More Software Development packages
Provides backported and experimental type hints…
permissive · top 100 on PyPI
numpyNumPy provides an N-dimensional array object…
permissive · top 100 on PyPI
fastapiFastAPI is a Python web framework for building…
permissive · top 100 on PyPI
annotated-docProvides a way to document function parameters,…
permissive · top 100 on PyPI
typerTyper builds command-line applications from…
permissive · top 1,000 on PyPI
distlibDistlib provides low-level packaging utilities…
permissive · top 1,000 on PyPI
kerasKeras 3 is a multi-backend deep learning…
permissive · top 5,000 on PyPI
keras-nlpKeras-NLP provides pretrained models and…
permissive · top 15,000 on PyPI
tensorflow-hubDownloads and loads pre-trained TensorFlow…
permissive · top 5,000 on PyPI
keras-nightlyA multi-backend deep learning framework that…
permissive · top 15,000 on PyPI
Keras-ApplicationsProvides pre-trained deep learning model…
permissive · top 5,000 on PyPI
Keras-PreprocessingProvides data preprocessing and augmentation…
permissive · top 5,000 on PyPI
scikerasSciKeras wraps Keras models to work with…
permissive · top 15,000 on PyPI
tf-kerasTF-Keras is the pure-TensorFlow implementation…
permissive · top 5,000 on PyPI
keras-tunerKerasTuner automates hyperparameter…
permissive · top 15,000 on PyPI
tf-keras-nightlyTF-Keras is a pure-TensorFlow implementation of…
permissive · top 5,000 on PyPI