If you are unfamiliar with models, model profiles, model bundles, or model deployment, see the Deploying models and bundles page.
What is speculative decoding
Speculative decoding is an inference acceleration technique that pairs a fast, lightweight “draft” model with a larger, higher-quality “target” model:- The draft model proposes multiple next tokens
- The target model quickly verifies or rejects them in parallel
- This approach significantly speeds up inference decode time, especially when the draft model is closely “aligned” to the target model
When NOT to use speculative decoding
Speculative decoding is most effective when the draft model can predict a meaningful portion of the target model’s next tokens. In some situations, however, it can provide little benefit–or even reduce overall performance:Using custom draft checkpoints for speculative decoding
Some model profiles in SambaStack support speculative decoding. When a target model uses speculative decoding, both the draft and target models must be deployed together, and the checkpoints for either model may be customized. This section walks through the full workflow for deploying a custom draft checkpoint, including:- How to identify which profiles and bundles use speculative decoding
- How to validate draft–target compatibility
- How to update your
ModelBundle
Workflow overview
Deploying a custom draft checkpoint for speculative decoding follows these high-level steps:Steps to deploy a custom draft checkpoint
Confirm your deployment uses speculative decoding
Speculative decoding requires a target model whose The pairing itself is declared in the In the above example:
ModelProfile supports it, together with a draft model deployed alongside it. A profile supports speculative decoding when its spec.features includes speculative_decoding:ModelBundle through spec.specDecodingPairs. In the example below, meta-llama-3-3-70b-instruct is the target and meta-llama-3-2-1b-instruct is the draft. A third model, gemma-4-31b-it, is bundled alongside them and does not use speculative decoding.meta-llama-3-3-70b-instructis the target model. It uses thellama-3p1-70b-sdprofile, whose PEFs are compiled for speculative decoding.meta-llama-3-2-1b-instructis the draft model. It is markedroutable: false, so clients cannot address it directly.spec.specDecodingPairsdeclares the pairing between them.gemma-4-31b-itis unrelated to the pairing and is served normally.
- Both the target and the draft model must appear as entries in
spec.modelConfigs. - The draft model should be non-routable, since requests are sent to the target model.
- Entries in
specDecodingPairsreference models by their bareModelresource name, without an architecture or version suffix.
Speculative decoding fields
Convert your custom draft checkpoint
If you are replacing the draft model’s checkpoint with your own fine-tuned or custom version, convert it into the SambaNova-compatible format using the Checkpoint Conversion Tool.
- If you have not already set up the tool, follow the Download and set up instructions on the Checkpoint Conversion Tool documentation page.
- Then convert the draft checkpoint using the steps in Convert and validate checkpoint.
SambaStack-provided checkpoints are already in the correct format. If you are using a SambaStack-provided draft checkpoint, skip this step.
Validate draft–target checkpoint compatibility
When deploying custom checkpoints with speculative decoding, verify that a draft checkpoint is compatible with the target checkpoint. This helps prevent unexpected errors during inference.The Checkpoint Conversion Tool provides a built-in utility that checks draft–target compatibility. Use the validation utility to confirm:This step is optional but strongly recommended to avoid runtime errors.
- The draft and target models align structurally
- Their tokenizers are compatible
- Speculative decoding can run safely with this pair
Command template
Parameters
These are the primary input flags to thevalidate-sd command:Host-level variables
In addition to the flags above, you will typically set the following environment variables for the Docker command:Important: Both draft and target checkpoints must be converted before validation. If you are using a SambaStack-provided target checkpoint, you do not need to convert it–all SambaStack-provided checkpoints are already in the correct format.
Upload your custom draft checkpoint
If your cluster uses NFS mounted storage, make sure your custom checkpoint(s) is made available in NFS where it is readable by your cluster.If you are using Google Cloud Storage for your cluster, upload the converted draft checkpoint directory to your GCS bucket and make sure it is readable by your SambaStack service account.For detailed upload instructions and GCS permission configuration, see Deploying custom checkpoints → Upload your custom checkpoint.
Reference your draft checkpoint
Make the converted draft checkpoint servable using one of the two approaches described in Deploying custom checkpoints:
- Override the checkpoint of the existing draft model. Set
checkpointOverrideson the draft model’s entry inspec.modelConfigs. The draft keeps its existing name, sospecDecodingPairsneeds no change. This is the simpler option and is shown in the next step. - Register a new
Modelresource. Use this to serve the draft checkpoint under its own name. You must then update thedraftvalue inspecDecodingPairsto reference the new resource name.
The draft model is never addressed directly by clients, so a new serving name is rarely needed. Prefer overriding the checkpoint unless you specifically want the draft addressable under its own name.
Update your ModelBundle
Once your draft checkpoint is uploaded, point the draft model’s entry at it.To customize the target checkpoint as well, add
Before: using the SambaNova-provided draft
After: using a custom draft checkpoint
AddcheckpointOverrides to the draft model’s modelSettings. Nothing else changes, including specDecodingPairs:A checkpoint
source can be either a Google Cloud Storage path (gs://) or an NFS path (nfs://).checkpointOverrides to the target model’s entry in the same way.Apply the bundle
Important notes
- You do not need to call the draft model directly in your inference API requests.
- When you send requests to the target model, SambaStack automatically runs speculative decoding using the paired draft model.
- Both models must be present in
spec.modelConfigsfor speculative decoding to work. - For the full custom-checkpoint workflow, see Deploying custom checkpoints.
Verify deployment
After applying the bundle and deploying it, verify your deployment:Troubleshooting
Related pages
- Checkpoint Conversion Tool – Convert checkpoints to SambaNova format
- Deploying custom checkpoints – Deploy custom target checkpoints
- Deploying models and bundles – Model, profile, bundle, and deployment concepts

