Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
163 commits
Select commit Hold shift + click to select a range
4e36e15
feat: add deterministic preprocessing and dataset identity tracking
tani-dubey Feb 19, 2026
63182df
updated .coderabbit.yaml
tani-dubey Feb 21, 2026
3221575
resolved coderabbitai reviews
tani-dubey Feb 21, 2026
3204be2
Merge pull request #1 from Varshiniputtabakula/dataset-hashing-pr1
Archit381 Feb 21, 2026
180e33d
Merge branch 'main' into Preprocessing
tani-dubey Feb 21, 2026
106fd2d
Merge upstream/main
tani-dubey Feb 21, 2026
abadc03
Merge branch 'Preprocessing' of https://github.com/tani-dubey/OpenVer…
tani-dubey Feb 21, 2026
c959087
Refactor: move helper functions to utils.py, written tests, and clean…
tani-dubey Feb 22, 2026
5ab32d6
resolved coderabbitai reviews
tani-dubey Feb 22, 2026
bce705a
Address review feedback: remove __pycache__, delete requirements.txt,…
tani-dubey Feb 24, 2026
89041a0
docs: documentation for usage in tets and examples
tani-dubey Feb 24, 2026
c70d97d
Merge pull request #2 from tani-dubey/Preprocessing
Archit381 Feb 25, 2026
b970aed
adding merkel-root-tree-based-verification
aniket866 Feb 25, 2026
ce78958
Code rabbit follow up
aniket866 Feb 25, 2026
872e9a0
Code rabbit follow up
aniket866 Feb 25, 2026
e58ef1d
Code rabbit follow up
aniket866 Feb 25, 2026
593692a
Code rabbit follow-up
aniket866 Feb 25, 2026
5cb91e9
Merge pull request #3 from tani-dubey/code-rabbitai-configuration
Archit381 Feb 25, 2026
297f227
Modified-merkel-root-to-use-existing-SHA
aniket866 Feb 26, 2026
8b14fa9
Modified-merkel-root-to-use-existing-hash
aniket866 Feb 26, 2026
dbef17a
fixing-missing-doc-string
aniket866 Feb 26, 2026
28c4df3
Fix type annotation and finalize Merkle integration
aniket866 Feb 26, 2026
85d8e3f
generate_merkle_proof
aniket866 Feb 26, 2026
22bbd65
Code-rabbit-follow-up
aniket866 Feb 26, 2026
bfdf4f5
Changed file_path to data
aniket866 Feb 26, 2026
771c7a8
Changed file_path to data
aniket866 Feb 26, 2026
5a42947
merkel-proof-verification
aniket866 Feb 27, 2026
40e29d1
Update openverifiablellm/utils.py
aniket866 Feb 27, 2026
b934ad6
Code rabbit follow-up
aniket866 Feb 27, 2026
9c8039e
Code rabbit follow-up
aniket866 Feb 27, 2026
b358e27
Code rabbit follow-up
aniket866 Feb 27, 2026
d529308
Code rabbit follow-up
aniket866 Feb 27, 2026
e18f18d
changed file_path to optional byte_array and file_path
aniket866 Feb 27, 2026
99283f7
Merge pull request #8 from aniket866/Merkel-root
Archit381 Feb 27, 2026
5b26a43
Merge branch 'main' into Merkel-root-Proof
aniket866 Feb 27, 2026
7995029
Merge branch 'main' into export-proof
aniket866 Feb 27, 2026
faa4c98
Code
aniket866 Feb 27, 2026
75e9dac
Fixed all code rabbit suggestions (APPLIED)
aniket866 Feb 27, 2026
3ff759c
Code rabbit fix
aniket866 Feb 27, 2026
aaf3640
Apply pre-commit fixes
Shubhamx404 Feb 28, 2026
de31ae1
Merge pull request #10 from aniket866/Merkel-root-Proof
Archit381 Mar 1, 2026
d5c1c7a
Merge branch 'main' into export-proof
aniket866 Mar 1, 2026
e1c7c4a
Update openverifiablellm/utils.py
aniket866 Mar 1, 2026
65cecf8
Code rabbit follow up
aniket866 Mar 1, 2026
ef059da
Merge pull request #11 from aniket866/export-proof
Archit381 Mar 1, 2026
3b253f1
Merge pull request #16 from Shubhamx404/feature-utils-update
Archit381 Mar 1, 2026
c35bde4
completed the fingerprint of environments with tests
Arpitsh7 Mar 2, 2026
e8a2381
preprocessing-verification
aniket866 Mar 2, 2026
f83c8be
Code rabbit follow up
aniket866 Mar 2, 2026
88f9eaf
Code rabbit follow up
aniket866 Mar 2, 2026
ab043c2
Code
aniket866 Mar 2, 2026
a764822
Code rabbit follow-up
aniket866 Mar 2, 2026
9f7fa00
fix: resolve compute_sha256 signature mismatch in test_util.py
Arpitsh7 Mar 2, 2026
743116b
Improve XML extraction logic and update tests
Shubhamx404 Mar 3, 2026
d2bdcda
Merge pull request #28 from Arpitsh7/fix/compute-sha256-signature-mis…
Archit381 Mar 5, 2026
fb848e2
Merge branch 'main' into chore/push-current-changes
Shubhamx404 Mar 5, 2026
8015609
Merge pull request #29 from Shubhamx404/chore/push-current-changes
Archit381 Mar 5, 2026
f294056
Merge branch 'preprocessing-verification' of https://github.com/anike…
aniket866 Mar 5, 2026
9c1ed14
use-real-imports
aniket866 Mar 5, 2026
65722ed
Coderabbit fixes
aniket866 Mar 5, 2026
4f9fdd1
Merge pull request #25 from aniket866/preprocessing-verification
Archit381 Mar 5, 2026
0c5b159
refactor:made a combined test,test_environment and remove redudancy
Arpitsh7 Mar 5, 2026
a949331
Fix compute_sha256 usage and implement chained cryptographic commitments
Shubhamx404 Mar 5, 2026
12782df
chore: adopt uv for dependency management and configure ruff
ryoari Mar 5, 2026
474a1b5
style: apply ruff auto-fixes for import ordering and unused imports
ryoari Mar 5, 2026
4533a50
fix: resolve undefined variable bug in verify.py (F821)
ryoari Mar 5, 2026
456c3e5
ci: add ruff lint and format checks
ryoari Mar 5, 2026
69fc804
docs: add development setup guide
ryoari Mar 5, 2026
5fdc14e
pin uv version to 0.10.8
ryoari Mar 6, 2026
5b7adad
rename jobs in ci.yml to just lint as no test is given
ryoari Mar 6, 2026
718c805
ci: pin Python version to 3.9 for reproducibility
ryoari Mar 6, 2026
82ffba2
ci: uv sync lock to prevent it to rewrite itself
ryoari Mar 6, 2026
3686dc7
ci: lint fix
ryoari Mar 6, 2026
96a51f6
Fix NameError in verify_preprocessing caused by reproduced_manifest r…
tharunkumar4562 Mar 6, 2026
495f7f7
ci: trivial issue
ryoari Mar 7, 2026
b7f8494
fix: remove unused capsys and changed manifest test to tmp_path
Arpitsh7 Mar 7, 2026
c258e31
Merge pull request #23 from Arpitsh7/feature/fingerprint-environments
Archit381 Mar 7, 2026
9ef785a
ci: enabling cache for astral
ryoari Mar 7, 2026
c5186ae
Remove benchmark_custom.py from PR and update utils implementation
Shubhamx404 Mar 7, 2026
a2dafd4
readme: added developer setup section to readme
ryoari Mar 7, 2026
4e455e3
completed the fingerprint of environments with tests
Arpitsh7 Mar 2, 2026
b5153d3
refactor:made a combined test,test_environment and remove redudancy
Arpitsh7 Mar 5, 2026
cecc3c4
fix: remove unused capsys and changed manifest test to tmp_path
Arpitsh7 Mar 7, 2026
1d8f014
Delete docs/setup.md
Archit381 Mar 7, 2026
47a9147
ruff:fixed linting errors introduced by another PR
ryoari Mar 7, 2026
6e135dc
Merge branch 'main' into task/standardize-dev-env
ryoari Mar 7, 2026
34a63dc
feat: modular tokenizer architecture with BaseTokenizer and SentenceP…
Mar 7, 2026
21c5fd3
ruff:fixed linting errors
ryoari Mar 7, 2026
3a86856
Improve Merkle hashing implementation and update tests
Shubhamx404 Mar 7, 2026
d741214
Add malformed XML edge case test and fix verify.py regression
Shubhamx404 Mar 7, 2026
d22aa1b
chore: sync with main and fix lint issues
ryoari Mar 8, 2026
83e4d2d
fix: rabbit suggestions
ryoari Mar 8, 2026
6d368ec
chore: sync with main
ryoari Mar 8, 2026
ec31f3c
chore: sync with main
ryoari Mar 8, 2026
f4b4466
Merge branch 'task/standardize-dev-env' of https://github.com/ryoari/…
ryoari Mar 8, 2026
6c0e06b
coderabbit: suggestions implemented
ryoari Mar 8, 2026
cdc5036
ruff: fixing lint errors introduced
ryoari Mar 8, 2026
cb32625
coderabbit: suggestions implemented 2
ryoari Mar 8, 2026
69476ea
coderabbit: suggestions implemented 3
ryoari Mar 8, 2026
1c14fcb
coderabbit: minor fixes
ryoari Mar 8, 2026
5194635
ci: logic fixed for long term maintainence
ryoari Mar 8, 2026
f14c28e
coderabbit: applying fix
ryoari Mar 8, 2026
47103f4
ruff: reformat
ryoari Mar 8, 2026
7082511
coderabbit: sugesstions
ryoari Mar 8, 2026
3dfffed
coderabbit: trivial fix
ryoari Mar 8, 2026
e6ec855
coderabbit: minor fix
ryoari Mar 8, 2026
e923a03
Update openverifiablellm/verify.py
Shubhamx404 Mar 8, 2026
eacb635
coderabbit: issue solved
ryoari Mar 8, 2026
1893c31
fix: coderabbit suggestions
ryoari Mar 8, 2026
2831a2a
coderabbit: suggestions
ryoari Mar 8, 2026
11c073d
coderabbit fix
ryoari Mar 8, 2026
3f22492
coderabbit fix
ryoari Mar 8, 2026
6736e60
code rabbit fix
ryoari Mar 8, 2026
0d0626a
fixed coderabbit issue
Shubhamx404 Mar 8, 2026
50c1706
Fixed additional coderabbit issue
Shubhamx404 Mar 8, 2026
870df23
Merge pull request #17 from Varshiniputtabakula/feat-tokenizer-training
Archit381 Mar 9, 2026
f07ae20
Merge branch 'main' into task/standardize-dev-env
Archit381 Mar 9, 2026
35ce9dc
Merge pull request #43 from tharunkumar4562/fix-verify-manifest-bug
Archit381 Mar 9, 2026
1971e47
chore: sync with main and fix lint issues
ryoari Mar 9, 2026
65b39ab
chore: standardize development environment with uv and ruff
ryoari Mar 9, 2026
a6116d8
Merge branch 'task/standardize-dev-env' of https://github.com/ryoari/…
ryoari Mar 9, 2026
6f3e96d
fix: resolve remaining lint issues
ryoari Mar 9, 2026
12ae2ed
ci: updated logic
ryoari Mar 9, 2026
573ad01
Merge branch 'main' into fix-malformed-xml-test
Shubhamx404 Mar 9, 2026
f6dfae4
Update openverifiablellm/utils.py
Shubhamx404 Mar 9, 2026
681c851
Update openverifiablellm/utils.py
Shubhamx404 Mar 9, 2026
9c28b5a
Chain-linking
aniket866 Mar 9, 2026
e442106
Code rabbit follow up
aniket866 Mar 9, 2026
93ba434
Code-rabbit-follow-up
aniket866 Mar 9, 2026
6ac7c7d
Code rabbit follow up
aniket866 Mar 9, 2026
d6dd799
Initial
tani-dubey Mar 10, 2026
4db911c
Added environment_hash check
tani-dubey Mar 10, 2026
e1930a9
Merge pull request #34 from ryoari/task/standardize-dev-env
Archit381 Mar 10, 2026
a2dfd7a
Merge pull request #58 from tani-dubey/Verify-environment
Archit381 Mar 10, 2026
ee644bd
Merge upstream/main into chained-commitments-fix
Shubhamx404 Mar 10, 2026
1f1df92
Updated verification tests and config
Shubhamx404 Mar 10, 2026
a840b13
fix: sort imports in utils.py (ruff I001)
Shubhamx404 Mar 10, 2026
d589fc5
style: apply ruff format to utils.py and test_util.py
Shubhamx404 Mar 10, 2026
c94d335
testing with UV
aniket866 Mar 11, 2026
ff689a9
resume-preprocessing
aniket866 Mar 11, 2026
c352df0
Merge pull request #33 from Shubhamx404/chained-commitments-fix
Archit381 Mar 12, 2026
2ae4c5a
Merge branch 'main' into chain
aniket866 Mar 12, 2026
0b59f92
fixing-linting-issues
aniket866 Mar 12, 2026
824659f
ruff-format
aniket866 Mar 12, 2026
5cad61c
added-script
aniket866 Mar 12, 2026
8df62f8
added-script
aniket866 Mar 12, 2026
be86883
fixing-merge-conflicts
aniket866 Mar 16, 2026
5fbdff1
fixing-ci-fails
aniket866 Mar 16, 2026
672f071
fixing ruff formatting
aniket866 Mar 16, 2026
6b00bd4
Code rabbit follow up
aniket866 Mar 16, 2026
9fc7545
code rabbit fixes
aniket866 Mar 16, 2026
6286972
fixing ruff formatting
aniket866 Mar 16, 2026
d5ff5ef
Merge pull request #53 from aniket866/chain
Archit381 Mar 17, 2026
40e2f40
Merge branch 'main' into resume-preprocessing
aniket866 Mar 17, 2026
e2c3017
Code rabbit follow up
aniket866 Mar 17, 2026
e35f8ab
Code rabbit follow-up
aniket866 Mar 17, 2026
a754edd
Code rabbit follow-up
aniket866 Mar 17, 2026
66bbeab
fixing-comput_sha
aniket866 Mar 17, 2026
173cdd5
Merge pull request #68 from aniket866/resume-preprocessing
Archit381 Mar 17, 2026
b8b81af
Merge main into fix-malformed-xml-test and resolve conflicts
Shubhamx404 Mar 17, 2026
c1a4ef7
style: run formatter to fix CI lint issue
Shubhamx404 Mar 17, 2026
578bc79
Merge pull request #49 from Shubhamx404/fix-malformed-xml-test
Archit381 Mar 17, 2026
0d73682
refactor: deduplicate _canonical_json into shared _hashing module
c-sus-sus Mar 21, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion .coderabbit.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,8 @@ reviews:
- Confirm that the code meets the project's requirements and objectives
- Confirm that copyright years are up-to date whenever a file is changed
- Point out redundant obvious comments that do not add clarity to the code
- Ensure that comments are concise and suggest more concise comment statements if possible
- Discourage usage of verbose comment styles such as NatSpec
- Look for code duplication
- Suggest code completions when:
- seeing a TODO comment
Expand Down Expand Up @@ -275,4 +277,4 @@ reviews:
- Image optimization (appropriate size and format)
- Proper @2x and @3x variants for different screen densities
- SVG assets are optimized
- Font files are licensed and optimized
- Font files are licensed and optimized
50 changes: 50 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
name: CI

