A Python library for inference-time scaling LLMs
Project description
its-hub: A Python library for inference-time scaling
its_hub is a Python library for inference-time scaling of LLMs, focusing on mathematical reasoning tasks.
📚 Documentation
For comprehensive documentation, including installation guides, tutorials, and API reference, visit:
https://ai-innovation.team/its_hub
Quick Start
from its_hub.utils import SAL_STEP_BY_STEP_SYSTEM_PROMPT
from its_hub.lms import OpenAICompatibleLanguageModel, StepGeneration
from its_hub.algorithms import ParticleFiltering
from its_hub.integration.reward_hub import LocalVllmProcessRewardModel
# Initialize language model (requires vLLM server)
lm = OpenAICompatibleLanguageModel(
endpoint="http://localhost:8000/v1",
api_key="NO_API_KEY",
model_name="Qwen/Qwen2.5-Math-1.5B-Instruct",
system_prompt=SAL_STEP_BY_STEP_SYSTEM_PROMPT,
)
# Set up inference-time scaling
sg = StepGeneration("\n\n", 32, r"\boxed")
prm = LocalVllmProcessRewardModel(
model_name="Qwen/Qwen2.5-Math-PRM-7B",
device="cuda:0",
aggregation_method="prod"
)
scaling_alg = ParticleFiltering(sg, prm)
# Solve with inference-time scaling
result = scaling_alg.infer(lm, "Solve x^2 + 5x + 6 = 0", budget=8)
Installation
# Production
pip install its_hub
# Development
git clone https://github.com/Red-Hat-AI-Innovation-Team/its_hub.git
cd its_hub
pip install -e ".[dev]"
Key Features
- 🔬 Multiple Algorithms: Particle Filtering, Best-of-N, Beam Search, Self-Consistency
- 🚀 OpenAI-Compatible API: Easy integration with existing applications
- 🧮 Math-Optimized: Built for mathematical reasoning with specialized prompts
- 📊 Benchmarking Tools: Compare algorithms on MATH500 and AIME-2024 datasets
- ⚡ Async Support: Concurrent generation with limits and error handling
Development
git clone https://github.com/Red-Hat-AI-Innovation-Team/its_hub.git
cd its_hub
pip install -e ".[dev]"
pytest tests
For detailed documentation, visit: https://ai-innovation.team/its_hub
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file its_hub-0.3.2.tar.gz.
File metadata
- Download URL: its_hub-0.3.2.tar.gz
- Upload date:
- Size: 100.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d52c85d42a7ad63642b767fa0e3cf9fc0bbc426a9df1649f00421c9a5e43bcee
|
|
| MD5 |
3df80b495bd02aa1e63e0fd9db03fcc5
|
|
| BLAKE2b-256 |
66b3b15d5cf3d2349568183d8d2783c1f850dd5fae331d2e58eda0fc6c6f7bc3
|
Provenance
The following attestation bundles were made for its_hub-0.3.2.tar.gz:
Publisher:
release.yaml on Red-Hat-AI-Innovation-Team/its_hub
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
its_hub-0.3.2.tar.gz -
Subject digest:
d52c85d42a7ad63642b767fa0e3cf9fc0bbc426a9df1649f00421c9a5e43bcee - Sigstore transparency entry: 628793250
- Sigstore integration time:
-
Permalink:
Red-Hat-AI-Innovation-Team/its_hub@25d88027e2ecac18d0a287724170da27d2060794 -
Branch / Tag:
refs/tags/v0.3.2 - Owner: https://github.com/Red-Hat-AI-Innovation-Team
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yaml@25d88027e2ecac18d0a287724170da27d2060794 -
Trigger Event:
release
-
Statement type:
File details
Details for the file its_hub-0.3.2-py3-none-any.whl.
File metadata
- Download URL: its_hub-0.3.2-py3-none-any.whl
- Upload date:
- Size: 43.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
81a42b78a0181d23e50d2df5d62a46f729f3706b4c7c53e94ef8bd01bca36311
|
|
| MD5 |
355b32fe85bd886c7848bfe797ae462b
|
|
| BLAKE2b-256 |
55c21083d48ab060b7c9e7144f600434fbbc8d7794ff6771f7549c7dcfc6cce0
|
Provenance
The following attestation bundles were made for its_hub-0.3.2-py3-none-any.whl:
Publisher:
release.yaml on Red-Hat-AI-Innovation-Team/its_hub
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
its_hub-0.3.2-py3-none-any.whl -
Subject digest:
81a42b78a0181d23e50d2df5d62a46f729f3706b4c7c53e94ef8bd01bca36311 - Sigstore transparency entry: 628793253
- Sigstore integration time:
-
Permalink:
Red-Hat-AI-Innovation-Team/its_hub@25d88027e2ecac18d0a287724170da27d2060794 -
Branch / Tag:
refs/tags/v0.3.2 - Owner: https://github.com/Red-Hat-AI-Innovation-Team
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yaml@25d88027e2ecac18d0a287724170da27d2060794 -
Trigger Event:
release
-
Statement type: