dfm-sdg is a small framework for synthetic data generation.
It keeps the shared layer thin and puts method-specific logic in packs.
sdg/commons/: shared runtime code for runs, artifacts, model clients, publishing, viewer support, and pack discoverysdg/packs/demo/: tiny reference pack showing the full flow end to endsdg/packs/backtranslation/: backtranslation-style data generation from finished textssdg/packs/translation/: translation prompt-surface generation from Danish-English parallel corporasdg/packs/synth/: the main synthesis pack for memory-core building, memorization, grounded QA, and related workflowssdg/packs/verifiable_reasoning/: starter scaffold for exactly checkable reasoning families, starting with logic puzzlessdg/packs/instruction_following/: expanded IFBench-style instruction-following rows with deterministic verificationsdg/packs/multi_turn_dialogue/: blueprint-first multi-turn dialogues with skeletons, review, verification, and preference pairssdg/packs/tool_use/: starter scaffold for structured tool-calling rows and validatorssdg/packs/python_algorithms/: starter scaffold for code-generation tasks with executable checkstests/: pack tests and shared runtime testsartifacts/runs/<pack>/<run-id>/: local run outputs, logs, progress snapshots, and generated datasetsreports/<pack>/<run-id>/: published outputs such as parquet exports and reports
This project targets Python 3.13 and uses uv.
uv sync --dev
uv run sdg list-packs
uv run sdg build sdg/packs/demo/configs/base.yaml
uv run sdg build sdg/packs/backtranslation/configs/base.yaml
uv run sdg build sdg/packs/translation/configs/base.yaml
uv run sdg build sdg/packs/synth/configs/smoke.yaml
uv run sdg build sdg/packs/verifiable_reasoning/configs/base.yaml
uv run sdg build sdg/packs/instruction_following/configs/ifbench.yaml
uv run sdg build sdg/packs/multi_turn_dialogue/configs/base.yaml
uv run sdg build sdg/packs/multi_turn_dialogue/configs/base_da.yaml
uv run sdg build sdg/packs/tool_use/configs/base.yaml
uv run sdg build sdg/packs/python_algorithms/configs/base.yamlRun a config:
uv run sdg build sdg/packs/backtranslation/configs/base.yamlInspect a run while it is running or after it completes:
uv run sdg progress <run-id>
uv run sdg summarize <run-id>
uv run sdg view <run-id>
uv run sdg serve <run-id> --openVerify and publish:
uv run sdg verify <run-id>
uv run sdg publish <run-id>Upload a file artifact from a run to Hugging Face:
uv run sdg upload-hf <run-id> --artifact dataset --repo <org/name> --privateIn practice there are three common ways to add something:
- add a new config when the task fits an existing pack and existing code path
- add a new task/profile inside a pack when the runtime is shared but the source normalization or prompting changes
- add a new pack when the workflow, artifacts, or verification logic is genuinely different
As a rule:
- keep pack-specific logic inside
sdg.packs.<name> - keep shared runtime and generic helpers in
sdg.commons - prefer small configs over branching one config for many unrelated tasks
Packs live under sdg/packs/<name>.
Start by copying the shape of sdg/packs/demo:
- add
pack.yamlwithbuild,verify,summarize, andpublishentrypoints - add one config under
configs/so the pack is runnable from the CLI - keep pack-specific logic inside
sdg.packs.<name>.*modules and call intosdg.commons.*only for shared concerns like runs, storage, publishing, model clients, and viewer helpers - add a
README.mdthat explains the pack's scope and current status - add a
viewerentrypoint only if the default viewer needs pack-specific labels, sections, filters, or a default artifact
Minimal pack.yaml:
name: my_pack
description: Short pack description.
entrypoints:
build: sdg.packs.my_pack.build:build
verify: sdg.packs.my_pack.build:verify
summarize: sdg.packs.my_pack.build:summarize
publish: sdg.packs.my_pack.build:publishThen add a test like tests/test_demo_pack.py that exercises build, verify, summarize, publish, and view for the new pack.
Model-backed steps load named endpoints from .env.
Use pack configs to bind model roles to those named endpoints.
If you want to upload to Hugging Face, make sure the machine is logged in with a token that has write access to the target repo or org.
uv run ruff check .
uv run pytest