Python recommendation tools
LensKit is a set of Python tools for experimenting with and studying recommender systems. It provides support for training, running, and evaluating recommender algorithms in a flexible fashion suitable for research and education.
LensKit for Python (LKPY) is the successor to the Java-based LensKit project.
Installing
To install the current release with uv (recommended):
$ uv pip install lenskit
Or, to add it to your project's dependencies and virtual environment:
$ uv add lenskit
Classic pip also works:
$ python -m pip install lenskit
Then see Getting Started
Conda Packages
You can also install LensKit from conda-forge with pixi:
$ pixi add lenskit
Or conda:
$ conda install -c conda-forge lenskit
Development Version
To use the latest development version, you have two options. You can install directly from GitHub:
$ uv pip install -U git+https://github.com/lenskit/lkpy
Or you can use our PyPI index, by adding to pyproject.toml:
[[tool.uv.index]]
name = "lenskit"
url = "https://pypi.lenskit.org/lenskit-dev/"
Binary wheels of LensKit development (and release) versions are automatically pushed to this index, although they are not guaranteed to be permanently available. Reproducible code should generally depend on released versions published to PyPI.
Simplifying PyTorch installation
We also provide mirrors of the PyTorch package repositories that are filtered to
only include PyTorch and directly supporting dependencies, without other
packages that conflict with or mask packages from PyPI, and with fallbacks for
other platforms (i.e., our CUDA indices include CPU-only MacOS packages). This
makes it easier to install specific versions of PyTorch in your project with
the index priority and fallthrough logic implemented by uv. To make your
project only use CPU-based PyTorch, you can add to pyproject.toml:
[[tool.uv.index]]
name = "torch-cpu"
url = "https://pypi.lenskit.org/torch/cpu/"
Or CUDA 12.8:
[[tool.uv.index]]
name = "torch-gpu"
url = "https://pypi.lenskit.org/torch/cu128/"
These indices provide the same package distributions as the official PyTorch repositories (in fact, they link directly to the PyTorch packages). They are just an alternate index view that reduces some package conflicts.
Developing
To contribute to LensKit, clone or fork the repository, get to work, and submit a pull request. We welcome contributions from anyone; if you are looking for a place to get started, see the issue tracker.
Our development workflow is documented in the wiki; the wiki also contains other information on developing LensKit. User-facing documentation is at https://lenskit.org.
We use uv for developing LensKit and managing
development environments. Our pyproject.toml file contains the Python
development dependencies; you also need a working Rust compiler (typically via
rustup), although uv sync will automatically install
enough of one to build LensKit. You will also need a working C compiler (on
macOS, install Xcode or the Xcode command-line tools).
The easiest way to work on LensKit is to use the devcontainer — in Visual Studio Code, Zed, and other editors supporting Dev Containers, just re-open the project in a dev container, and the necessary software will be automatically installed.
If you want to set up yourself, the uv dependencies have everything needed:
$ uv sync
$ uv run prek install
If you want to use a specific Python version, select it with uv venv or uv sync:
$ uv venv -p 3.14t
$ uv sync
If you want all extras, do:
$ uv sync --all-extras
Testing Changes
You should always test your changes by running the LensKit test suite:
uv run pytest tests
If you want to use your changes in a LensKit experiment, you can locally install your modified LensKit into your experiment's environment. We recommend using separate environments for LensKit development and for each experiment; you will need to install the modified LensKit into your experiment's repository:
uv pip install -e /path/to/lkpy
Resources
Acknowledgements
This material is based upon work supported by the National Science Foundation under Grant No. IIS 17-51278. Any opinions, findings, and conclusions or recommendations expressed in this material are those of the author(s) and do not necessarily reflect the views of the National Science Foundation.
Metadata
Release files for lenskit 2026.4.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| lenskit-2026.4.0.tar.gz | 3.1 MB | Details |
Built distributions (wheels)
| File | Reset | |||
|---|---|---|---|---|
| lenskit-2026.4.0-cp314-cp314t-manylinux_2_28_x86_64.whl | CPython 3.14 | CPython 3.14 free-threading | Linux glibc 2.28+ x86-64 | Details |
| lenskit-2026.4.0-cp314-cp314t-manylinux_2_28_aarch64.whl | CPython 3.14 | CPython 3.14 free-threading | Linux glibc 2.28+ ARM64 | Details |
| lenskit-2026.4.0-cp314-cp314t-macosx_11_0_arm64.whl | CPython 3.14 | CPython 3.14 free-threading | macOS 11.0+ ARM64 | Details |
| lenskit-2026.4.0-cp312-abi3-win_amd64.whl | CPython 3.12 | abi3 | Windows x86-64 | Details |
| lenskit-2026.4.0-cp312-abi3-manylinux_2_28_x86_64.whl | CPython 3.12 | abi3 | Linux glibc 2.28+ x86-64 | Details |
| lenskit-2026.4.0-cp312-abi3-manylinux_2_28_aarch64.whl | CPython 3.12 | abi3 | Linux glibc 2.28+ ARM64 | Details |
| lenskit-2026.4.0-cp312-abi3-macosx_11_0_arm64.whl | CPython 3.12 | abi3 | macOS 11.0+ ARM64 | Details |
Total release size: 57.1 MB
Release files / lenskit-2026.4.0.tar.gz
| Download URL | lenskit-2026.4.0.tar.gz |
|---|---|
| Size | 3.1 MB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
c54b1a26b73aaaaf9b3f896cb72d7977dbd8faec839e92d8d28a4095abb34d29
|
|
BLAKE2b-256 checksum How to use checksums |
2b2f22fab72425e6b5fec24f59e0582f6f91f78dfb43ac405242e249b919aadc
|
| 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 Sep 30, 2026.
Transparency logRelease files / lenskit-2026.4.0-cp314-cp314t-manylinux_2_28_x86_64.whl
| Download URL | lenskit-2026.4.0-cp314-cp314t-manylinux_2_28_x86_64.whl |
|---|---|
| Size | 11.2 MB |
| Tags | CPython 3.14 CPython 3.14 free-threading Linux glibc 2.28+ x86-64 |
|
SHA-256 checksum How to use checksums |
8f6c66641e1a52c729693af64ff4f0eb71e36c8dfa6169477e18337fdf5cb518
|
|
BLAKE2b-256 checksum How to use checksums |
beab7a7c0a0bce496e147df799f98b41486c9b63ccd7e24038d3af83366d28b8
|
| 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 Sep 30, 2026.
Transparency logRelease files / lenskit-2026.4.0-cp314-cp314t-manylinux_2_28_aarch64.whl
| Download URL | lenskit-2026.4.0-cp314-cp314t-manylinux_2_28_aarch64.whl |
|---|---|
| Size | 10.5 MB |
| Tags | CPython 3.14 CPython 3.14 free-threading Linux glibc 2.28+ ARM64 |
|
SHA-256 checksum How to use checksums |
b523960e339711ccb21c9942fa8df0078e043b7fd0535fc81d382b889649e82c
|
|
BLAKE2b-256 checksum How to use checksums |
c380bb610b4c12159dd667d63ecbd5011cfc5bfa6a3dc01fc18135b0c06afeb9
|
| 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 Sep 30, 2026.
Transparency logRelease files / lenskit-2026.4.0-cp314-cp314t-macosx_11_0_arm64.whl
| Download URL | lenskit-2026.4.0-cp314-cp314t-macosx_11_0_arm64.whl |
|---|---|
| Size | 3.4 MB |
| Tags | CPython 3.14 CPython 3.14 free-threading macOS 11.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
a15f104a0bf71554be1569d19ddcf1d026583e52c602e6197da78d5c58232baa
|
|
BLAKE2b-256 checksum How to use checksums |
18792d27f3febe9eef5046a43559ab551d5f4555613be8db0c14e6e2bc3bd6d5
|
| 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 Sep 30, 2026.
Transparency logRelease files / lenskit-2026.4.0-cp312-abi3-win_amd64.whl
| Download URL | lenskit-2026.4.0-cp312-abi3-win_amd64.whl |
|---|---|
| Size | 3.7 MB |
| Tags | CPython 3.12 Windows x86-64 abi3 |
|
SHA-256 checksum How to use checksums |
3f4e7740cd149fd1a50c2b93359fe20826ddc9b46cc6792febdb7f084816ca08
|
|
BLAKE2b-256 checksum How to use checksums |
9361130b60525ae2fade30cd847cfc4e74b4318c778d01b29aca088e9dd66aa7
|
| 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 Sep 30, 2026.
Transparency logRelease files / lenskit-2026.4.0-cp312-abi3-manylinux_2_28_x86_64.whl
| Download URL | lenskit-2026.4.0-cp312-abi3-manylinux_2_28_x86_64.whl |
|---|---|
| Size | 11.2 MB |
| Tags | CPython 3.12 Linux glibc 2.28+ x86-64 abi3 |
|
SHA-256 checksum How to use checksums |
28bc581cb63f4ca6b031a58fa4b8493a2c7eef97a813727b164105daf4c4ac4b
|
|
BLAKE2b-256 checksum How to use checksums |
0be68a80b3bed83a9afc47a4f229142925d417c1cb72ec6717b047d29872f1ed
|
| 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 Sep 30, 2026.
Transparency logRelease files / lenskit-2026.4.0-cp312-abi3-manylinux_2_28_aarch64.whl
| Download URL | lenskit-2026.4.0-cp312-abi3-manylinux_2_28_aarch64.whl |
|---|---|
| Size | 10.5 MB |
| Tags | CPython 3.12 Linux glibc 2.28+ ARM64 abi3 |
|
SHA-256 checksum How to use checksums |
4e9d50316d3cd20bb86881ce3240e28f00ddea36c247b973bc890d2fa62f4235
|
|
BLAKE2b-256 checksum How to use checksums |
d0a6f23304aa7c664e24adb8e6466a25915b1b9141a944f57f45eb9c6a915ff4
|
| 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 Sep 30, 2026.
Transparency logRelease files / lenskit-2026.4.0-cp312-abi3-macosx_11_0_arm64.whl
| Download URL | lenskit-2026.4.0-cp312-abi3-macosx_11_0_arm64.whl |
|---|---|
| Size | 3.4 MB |
| Tags | CPython 3.12 abi3 macOS 11.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
07d57a01640193d457fdda04fe9d7ad09ca6c67d6e7ce3163c30d4107868aefa
|
|
BLAKE2b-256 checksum How to use checksums |
6138f39d5a82d4b10b4c8d67645389be39a4bf4cfe963bdd034e60fae57a16d9
|
| 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 Sep 30, 2026.
Transparency log