Skip to main content

Prerequisites

  • Python 3.12 or newer.
  • An SDVM account. Create one at sdvm.ai and add credits on your profile page.

Installation

To run the dataset walkthroughs in examples/, add the extra: pip install "sdvm[examples]".

Get an API key

Create a key on your profile page. It is shown once, so store it right away. The examples read it from an environment variable.
Keep keys out of source control. Every client accepts api_key= directly, but reading it from the environment is the pattern used throughout these docs.

Fix your first samples

Wrap each string as a TextSample, pass the list to Fixer.run, and get fixed samples back.
sels, shor and no were corrected because they are genuine misspellings, while the missing capitals, wanna, da, b and tmrw stayed: they are how the author writes, not mistakes. See what a fix will not do. Up to 100 samples go in one request.

Audit before you fix

For multiple-choice data, run the Auditor first. Each sample comes back with its verdicts on .audit, and Auditor.aggregate gives a local, dataset-level view.

Run the whole loop

Refinery runs sdvm-audit-1, sdvm-fix-1 and sdvm-audit-1 again in one call. Each sample comes back with .audit (the verdict before the fix), .fix (what changed) and .reaudit (the verdict after it, which tells you whether the fix helped).

Next steps

Core concepts

What the audit, fix and reaudit blocks mean.

Multiple choice

Completion stems versus questions, and why the type matters.

Dataset conventions

Stop the audit flagging formatting that is a convention, not a defect.

Denoising with votes

Majority-vote the verdicts where one has to be stable.

Error handling

The exception hierarchy and what each status code means.

Examples

HellaSwag and MMLU walkthroughs that ship with the SDK.
Last modified on September 18, 2026