Skip to main content

LibreHPS — permissively-licensed human preference reward model for text-to-image and text-to-video generation.

Project description

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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

librehps-1.1.1.tar.gz (802.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

librehps-1.1.1-py3-none-any.whl (212.7 kB view details)

Uploaded Python 3

File details

Details for the file librehps-1.1.1.tar.gz.

File metadata

  • Download URL: librehps-1.1.1.tar.gz
  • Upload date:
  • Size: 802.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.13

File hashes

Hashes for librehps-1.1.1.tar.gz
Algorithm Hash digest
SHA256 fe1290f8f0ff4d4008ae1b7ed05d165a8de122080420778bf688cebf948f8b9b
MD5 c84c665974931c9c25062fbb04ff0997
BLAKE2b-256 076eea5aa7e64f5ed7c41f2a9b5ba40c917952f82da787364ce121c5271fe1e0

See more details on using hashes here.

File details

Details for the file librehps-1.1.1-py3-none-any.whl.

File metadata

  • Download URL: librehps-1.1.1-py3-none-any.whl
  • Upload date:
  • Size: 212.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.13

File hashes

Hashes for librehps-1.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 80d6993ce7b12cfa38dc8397439df35438da50870066c269747512a9f1dc55e3
MD5 dd38fdc9c062c635366b87b87331adf9
BLAKE2b-256 86a1518c403de3bce5522071143fb88eda9133d6a77509cae77ea53a3428d0cf

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page