# tinker_cookbook.distillation.sdft.Config ## *class* [**tinker_cookbook.distillation.sdft.Config**](https://github.com/thinking-machines-lab/tinker-cookbook/blob/main/tinker_cookbook/distillation/sdft.py#L736)() Configuration for SDFT training. **Key parameters:** - `topk`: Number of top tokens for distillation (default 20). Set to 0 for the importance-sampling fallback. K=20 matches full-vocabulary KL in practice. - `learning_rate`: For LoRA, use 5e-4 to 1e-3. The top-K CE loss produces larger gradients than SFT at the same LR due to more completion tokens per step (on-policy generation), so use the lower end of the range. - `teacher_sync_every`: Optional periodic hard-sync of student weights into the teacher (approximating EMA). `None` = static frozen teacher, which works comparably to EMA in our experiments. See `main` for the training loop. **Fields:** - [**model_name**](https://github.com/thinking-machines-lab/tinker-cookbook/blob/main/tinker_cookbook/distillation/sdft.py#L756) (*str*) – Model - [**recipe_name**](https://github.com/thinking-machines-lab/tinker-cookbook/blob/main/tinker_cookbook/distillation/sdft.py#L757) (*str*) - [**renderer_name**](https://github.com/thinking-machines-lab/tinker-cookbook/blob/main/tinker_cookbook/distillation/sdft.py#L758) (*str | None*, default: `None`) - [**lora_rank**](https://github.com/thinking-machines-lab/tinker-cookbook/blob/main/tinker_cookbook/distillation/sdft.py#L759) (*int*, default: `128`) - [**base_url**](https://github.com/thinking-machines-lab/tinker-cookbook/blob/main/tinker_cookbook/distillation/sdft.py#L760) (*str | None*, default: `None`) - [**learning_rate**](https://github.com/thinking-machines-lab/tinker-cookbook/blob/main/tinker_cookbook/distillation/sdft.py#L763) (*float*, default: `2e-05`) – Training - [**max_tokens**](https://github.com/thinking-machines-lab/tinker-cookbook/blob/main/tinker_cookbook/distillation/sdft.py#L764) (*int*, default: `2048`) - [**temperature**](https://github.com/thinking-machines-lab/tinker-cookbook/blob/main/tinker_cookbook/distillation/sdft.py#L765) (*float*, default: `1.0`) - [**loss_fn**](https://github.com/thinking-machines-lab/tinker-cookbook/blob/main/tinker_cookbook/distillation/sdft.py#L766) (*LossFnType*, default: `'cross_entropy'`) - [**topk**](https://github.com/thinking-machines-lab/tinker-cookbook/blob/main/tinker_cookbook/distillation/sdft.py#L769) (*int*, default: `20`) – SDFT-specific - [**reverse**](https://github.com/thinking-machines-lab/tinker-cookbook/blob/main/tinker_cookbook/distillation/sdft.py#L770) (*bool*, default: `False`) - [**demo_template**](https://github.com/thinking-machines-lab/tinker-cookbook/blob/main/tinker_cookbook/distillation/sdft.py#L771) (*str*, default: `DEFAULT_DEMO_TEMPLATE`) - [**system_prompt**](https://github.com/thinking-machines-lab/tinker-cookbook/blob/main/tinker_cookbook/distillation/sdft.py#L772) (*str | None*, default: `None`) - [**teacher_sync_every**](https://github.com/thinking-machines-lab/tinker-cookbook/blob/main/tinker_cookbook/distillation/sdft.py#L773) (*int | None*, default: `None`) - [**max_context_length**](https://github.com/thinking-machines-lab/tinker-cookbook/blob/main/tinker_cookbook/distillation/sdft.py#L774) (*int*, default: `32768`) - [**evaluator_builders**](https://github.com/thinking-machines-lab/tinker-cookbook/blob/main/tinker_cookbook/distillation/sdft.py#L777) (*list[SamplingClientEvaluatorBuilder]*, default: `[]`) – Evaluation - [**eval_every**](https://github.com/thinking-machines-lab/tinker-cookbook/blob/main/tinker_cookbook/distillation/sdft.py#L778) (*int*, default: `20`) - [**save_every**](https://github.com/thinking-machines-lab/tinker-cookbook/blob/main/tinker_cookbook/distillation/sdft.py#L779) (*int*, default: `20`) - [**num_substeps**](https://github.com/thinking-machines-lab/tinker-cookbook/blob/main/tinker_cookbook/distillation/sdft.py#L782) (*int*, default: `1`) – Standard infra - [**log_path**](https://github.com/thinking-machines-lab/tinker-cookbook/blob/main/tinker_cookbook/distillation/sdft.py#L783) (*str*) - [**wandb_project**](https://github.com/thinking-machines-lab/tinker-cookbook/blob/main/tinker_cookbook/distillation/sdft.py#L784) (*str | None*, default: `None`) - [**wandb_name**](https://github.com/thinking-machines-lab/tinker-cookbook/blob/main/tinker_cookbook/distillation/sdft.py#L785) (*str | None*, default: `None`) - [**load_checkpoint_path**](https://github.com/thinking-machines-lab/tinker-cookbook/blob/main/tinker_cookbook/distillation/sdft.py#L786) (*str | None*, default: `None`) - [**max_steps**](https://github.com/thinking-machines-lab/tinker-cookbook/blob/main/tinker_cookbook/distillation/sdft.py#L787) (*int | None*, default: `None`) - [**enable_trace**](https://github.com/thinking-machines-lab/tinker-cookbook/blob/main/tinker_cookbook/distillation/sdft.py#L789) (*bool*, default: `False`) - [**span_chart_every**](https://github.com/thinking-machines-lab/tinker-cookbook/blob/main/tinker_cookbook/distillation/sdft.py#L790) (*int*, default: `0`)