Metadata-Version: 2.4
Name: gepa-dapo-grn
Version: 0.1.0
Summary: GEPA-aware DAPO reinforcement learning with optional Global Response Normalization
Author: InfiniteMalice
License: MIT
Project-URL: Homepage, https://github.com/InfiniteMalice/gepa-dapo-grn
Project-URL: Repository, https://github.com/InfiniteMalice/gepa-dapo-grn
Project-URL: Issues, https://github.com/InfiniteMalice/gepa-dapo-grn/issues
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Science/Research
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
Requires-Python: >=3.9
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: torch<3.0,>=2.0
Provides-Extra: hf
Requires-Dist: transformers<5.0,>=4.40; extra == "hf"
Provides-Extra: dev
Requires-Dist: pytest; extra == "dev"
Requires-Dist: ruff; extra == "dev"
Requires-Dist: black; extra == "dev"
Dynamic: license-file

# gepa-dapo-grn

`gepa-dapo-grn` is a standalone reinforcement learning engine for research workflows. It is
GEPA-shaped but GEPA-agnostic, providing DAPO optimization, curriculum tracking, safety
controls, and optional Global Response Normalization (GRN) without coupling to any external
GEPA repositories.

## What this library is

- **Standalone RL engine** with a stable public API under `gepa_dapo_grn.*`.
- **GEPA-shaped but GEPA-agnostic**: feedback is just structured reward/tag dictionaries.
- **Supports DAPO + curriculum + safety + GRN** with conservative defaults and GRN disabled
  unless explicitly enabled.

## Install

```bash
pip install gepa-dapo-grn
```

Optional extras:

- `gepa-dapo-grn[hf]` adds HuggingFace integration helpers.
- `gepa-dapo-grn[dev]` installs test and formatting tools.

## Minimal example (CPU-safe)

```python
from gepa_dapo_grn import (
    DAPOTrainer,
    DAPOConfig,
    RewardMixerConfig,
    GEPAFeedback,
)

# minimal fake feedback example
fb = GEPAFeedback(
    rewards={"truth": 1.0, "harm": -0.5},
    tags={},
    meta={"task_id": "demo"},
    abstained=False,
)
```

## Public API

Public API is defined by `__init__.py` exports. Anything not exported there is considered
internal and may change without notice.

## What this library intentionally does NOT do

- ship datasets
- provide prompt logic
- implement scoring logic
- encode opinions on ethics or safety policy

## Versioning policy

This project follows semantic versioning:

- `0.x.y` while interfaces are still evolving
- bump **minor** for interface changes
- bump **patch** for bugfixes only

See [CHANGELOG.md](CHANGELOG.md) for release notes.

## PyPI publishing checklist

1. Install build and upload tooling:

   ```bash
   pip install build twine
   ```

2. Build artifacts:

   ```bash
   python -m build
   ```

3. Check distributions:

   ```bash
   twine check dist/*
   ```

4. Upload to TestPyPI first:

   ```bash
   twine upload --repository testpypi dist/*
   ```

5. Install from TestPyPI to validate:

   ```bash
   pip install -i https://test.pypi.org/simple/ gepa-dapo-grn
   ```

6. Upload to PyPI:

   ```bash
   twine upload dist/*
   ```

## License

MIT (see [LICENSE](LICENSE)).
