skillfed

keras-hub

Pretrained models for Keras.

keras-hub v0.31.0 629.1K downloads/30d#5,669 on PyPI64,228
Permissive license Apache-2.0 Active released

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-hub

uv

uv add keras-hub

poetry

poetry add keras-hub

Installing 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

Development Status :: 3 - AlphaIntended Audience :: Science/ResearchOperating System :: MacOSOperating System :: Microsoft :: WindowsOperating System :: UnixProgramming Language :: Python :: 3Programming Language :: Python :: 3 :: OnlyProgramming Language :: Python :: 3.10Programming Language :: Python :: 3.11Topic :: Scientific/EngineeringTopic :: Software Development

Tags

pretrained models kerasmulti-framework neural networkstext image audio classificationfine-tune transformer modelskeras 3 model zoojax tensorflow pytorch modelstransfer learning library
transfer-learningmulti-backendpretrained-models

More Software Development packages