> ## Documentation Index
> Fetch the complete documentation index at: https://docs.stateset.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Industry data and fine-tuning

> Generate replayable ecommerce, logistics, and SaaS corpora, audit split provenance, and prepare reviewed SFT projects with captured source lineage.

Industry recipes use the same SFT pipeline with separate data and adapters. They are task
templates, not pretrained domain agents or proof of business outcomes. The current checkout
adds deterministic synthetic corpora for ecommerce, logistics, and SaaS support.

## Generate and audit without compute

```bash theme={null}
stateset-agents industry generate all --output outputs/industry-datasets --seed 42
stateset-agents industry audit-datasets outputs/industry-datasets
stateset-agents industry train outputs/industry-datasets/ecommerce --dry-run
stateset-agents industry train outputs/industry-datasets/logistics --dry-run
stateset-agents industry train outputs/industry-datasets/saas --dry-run
```

Generation, audit, and these previews use no model or provider. Use a new output directory.
Default per-domain counts are **512 train, 64 validation, and 128 reserved test**
conversations across eight balanced families per split. Counts can be changed in multiples
of eight; generating data does not train weights.

| Domain | Example coverage | Recipe mapping |
| - | - | - |
| `ecommerce` | Refund amounts, duplicates, return boundaries, chargebacks, misleading notes | `retail` |
| `logistics` | Verification, label/dispatch distinction, address changes, late/lost/delivered parcels | `logistics` |
| `saas` | Tenant verification, role boundaries, incidents, quotas, billing, troubleshooting | `technology` |

Each domain retains train/validation/test JSONL, private synthetic cases, and a training
manifest; the root manifest binds all artifacts. The audit reconstructs the corpora, replays
teacher actions, and checks provenance/hashes. Declared status is `synthetic: true` and
`not_independently_reviewed`. No actual shipment, refund, or account setting changes.

## Preserve split roles

Use only `train.jsonl` for optimization. Validation supports selection; reserve test for
a separately frozen assessment. The studio, packaged SFT loader, industry training, and
local-source provider preflights reject declared held-out or ambiguous training rows.
Top-level `split` and `metadata.split` must agree; duplicate JSON keys fail the read.

Renaming a held-out file does not change its declared role. Removing or falsifying
annotations cannot be detected from an isolated file, so retain and audit the complete
bundle. Exact source/case overlap checks do not prove semantic or temporal independence.
The current teacher-forced industry evaluator continues to reject synthetic data for its
quality gate.

## Prepare a reviewed source project

```bash theme={null}
stateset-agents industry list
stateset-agents industry init retail ./retail-source
stateset-agents industry validate ./retail-source/examples.jsonl
stateset-agents industry prepare retail ./retail-source/examples.jsonl ./retail-run \
  --model qwen3.5-2b --validation-fraction 0.2 --seed 42
stateset-agents industry train ./retail-run --dry-run
```

The initialized examples are synthetic demonstrations. Replace or expand them with
reviewed source conversations before making quality claims. Preparation writes new split
files and a manifest; editing the files afterwards invalidates training. Use a new project
directory after edits. Supply `--model-revision` with the real immutable model commit for
reproducible tokenizer and weight loading.

Records require text `messages` ending in an assistant target. The industry contract also
supports developer/tool roles and OpenAI-style tools/tool calls with matching result IDs;
this is broader than the studio's text-only alternating chat form. Multimodal message
content is outside this workflow. The model's actual chat template must support the data.

Use a stable `group_id` for the same case/customer/source conversation. Exact duplicates
are removed, and matching initial user requests or group IDs stay together, including
transitive connections. At least two independent groups are required. The split fraction
applies to groups, so row proportions can differ.

## Execute and inspect lineage

On a configured CUDA host with the training dependencies, remove `--dry-run` to execute the
industry SFT trainer. CPU previews remain planned; they never report a trained adapter.
Dataset split seed and training seed have different roles; retain both.

Local SFT captures source bytes, parsed training content, source-line counts, and effective
rows before model loading. Industry training checks that capture against the project
manifest, while studio workers check their reviewed plan. The export retains source/content
lineage even if the original file is later changed or deleted. Source-free in-memory inputs
remain explicitly unbound to a file.

The run becomes trained only after the fixed-rank LoRA safetensors export, tokenizer
metadata, and lineage pass structural checks. Missing shards, incomplete tensor pairs,
corrupt/empty headers, or mismatched lineage fail completion. Structural validation checks
metadata and tensor layout, not numerical finiteness, optimizer-update counts, or inference
quality. `quality_gain_verified` remains false.

Evaluate against reviewed independent data before promotion. Current operational facts belong
in tools/retrieval; examples teach how to use them. Keep synthetic corpus checks separate
from the [retained River learning studies](/stateset-agents/river-training#latest-retained-results).

Source basis: the October 20, 2026 `docs/INDUSTRY_FINETUNING.md` and packaged SFT/dataset
contracts. Continue with [the studio](/stateset-agents/finetuning-studio) or
[paired checkpoint evaluation](/stateset-agents/checkpoints-and-evaluation).


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.