tensorflow-recommenders
Tensorflow Recommenders, a TensorFlow library for recommender systems.
What it is and what it does
TensorFlow Recommenders is a Keras-based library for building recommender systems on top of TensorFlow. It abstracts away common patterns in recommendation workflows—embedding layers, ranking tasks, retrieval metrics—so you can focus on model architecture rather than boilerplate. The library is designed with a gentle learning curve but retains flexibility for complex models; it handles data preparation, model formulation, training, evaluation, and deployment as an integrated workflow.
The package depends on tensorflow, tf-keras, and absl-py, and is built to work seamlessly within the TensorFlow ecosystem. It provides task abstractions (like Retrieval) and metric classes (like FactorizedTopK) that simplify the definition of loss functions and evaluation criteria for recommendation problems. The library is actively maintained, with recent commits and a permissive Apache 2.0 license.
Use it for:
- Build a matrix factorization model to predict user ratings for unseen movies or products.
- Train a two-tower neural network for candidate retrieval in a large-scale recommendation system.
- Evaluate ranking quality using built-in metrics like FactorizedTopK across a full candidate set.
- Combine user and item embeddings with custom Keras layers to model complex interaction patterns.
- Deploy a trained recommender model using TensorFlow's standard serving infrastructure.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
TensorFlow Recommenders provides a Keras-based library for building recommender system models, covering the full workflow from data preparation through training, evaluation, and deployment.
Yes. The package is actively maintained, has low install friction, carries no known vulnerabilities, and offers a well-structured abstraction for a common ML task. It is suitable for developers building recommender systems who want to leverage TensorFlow's ecosystem without writing boilerplate. The Apache 2.0 license is permissive for commercial use.
Install
tensorflow-recommenders on PyPI
pip
pip install tensorflow-recommendersuv
uv add tensorflow-recommenderspoetry
poetry add tensorflow-recommendersInstalling tensorflow-recommenders
Before you install
Low install friction with a pure-Python wheel. The package is actively maintained with recent commits and depends on core TensorFlow ecosystem libraries (tensorflow, tf-keras, absl-py), all of which are well-established.
License in practice
Apache 2.0 is permissive; you can use, modify, and distribute this package freely in commercial and private projects with minimal restrictions.
Quickstart
pip install tensorflow-recommenders
import tensorflow_recommenders as tfrs
import tensorflow as tf
class Model(tfrs.Model):
def __init__(self):
super().__init__()
self.user_model = tf.keras.layers.Embedding(input_dim=2000, output_dim=64)
self.item_model = tf.keras.layers.Embedding(input_dim=2000, output_dim=64)
self.task = tfrs.tasks.Retrieval()
def compute_loss(self, features, training=False):
user_embeddings = self.user_model(features["user_id"])
item_embeddings = self.item_model(features["item_id"])
return self.task(user_embeddings, item_embeddings)
model = Model()
model.compile(optimizer=tf.keras.optimizers.Adagrad(0.5))
Requires TensorFlow 2.x to be installed separately; the package does not bundle TensorFlow itself.
Verify before relying
- Whether the package supports distributed training across multiple GPUs or TPUs.
- Performance characteristics and scalability limits for large-scale datasets.
- Availability of pre-built models or transfer learning capabilities.
Package facts
| License | Apache 2.0 (permissive) |
| Python support | not specified |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 4 — absl-py, tf-keras, tensorflow, tensorflow-macos |
| Maintenance | actively maintained — 203 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 203,882/month — #9,618 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: tensorflow_recommenders-0.7.7-py3-none-any.whl
Keywords: tensorflow, recommenders, recommendations
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
implicitImplicit provides fast Python implementations…
permissive · top 15,000 on PyPI
kerasKeras 3 is a multi-backend deep learning…
permissive · top 5,000 on PyPI
scikit-surpriseScikit-surprise builds and evaluates…
permissive · top 15,000 on PyPI
tensorflow-model-optimizationProvides quantization, pruning, and clustering…
permissive · top 15,000 on PyPI
recboleRecBole provides a unified framework for…
permissive · top 15,000 on PyPI
tf-slimTensorFlow-Slim provides high-level layers,…
permissive · top 15,000 on PyPI
tensorflow-estimatorTensorFlow Estimator provides a high-level API…
permissive · top 5,000 on PyPI
keras-nightlyA multi-backend deep learning framework that…
permissive · top 15,000 on PyPI
tf-keras-nightlyTF-Keras is a pure-TensorFlow implementation of…
permissive · top 5,000 on PyPI