Skip to main content

LibreHPS

LibreHPS is a permissively-licensed reward model for text-to-image and text-to-video generation. It looks at a generated image or short video and a text prompt and predicts how a human reviewer would rate the match — useful for picking the best of N samples, training another generator with reinforcement learning from feedback, or running an automated benchmark.

This is the source-code repository. The trained model weights live on Hugging Face: LibreHPS/LibreHPS-4B-v1.1.

Install

To use the model:

pip install librehps
from librehps import LibreHPS

scorer = LibreHPS.from_pretrained("LibreHPS/LibreHPS-4B-v1.1")
result = scorer.score_image(image="photo.png", prompt="a cat sitting on a windowsill")
print(result.overall.mean)

By default the loader uses Flash Attention 4 on CUDA Blackwell when available, and falls back to stock attention (SDPA / eager) on any other CUDA / CPU / MPS device. See the model card on Hugging Face for the full inference surface, including pair-wise comparison with calibrated probabilities.

Develop from source

Python 3.12 is required.

pyenv local 3.12
python -m venv venv
. venv/bin/activate
pip install -U pip setuptools wheel
pip install torch==2.11.0+cu130 torchvision torchaudio \
    --index-url https://download.pytorch.org/whl/cu130
pip install -e '.[dev]'
pytest

Flash Attention 4 is built from source for the fastest training / inference on Blackwell (sm_100). It is NOT required for inference — librehps/inference.py falls back to stock Qwen3.5 attention when FA4 isn't available — but training does require it. Build instructions are in docs/INSTALL.md.

Repository layout

Path Contents
librehps/ The Python package (model, dataset, training, inference, evaluation).
docs/ Architecture and design documents. docs/PLAN.md is the top-level project plan; docs/DATA_PROVENANCE.md is the dataset audit.
scripts/ CLI tools — index builder, dataset downloaders, release bundler, benchmark runners.
tests/ Test suite. Most tests run on CPU; integration tests are gated behind LIBREHPS_INTEGRATION_* env vars.
reports/ Evaluation outputs from past training and benchmark runs.
release/ Per-version release directories. The current production release is release/LibreHPS-4B-v1.1/, which is what gets uploaded to Hugging Face.

Acknowledgement

LibreHPS is inspired by and architecturally influenced by HPSv3 (Ma, Shui, Wu, Sun, Li — ICCV 2025). LibreHPS is a from-scratch reimplementation with a different backbone, training stack, and permissively-licensed training data mix.

License

  • Source code: MIT.
  • Model weights: Apache-2.0.
  • Training data: permissive union (MIT / Apache-2.0 / BSD-3-Clause / CDLA-Permissive-2.0). See docs/DATA_PROVENANCE.md for the per-dataset audit and the per-image generator-redistribution audit applied to filter the training mix.

Copyright © 2026 Jeff Moe.

Loveland, Colorado, USA

Metadata

Release files for librehps 1.1.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for librehps 1.1.2
File Size Uploaded Provenance Actions
librehps-1.1.2.tar.gz 803.7 kB Without provenance Details for librehps-1.1.2.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for librehps 1.1.2
File Interpreter ABI Platform Actions
librehps-1.1.2-py3-none-any.whl Python 3 none any Details for librehps-1.1.2-py3-none-any.whl

Total release size: 1.0 MB

Release files / librehps-1.1.2.tar.gz

Download URL librehps-1.1.2.tar.gz
Size 803.7 kB
Tags Source
SHA-256 checksum
How to use checksums
1f5ab7f6540ae3dd0102c2f877650fd1a251b9057a4be516241de77661c03e23
BLAKE2b-256 checksum
How to use checksums
173f2e207a515eebfe953530b6882a580e3024d2e6eb7cd2c5f4f9f994246f47
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.13

Release files / librehps-1.1.2-py3-none-any.whl

Download URL librehps-1.1.2-py3-none-any.whl
Size 214.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
c87e103735cc7ed0d7e447d249d02d1aec95d67eacefff8d7f5e56b04b9822f9
BLAKE2b-256 checksum
How to use checksums
4c890b70a99d70c913a865600eaec0c75e6f19384da718c78f54f5f611fa2665
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.13

Security for librehps 1.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.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A 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.

Release history Release notifications | RSS feed

This release

1.1.2 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page