skillfed

keras-nlp

Pretrained models for Keras.

keras-nlp v0.31.0 287.0K downloads/30d#8,037 on PyPI64,228
Permissive license Apache-2.0 Active released

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

uv

uv add keras-nlp

poetry

poetry add keras-nlp

Installing 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

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.11Programming Language :: Python :: 3.9Topic :: Scientific/EngineeringTopic :: Software Development

Tags

pretrained nlp modelskeras natural language processingtransformer models kerastext classification deep learninglanguage model inferencenlp with keras 3multi-backend nlp framework
multi-backendpretrained-modelsnlp

More Software Development packages