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.1

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.1
File Interpreter ABI Platform
opake_transformers-0.16.1-py3-none-any.whl Python 3 none any Details

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

Download URL opake_transformers-0.16.1-py3-none-any.whl
Size 202.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
7d739095e4c4747b332d9072432b1795ee63cf9d05908a9b86fa908bd22576cd
BLAKE2b-256 checksum
How to use checksums
ce0ac4d49e895127dee72c79826546ab4a4f7ad2747e487a7fc41158bb7b115e
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 Oct 13, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

0.16.1 This release

1 release file

0.16.0

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