keras-nlp
Pretrained models for Keras.
What it is and what it does
Keras-NLP is a library of pretrained models and utilities for natural language processing, built on top of Keras 3. It allows you to use the same high-level Keras API across multiple deep learning backends—JAX, TensorFlow, PyTorch, or OpenVINO—without rewriting code. You configure your backend before importing, then build and train NLP models using Keras abstractions that work identically regardless of which backend engine runs them underneath.
The library is designed for developers who want to avoid framework lock-in while building production NLP systems. It supports computer vision, audio, timeseries, and other tasks through the broader Keras ecosystem, but focuses specifically on pretrained model access and NLP workflows. Since it depends on keras-hub as its runtime foundation, it inherits Keras 3's multi-backend architecture and the ability to scale from laptops to distributed GPU/TPU clusters.
Use it for:
- Fine-tune pretrained language models on custom text classification or sequence labeling tasks using your choice of backend.
- Build NLP inference pipelines that run on OpenVINO for edge deployment while developing on JAX or PyTorch.
- Migrate existing tf.keras NLP code to run on JAX for performance gains without rewriting custom layers.
- Combine Keras NLP models with PyTorch data loaders or TensorFlow datasets in the same training loop.
- Prototype NLP experiments rapidly by swapping backends to find the fastest one for your model architecture.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Keras-NLP provides pretrained models and utilities for natural language processing tasks built on Keras 3, supporting multiple backends (JAX, TensorFlow, PyTorch, OpenVINO).
Yes, with conditions. Install if you need pretrained NLP models and want multi-backend flexibility without framework lock-in, or if you're already using Keras 3. The low install friction, active maintenance, and permissive license support this. However, the Alpha development status means the API may change; verify that the specific models and tasks you need are available in version 0.31.0 before committing to production use.
Install
keras-nlp on PyPI
pip
pip install keras-nlpuv
uv add keras-nlppoetry
poetry add keras-nlpInstalling keras-nlp
Before you install
Low install friction with a pure-Python wheel. Active maintenance with recent release (6 days old) and strong repository signals (64228 stars, last commit 2026-08-14). Requires Keras 3 as a runtime dependency.
License in practice
Apache-2.0 permissive license allows commercial and private use with minimal restrictions, making it suitable for most production and research contexts.
Quickstart
pip install keras-nlp
import keras_nlp
# Configure backend before importing keras
import os
os.environ["KERAS_BACKEND"] = "jax"
import keras
Requires Python >= 3.10 and a Keras 3 backend (TensorFlow 2.16.1+, JAX 0.4.20+, PyTorch 2.1.0+, or OpenVINO 2026.2.0+) to be installed separately.
Verify before relying
- Specific pretrained model architectures and task coverage available in version 0.31.0
- Performance benchmarks for NLP tasks compared to other frameworks
- API stability guarantees given 'Alpha' development status
Package facts
| License | Apache-2.0 (permissive) |
| Python support | supports the current Python release (>=3.10) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 1 — keras-hub |
| Maintenance | actively maintained — 6 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 287,031/month — #8,037 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: keras_nlp-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-hubKerasHub provides Keras 3 implementations of…
permissive · top 15,000 on PyPI
scikerasSciKeras wraps Keras models to work with…
permissive · top 15,000 on PyPI
keras-nightlyA multi-backend deep learning framework that…
permissive · top 15,000 on PyPI
tf-kerasTF-Keras is the pure-TensorFlow implementation…
permissive · top 5,000 on PyPI
Keras-PreprocessingProvides data preprocessing and augmentation…
permissive · top 5,000 on PyPI
spark-nlpSpark NLP provides distributed natural language…
permissive · top 5,000 on PyPI
tf-keras-nightlyTF-Keras is a pure-TensorFlow implementation of…
permissive · top 5,000 on PyPI
tf2crfProvides a Conditional Random Field (CRF) layer…
permissive · top 15,000 on PyPI
transformersTransformers provides a unified framework for…
permissive · top 1,000 on PyPI