on:
push:
branches: [main]
pull_request:
branches: [main]

jobs:
lint:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Install uv
uses: astral-sh/setup-uv@v7
with:
version: "0.10.8"
enable-cache: true


- name: Set up Python
run: uv python install 3.10 && uv venv --python 3.10

- name: Install dependencies
run: uv sync --locked

- name: Run Ruff Check
run: |
if [ "${{ github.event_name }}" == "pull_request" ]; then
git fetch origin main
git diff --diff-filter=ACMR --name-only -z origin/main...HEAD -- '*.py' \
| xargs -0 -r uv run ruff check --
else
uv run ruff check .
fi

- name: Run Ruff Format
run: |
if [ "${{ github.event_name }}" == "pull_request" ]; then
git fetch origin main
git diff --diff-filter=ACMR --name-only -z origin/main...HEAD -- '*.py' \
| xargs -0 -r uv run ruff format --check --
else
uv run ruff format --check .
fi
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -324,8 +324,13 @@ TSWLatexianTemp*
# option is specified. Footnotes are the stored in a file with suffix Notes.bib.
# Uncomment the next line to have this generated file ignored.
#*Notes.bib

data/
*.egg-info/
__pycache__/
*.pyc
*.pyo
*.pyd
*.bz2

*.venv
15 changes: 14 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -245,6 +245,19 @@ TODO: Add screenshots showcasing your application
|---|---|---|
| Screenshot 1 | Screenshot 2 | Screenshot 3 |

