Learning resourcesReviewed · Together AI

Together AI: Run SFT recipes

Together AI’s SFT recipe guide teaches developers to train language models from example conversations, but logging and data-format mistakes can fail after a billable model resource starts. It covers No Robots and custom datasets, LoRA and supported full-weight training, assistant-turn loss masks, and checkpoint handoff to reinforcement learning.

Researched 15 Nov 2026

In short.

Together AI’s SFT recipe guide helps developers fine-tune language models on conversations, but configuration errors can consume billable resources before training succeeds. Its SFTConfig and train interface handles data loading, tokenization, assistant-turn loss masks, training and checkpoints. The documentation explains custom row conversion, reasoning-format requirements, SFT-to-GRPO handoff and recovery limits. Prices, task-quality improvements and observed runtime behavior are not established.

Researched and written by an AI model and checked by a second AI model. How it works

Covers the complete documentation page at [https://docs.together.ai/docs/post-training/sft-recipes.md], including requirements, examples, data conversion, chat-template rules, loss masks, GRPO handoff, resuming, troubleshooting and the Mintlify hosting notice. Linked documentation, the documentation index, repository code, model details and dataset contents are excluded. The hosting notice establishes no reuse licence. No code was executed; training outcomes, failure handling, billing, deployment and compatibility remain untested.

The overview

What the resource is

Run SFT recipes is Together AI documentation for supervised fine-tuning through its post-training cookbook. Supervised fine-tuning trains a language model using example conversations containing desired assistant responses. The original page is [https://docs.together.ai/docs/post-training/sft-recipes.md].

The page teaches the cookbook’s SFTConfig and train interface. It includes a No Robots example, custom dataset conversion, training controls, checkpoint handling and troubleshooting.

Practical fit

The guide is useful for developers who have conversation examples and want a configurable training recipe. It explains several operational details that affect whether a run can start successfully, including logging authentication, chat-template compatibility and dataset size.

Its strongest contribution is implementation guidance. It provides no evaluation results demonstrating better answers, instruction following or performance on a particular task. Training quality, reliability and value for money remain unassessed.

Who it helps

The instructions suit developers preparing question-and-answer pairs, multi-turn conversations or other examples that can be converted into user and assistant messages. Beginners will need enough Python familiarity to configure a training run and write a row-conversion function when their data uses another schema.

Experienced developers get guidance on assistant-turn selection, custom token weighting, adapter checkpoints and continuing SFT with group relative policy optimization, or GRPO, a reinforcement-learning method. Installation and account setup are not explained on this page.

What it covers

The recipe supports LoRA adapter training and full-weight training where the model supports it. LoRA trains an adapter; setting use_lora=False requests full-weight training. Configuration controls include epochs, maximum steps, batch size, learning rate and which assistant turns contribute to training.

TRAIN_ON_ALL selects every assistant turn, while TRAIN_ON_LAST selects only the final assistant turn. The page also explains loading custom datasets, starting from a training checkpoint and passing an SFT adapter checkpoint into GRPO. Deployment is linked as a separate topic.

Using it

What you need

The stated requirements are a cookbook checkout, a supported model and suitable conversation data, unless using the No Robots example. Each dataset row needs a conversation with at least one assistant turn. SFT does not require generator support.

Weights & Biases logging must be configured when wandb_project is set. The page offers WANDB_API_KEY for authentication or WANDB_MODE=offline for local logging. Without setup, a run can fail after provisioning or wait at an interactive login prompt while the resource bills.

The page does not specify Python versions, dependency versions, Together account credentials or the complete supported-model list. Those details depend on linked documentation.

How training works

The train function accepts an SFTConfig and handles dataset loading, tokenization, loss masks, the training loop and checkpoints. A loss mask identifies which tokens contribute to the training loss; this recipe builds masks for the assistant turns selected by train_on_what.

When configured with model, train provisions a trainer-only model resource, attaches a session and stops both when it returns. Setting model_resources_id instead targets an existing resource. Cleanup behavior after an abrupt process interruption is not established by this page.

Custom token weighting requires a separate training loop. The documented approach renders conversations with render_conversation, changes each sequence’s loss_mask and passes tokens and masks to build_cross_entropy_sample.

Preparing a run

Choose a supported model and configure dataset_name, dataset_config and dataset_split as needed. Loading uses Hugging Face datasets and can read local files. The documented local example places one JSON object per line in ./my_data/train.jsonl and uses dataset_name='./my_data' with dataset_split='train'. Relative paths resolve from the working directory.

By default, each row supplies a messages column containing role and content fields. A to_messages function can convert another schema, such as question and answer columns. Put instructions the model should learn in the returned messages.

The recipe applies to_messages to the first row before provisioning, allowing a schema mismatch there to fail before billing. This first-row check does not establish that all remaining rows are valid. Configure logging and verify chat-template compatibility before starting.

The documented example

The example imports SFTConfig and train, then configures model='Qwen/Qwen3.8-27B', enable_thinking=False, dataset_name='HuggingFaceH4/no_robots', max_steps=200 and wandb_project='sft-no-robots'. It calls train(config). The thinking setting is disabled because No Robots conversations contain no reasoning and this model’s template requires that setting.

The documented default is one epoch, with rows reshuffled before each pass. max_steps defaults to None, so it imposes no step cap unless configured. The page estimates about 1,187 full-batch steps for one No Robots epoch at batch_size=8; this is documentation guidance, not an observed result.

The page gives 1e-4 to 5e-4 as a typical LoRA learning-rate range and cites cookbook examples using 1e-4 for LoRA and 2e-5 for full-weight training on the same model. It stresses that suitable rates depend on the model and task. These settings have not been executed here.

Assessment & evidence

Important constraints

Rendering rules can exclude training rows. Assistant reasoning belongs in reasoning_content; rows containing reasoning in <think> tags inside content are skipped. Consecutive assistant turns are also skipped when the model’s template uses the next message’s role marker to end each turn. Such turns must be merged or split.

A split smaller than batch_size fails before provisioning with Nothing to train. If every row is skipped during rendering, the run fails after provisioning with nothing was renderable. Suggested responses to memory errors or timeouts are reducing batch_size or max_length, or increasing timeout.

Resuming SFT restores the adapter and optimizer, but restarts the learning-rate schedule and data order from step zero. SFTConfig has no resume_run_dir setting for restoring that position. Full-weight training is available only for supported models, and arbitrary token weighting requires a custom loop.

How to judge fit

The guide is a plausible fit when the desired behavior can be represented by example assistant responses and the model’s conversation template can render those examples correctly. Its built-in controls are useful when training should target every assistant turn or only the final response. More detailed token weighting requires additional implementation.

The practical catch follows from when validation happens: a first-row conversion error can be caught before billing, while unusable rendered conversations can fail after provisioning. Data preparation and logging setup therefore affect both successful execution and billing exposure. The page supplies no evidence that a successful run necessarily improves the intended task.

Other paths described

Within the cookbook, the page presents LoRA and supported full-weight training as different training approaches. It also points to a custom training loop for token-weighting requirements beyond the recipe’s assistant-turn masks.

For continuing an adapter with reinforcement learning, it names recipes/sft_then_grpo.py, which chains SFT and GRPO on GSM8K. The SFT phase teaches the answer format used by the GRPO reward. The linked implementation and GRPO documentation are outside the available page, so their complete behavior and comparative results are unknown.

No competing provider or external training library is evaluated on this page.

What supports these findings

The evidence is the complete Together AI documentation page at [https://docs.together.ai/docs/post-training/sft-recipes.md]. It contains Python examples, configuration advice, lifecycle descriptions, checkpoint instructions and specific failure conditions.

These are publisher-documented behaviors. No training logs, resulting model artifacts, evaluation scores or billing receipts are supplied. Runtime behavior, output quality and actual costs have not been independently assessed. Linked pages and repository files are not included in the evidence.

Access & freshness

Costs and billing exposure

Training resources are billable, but the page supplies no rates, minimum charges, expected duration or total job cost. Deployment costs and any external logging costs are also unknown.

Some failures occur after provisioning. Missing Weights & Biases setup can leave an interactive run waiting for login while billing continues; incompatible conversation rendering can also fail after the resource starts. A max_steps limit bounds training steps, but the page establishes no monetary spending cap.

Licensing and data rights

The page provides no explicit licence for the cookbook code, No Robots dataset, example model or documentation. Commercial-use permissions and redistribution rights for those materials are unknown from this evidence.

The instructions do not establish permission to train on a user’s own conversations or describe how training data is retained or handled. Confirm applicable software, model, dataset and service terms before use.

Date and version limits

The documentation snapshot was captured on 15 November 2026. That is the capture date, not an established publication or last-update date.

The page supplies no pinned cookbook release, commit or dependency versions. Qwen/Qwen3.8-27B is the model identifier stated in its example. Current model availability and compatibility with a particular installed cookbook version are not verified.

Before starting

Confirm the cookbook setup, supported model, applicable terms and resource prices. Prepare representative conversations, check their schema beyond the first row and match reasoning fields and enable_thinking to the model’s template. Use a batch size that fits the dataset split and set an explicit step cap for an initial run.

Configure Weights & Biases before enabling wandb_project, or use the documented offline mode. For a later GRPO phase, note that GRPOConfig enables logging by default; the page permits wandb_project=None to disable it.

For SFT-to-GRPO handoff, make the final SFT step a multiple of training_checkpoint_interval. Set the GRPO config's resume_from_checkpoint_id to the checkpoint ID that the SFT train call returns, and set load_optimizer=False in that GRPO config. Match lora_rank and lora_alpha. The returned ID is None if no training checkpoint was written. Evaluate the trained model on the intended task before deployment; the page provides no validated quality threshold.

Evidence for this report

selected-page.txtselected · checked 2026-11-15