DEV Community

Atom Zero
Atom Zero

Posted on

streamft 1.0.4: multi-turn SFT rows without flattening the conversation

streamft trains adapters on models that do not fit in VRAM: it streams NF4 blocks from disk and keeps only the active block on the GPU. Until 1.0.3, its SFT loader accepted only {"instruction", "response"} rows. A multi-turn conversation had to be flattened into one user string, which loses the turn boundaries the model should learn from.

1.0.4 accepts OpenAI-style {"messages": [...]} rows instead.

What changed

  • _format_messages accepts system, user and assistant turns.
  • The prompt mask covers every turn before the final assistant message, so the loss is computed only on the answer that should be learned.
  • A messages row that does not end with an assistant turn raises a clear error instead of silently training on the wrong text.
  • Existing instruction/response rows still work unchanged, including the optional context field.

Why it matters

For Atom Zero 3.1 I am training a 1.5B bridge tier on 2,800 synthetic dialogues, expanded to 8,400 prefixes (plus 1,600 safety/copy/general replay). The first 30-row multi-turn probe on 3.0 showed planning turns that ignored the conversation or refused benign prompts. With messages rows, the prior turns are real context and every assistant turn can be a training target.

Install

pip install --upgrade streamft==1.0.4
Enter fullscreen mode Exit fullscreen mode

Tests

198 passed, 6 skipped.

PyPI: https://pypi.org/project/streamft/1.0.4/
GitHub: https://github.com/byjameson/stream-finetune/releases/tag/v1.0.4

Top comments (0)