Create a custom speculator job
Create a fine-tuning job withmethod.type="spec-draft" and provide speculator hyperparameters under method.spec_draft.hyperparameters.
Dataset format
Only pretokenized datasets are supported. Upload a JSONL file where each line contains:input_ids— array of token IDs.attention_mask— array of1s and0s aligned withinput_ids.labels— array of target token IDs. Use-100to ignore a position in the loss.
Request fields
Top-level fields
Method fields
Hyperparameters
Supported architectures
Supported losses
Set the training loss withloss.type. Supported values:
kl— Standard Kullback-Leibler divergence loss between drafter and target model logits.lk_alpha— LK loss with KL disabled.lk_hybrid— Weighted combination of KL and LK losses.
Training metrics
Custom speculator jobs report two categories of metrics:- Loss metrics for monitoring optimization and model behavior during training.
- Sampling performance metrics for estimating speculative decoding quality and efficiency.
Some per-head metrics are reported conditionally. For a given head, the metric is computed under the assumption that all previous speculative tokens were accepted. For example, metrics for head 4 are conditioned on tokens 1 through 3 being accepted.
Loss metrics
The following loss metrics are reported during training:All of the losses above are reported regardless of which
loss.type is selected.Sampling performance metrics
Each decoding head reports the following sampling performance metrics:Metric variations
Sampling metrics may be reported for multiple evaluation variations:default
default
Standard sampling with
temperature=1.0. Use this variation to understand expected acceptance behavior under normal sampling.Output artefacts
A completed custom speculator job produces the following artifact structure:Serving with vLLM
Serve the resulting artifact with vLLM by passing it through--speculative-config:
Tuning ntokens
Set ntokens close to the observed acceptance rate to balance speculation against compute overhead. For example, if ntokens=7 yields an acceptance rate of ~3.86, dropping to 3 or 4 will typically improve throughput.