---
# Developer Setup
This project uses `uv` for dependency management.

## Installation
1. Install [uv](https://github.com/astral-sh/uv).
2. Run `uv sync` to install dependencies and create a virtual environment.

## Linting
We use `ruff` to maintain code quality.
- Run checks: `uv run ruff check .`
- Auto-fix issues: `uv run ruff check . --fix`

---

## 🙌 Contributing
Expand Down Expand Up @@ -277,4 +290,4 @@ Thanks a lot for spending your time helping TODO grow. Keep rocking 🥂

[![Contributors](https://contrib.rocks/image?repo=AOSSIE-Org/TODO)](https://github.com/AOSSIE-Org/TODO/graphs/contributors)

© 2025 AOSSIE
© 2025 AOSSIE
21 changes: 21 additions & 0 deletions examples/demo_util.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import logging
import sys

from openverifiablellm.utils import extract_text_from_xml

logger = logging.getLogger(__name__)

"""
Demo for preprocessing pipeline.

Run with:
python -m examples.demo_util examples\sample_wiki.xml.bz2
"""

if __name__ == "__main__":
if len(sys.argv) < 2:
print("Usage: python -m examples.demo_util <input_dump>")
sys.exit(1)

logging.basicConfig(level=logging.INFO, format="%(levelname)s - %(message)s")
extract_text_from_xml(sys.argv[1])
12 changes: 0 additions & 12 deletions examples/hash_demo.py

This file was deleted.

18 changes: 18 additions & 0 deletions examples/sample_wiki.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import bz2

xml_content = """<?xml version="1.0" encoding="UTF-8"?>
<mediawiki>
<page>
<revision>
<text>
Hello <ref>citation</ref> world.
This is [[Python|programming language]]
{{Wikipedia }}is a free online encyclopedia.
</text>
</revision>
</page>
</mediawiki>
"""

with bz2.open("examples/sample_wiki.xml.bz2", "wt", encoding="utf-8") as f:
f.write(xml_content)
3 changes: 0 additions & 3 deletions examples/sample_wiki.txt

This file was deleted.

Binary file added examples/sample_wiki.xml.bz2
Binary file not shown.
29 changes: 29 additions & 0 deletions openverifiablellm/_hashing.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
"""
_hashing.py
===========
Shared low-level hashing utilities used across the openverifiablellm package.

These are intentionally kept small and dependency-free so they can be safely
imported from any module without risk of circular imports.
"""

import json
from typing import Any


def _canonical_json(obj: Any) -> str:
"""
Serialize object into canonical JSON format.
Ensures stable hashing across runs regardless of key order.

Parameters
----------
obj : Any
JSON-serializable object

Returns
-------
str
Canonical JSON string with sorted keys
"""
return json.dumps(obj, sort_keys=True, separators=(",", ":"))
31 changes: 0 additions & 31 deletions openverifiablellm/dataset_hash.py

This file was deleted.

101 changes: 101 additions & 0 deletions openverifiablellm/environment.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,101 @@
import hashlib
import platform
import subprocess
import sys
from typing import Any, Dict

from openverifiablellm._hashing import _canonical_json


def compute_object_hash(obj: Any) -> str:
"""
Compute SHA-256 hash of a JSON-serializable object.
Uses canonical JSON serialization to ensure stable, order-independent hashing.
"""
canonical = _canonical_json(obj)
return hashlib.sha256(canonical.encode("utf-8")).hexdigest()


def collect_environment_metadata() -> Dict[str, Any]:
"""
Collect runtime environment metadata relevant to training.
"""
env: Dict[str, Any] = {}

# Python + OS
env["python_version"] = sys.version
env["platform"] = platform.platform()

# PyTorch + CUDA
try:
import torch

env["pytorch_version"] = torch.__version__
env["cuda_version"] = torch.version.cuda
try:
env["cudnn_version"] = torch.backends.cudnn.version()
except (AttributeError, ImportError, RuntimeError):
env["cudnn_version"] = None

# GPU info
if torch.cuda.is_available():
env["gpu_name"] = torch.cuda.get_device_name(0)
props = torch.cuda.get_device_properties(0)
env["gpu_properties"] = {
"total_memory": props.total_memory,
"multi_processor_count": props.multi_processor_count,
"compute_capability_major": props.major,
"compute_capability_minor": props.minor,
}
else:
env["gpu_name"] = None
env["gpu_properties"] = None
except ImportError:
env["pytorch_version"] = None
env["cuda_version"] = None
env["cudnn_version"] = None
env["gpu_name"] = None
env["gpu_properties"] = None

# NVIDIA driver
try:
driver_output = subprocess.check_output(
["nvidia-smi", "--query-gpu=driver_version", "--format=csv,noheader"],
stderr=subprocess.DEVNULL,
text=True,
)
drivers = sorted(
list(set(line.strip() for line in driver_output.splitlines() if line.strip()))
)
env["nvidia_driver"] = ", ".join(drivers)
except Exception:
env["nvidia_driver"] = None

# Installed packages
try:
packages = subprocess.check_output(
[sys.executable, "-m", "pip", "freeze"],
stderr=subprocess.DEVNULL,
text=True,
).splitlines()

packages.sort()
env["pip_packages"] = packages
except Exception:
env["pip_packages"] = []

return env


def generate_environment_fingerprint() -> Dict[str, Any]:
"""
Generate environment metadata + environment_hash.
Returns a dictionary that can be embedded into existing manifest.
"""
metadata = collect_environment_metadata()
environment_hash = compute_object_hash(metadata)

return {
"environment": metadata,
"environment_hash": environment_hash,
}
30 changes: 30 additions & 0 deletions openverifiablellm/eval/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
"""
openverifiablellm.eval
======================

Evaluation framework for OpenVerifiableLLM.

Provides pluggable evaluators for perplexity, bias, and benchmark tasks,
all built on top of the abstract ``BaseEvaluator`` interface.

Available evaluators
--------------------
- :class:`~openverifiablellm.eval.perplexity.PerplexityEvaluator`
Measures cross-entropy perplexity on a held-out text corpus.
- :class:`~openverifiablellm.eval.bias.BiasEvaluator`
Bias-testing stub (WinoBias / BBQ — integration pending).
- :class:`~openverifiablellm.eval.benchmarks.BenchmarkEvaluator`
MMLU / factual-accuracy stub (lm-eval-harness — integration pending).
"""

from .base import BaseEvaluator
from .benchmarks import BenchmarkEvaluator
from .bias import BiasEvaluator
from .perplexity import PerplexityEvaluator

__all__ = [
"BaseEvaluator",
"PerplexityEvaluator",
"BiasEvaluator",
"BenchmarkEvaluator",
]
Loading
Loading