Skip to main content

opake-transformers

Hugging Face trainer integration for Opake: DP-aware training loop (opake.transformers.trainer.DPTrainer) with TRL-style SFT/DPO support (opake.transformers.trl) and Hugging Face compatibility layers.

Install

Install the root package as described in the repository installation guide. Use its transformers extra for trainer integration or trl for TRL config conversion.

Depends on opake-engine, opake-patches, opake-dpsgd, opake-dpftrl, opake-accounting, opake-optimizers, opake-alignment, plus transformers>=5.0, peft>=0.13, and datasets>=2.0.

For Triton fused kernels (RoPE, RMSNorm, activation, cross-entropy), install opake-patches[transformers] — kernels are a dependency of opake-patches and gate on CUDA + Triton at runtime.

Quick start

Runtime compat patches (vmap-safe masking, collator / checkpoint hooks) are applied when you construct :class:opake.transformers.trainer.DPTrainer, or when you call :func:opake.patches.apply_runtime_patches explicitly (e.g. in a notebook that uses HF primitives without the trainer).

from opake.patches import apply_runtime_patches, is_runtime_patched
from opake.transformers import DPTrainer

apply_runtime_patches(compat=True)  # global runtime shims — idempotent
trainer = DPTrainer(
    model, args, ...
)  # runtime compat + apply_model_patches on the model

assert is_runtime_patched()

Layout

  • opake.api.transformers.trainer — DPTrainer implementation (_dp_trainer.py, _config.py, _state.py, _optim.py, _scheduler.py, _checkpoint.py, _distributed.py, _performance_kernels.py, …).
  • opake.transformers / opake.transformers.trainer — thin re-export façades (same pattern as opake-engine: opake.api.* for implementation, opake.* for stable imports).
  • opake.patches.transformers — vmap-safe runtime patches and optional Triton kernel hooks (see opake.patches).

Metadata

Release files for opake-transformers 0.16.0

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

Built distribution (wheel)

Table of built distributions (wheels) for opake-transformers 0.16.0
File Interpreter ABI Platform
opake_transformers-0.16.0-py3-none-any.whl Python 3 none any Details

Release files / opake_transformers-0.16.0-py3-none-any.whl

Download URL opake_transformers-0.16.0-py3-none-any.whl
Size 200.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
dcb192a950f6eaf6dd382dd4fca761a2d9d8f425e9fc8cb61f31a4b6da59fdb2
BLAKE2b-256 checksum
How to use checksums
5ab44cd399257b70ffdce5b9b4f68e98c59dad1e45d26e22ecbca940ccf391fe
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 23, 2026.

Transparency log

Release history Release notifications | RSS feed

0.16.1

1 release file

This release

0.16.0 This release

1 release file

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