Generate synthetic post-training datasets in TRL-native formats.
Project description
postsynth
Generate synthetic post-training datasets in TRL-native formats.
postsynth v1 focuses on conversational JSONL rows for common TRL workflows:
- SFT:
messages - DPO:
prompt,chosen,rejected - GRPO:
prompt - KTO:
prompt,completion,label
Install
uv sync --dev
Configure OpenRouter
Set your key in the environment:
export OPENROUTER_API_KEY="..."
For local development, you can also create a .env file:
OPENROUTER_API_KEY=...
.env files are ignored by git.
CLI
Generate from a seed instruction:
postsynth generate sft \
--seed "Customer-support chats about subscription billing." \
--count 100 \
--out data/generated/sft.jsonl
Generate from examples:
postsynth generate dpo \
--examples examples/dpo.jsonl \
--count 100 \
--out data/generated/dpo.jsonl
The CLI writes a JSONL dataset and a sibling dataset card, for example
sft.dataset.md, with non-secret generation metadata.
Python API
from postsynth import generate_sft
result = generate_sft(
seed="Math tutoring conversations for middle-school students.",
count=25,
output_path="data/generated/math_sft.jsonl",
)
print(result.rows)
TRL Loading
from datasets import load_dataset
dataset = load_dataset("json", data_files="data/generated/sft.jsonl")
The generated rows follow the conversational formats documented by TRL: https://huggingface.co/docs/trl/en/dataset_formats
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 postsynth-0.1.0.tar.gz.
File metadata
- Download URL: postsynth-0.1.0.tar.gz
- Upload date:
- Size: 7.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
95ceb159abbff189caa2dc7bd740850294f5f718adc253fcf522bb533328b0c6
|
|
| MD5 |
03f410cea17e676328516108ad273d1c
|
|
| BLAKE2b-256 |
aa46f705e61b4aa4c2a7dfbf5f1acb02768162ea01abef4c53d42021a1387e9d
|
Provenance
The following attestation bundles were made for postsynth-0.1.0.tar.gz:
Publisher:
publish.yml on wbrannock/postsynth
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
postsynth-0.1.0.tar.gz -
Subject digest:
95ceb159abbff189caa2dc7bd740850294f5f718adc253fcf522bb533328b0c6 - Sigstore transparency entry: 2028817467
- Sigstore integration time:
-
Permalink:
wbrannock/postsynth@6586a977f2fba6fb2fd6a78c01abf436a5a69fd7 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/wbrannock
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@6586a977f2fba6fb2fd6a78c01abf436a5a69fd7 -
Trigger Event:
release
-
Statement type:
File details
Details for the file postsynth-0.1.0-py3-none-any.whl.
File metadata
- Download URL: postsynth-0.1.0-py3-none-any.whl
- Upload date:
- Size: 11.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d24ab09d7c40a33194e616f3ce714e83c3f5883df5038a0ab19eaa245fe6c28d
|
|
| MD5 |
685ea9d4c9e2ece51420a7b0aa6b64de
|
|
| BLAKE2b-256 |
fb5c9062d1e3c95c45c266048421329ab92f44cdcab760710311560623850a97
|
Provenance
The following attestation bundles were made for postsynth-0.1.0-py3-none-any.whl:
Publisher:
publish.yml on wbrannock/postsynth
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
postsynth-0.1.0-py3-none-any.whl -
Subject digest:
d24ab09d7c40a33194e616f3ce714e83c3f5883df5038a0ab19eaa245fe6c28d - Sigstore transparency entry: 2028817664
- Sigstore integration time:
-
Permalink:
wbrannock/postsynth@6586a977f2fba6fb2fd6a78c01abf436a5a69fd7 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/wbrannock
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@6586a977f2fba6fb2fd6a78c01abf436a5a69fd7 -
Trigger Event:
release
-
Statement type: