streamlit-recommenders: Interactive Inspection for Recommender Systems
An interactive, inspectable web demo for your recommender, in a few lines of Python.
Pick a user, see their history and what each model recommends, click or swipe to give feedback,
and watch the recommendations change. streamlit-recommenders builds that
Streamlit app around your model, so a recommender paper can ship with a
demo instead of only a metrics table.
You supply pandas tables and a function (or object) that returns ranked item ids. The library handles the UI, session profile, caching, side-by-side comparison, and helpers for metrics and plots. It contains no models of its own.
- Per-user behavior: any user's history next to live recommendations; session clicks, likes and dislikes feed back into the profile.
- Parameters: model parameters become sidebar widgets.
- Comparison: pass a dict of models; all of them get the same user and session.
- Evaluation helpers: hit rate, recall, NDCG, MRR, coverage, overlap heatmaps, score distributions.
- No hidden substitutes: cold-start samples and popularity fallbacks are labeled, so nothing on screen is mistaken for the model's output.
Install
pip install streamlit-recommenders
Python 3.10+. Docs: vaclavstibor.github.io/streamlit-recommenders, starting with Getting started.
Minimal example
import streamlit_recommenders as sr
items = sr.load_items("data/items.csv")
interactions = sr.load_interactions("data/interactions.csv")
POPULARITY = interactions["item_id"].value_counts().index.tolist()
def get_recommendations(user_id, k, session_items=None, **params):
exclude = set(session_items or [])
return [item_id for item_id in POPULARITY if item_id not in exclude][:k]
sr.run(get_recommendations=get_recommendations, items=items, interactions=interactions)
streamlit run app.py
Swap the function body for your model. For comparison, pass get_recommendations={"Ours": ours, "EASE": ease}.
Tables follow a small data contract.
Plugging in a model
- A plain function
get_recommendations(user_id, k, session_items=None, **params)around any scorer, service or API. - A
sr.BaseRecommendersubclass that implementsscores(); seen-filtering and top-kare done for you. sr.ArtifactRecommender, which loads exported.npzweights, so training stays outside the demo.
ItemKNN, EASE and Sequential CF are in examples/reference_recommenders.py
to copy from. See the recommender contract.
Examples
In examples/ (repository only, not in the wheel):
| File | Shows |
|---|---|
reference_recommenders.py |
ItemKNN / EASE / Sequential CF as BaseRecommender subclasses, fit in the app |
train_baseline_artifacts.py |
training the same baselines and exporting .npz artifacts |
compare_models_rows.py |
three artifacts side by side |
compare_models_grid.py |
one artifact at a time in the grid layout |
swipe_deck_cards.py |
EASE as a swipe deck; dislikes push down similar movies |
Citation
@software{stibor2026streamlitrecommenders,
author = {Stibor, V{\'a}clav and Van{\v c}ura, Vojt{\v e}ch and Pe{\v s}ka, Ladislav},
title = {StreamlitRecommenders: Towards Recommendation Inspectability as a New Reproducibility Standard},
year = {2026},
url = {https://github.com/vaclavstibor/streamlit-recommenders},
version = {0.1.2}
}
License
MIT, see LICENSE.
Metadata
Release files for streamlit-recommenders 0.1.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| streamlit_recommenders-0.1.2.tar.gz | 85.5 kB | With provenance | Details for streamlit_recommenders-0.1.2.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| streamlit_recommenders-0.1.2-py3-none-any.whl | Python 3 | none | any | Details for streamlit_recommenders-0.1.2-py3-none-any.whl |
Total release size: 176.5 kB
Release files / streamlit_recommenders-0.1.2.tar.gz
| Download URL | streamlit_recommenders-0.1.2.tar.gz |
|---|---|
| Size | 85.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
604848d154464ee1eb83f9bf98fea52ceede6146b3b4251bee742881654fbb58
|
|
BLAKE2b-256 checksum How to use checksums |
4dc3d27a065961e45b0072e93887921d94bee424484beafa2ecbca55774b50b9
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 20, 2026.
Transparency logRelease files / streamlit_recommenders-0.1.2-py3-none-any.whl
| Download URL | streamlit_recommenders-0.1.2-py3-none-any.whl |
|---|---|
| Size | 91.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
915ae3e0e22b6d61bf4551eefd11b1680be74fcf980f60ab988c6281fcc5462d
|
|
BLAKE2b-256 checksum How to use checksums |
98e546463691a32eebf16aa138e294d2a9a532a471849ba4691abf6695bddc8b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 20, 2026.
Transparency logSecurity for streamlit-recommenders 0.1.2
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
Both files in this release have been uploaded with provenance metadata.
Attestation for streamlit_recommenders-0.1.2.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 20, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.