Skip to main content
SambaStack allows you to use custom draft models with both user-provided checkpoints and SambaNova-provided checkpoints to improve inference performance in certain deployment scenarios. These draft models enable speculative decoding, which can reduce latency and increase throughput when configured appropriately. This page explains how to deploy models using speculative decoding. It covers when speculative decoding is appropriate, how to validate compatibility between draft and target models, and how to configure custom draft checkpoints.
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
Key benefit: Speculative decoding accelerates inference without affecting the output distributions (and thereby accuracy) of 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

1

Confirm your deployment uses speculative decoding

Speculative decoding requires a target model whose ModelProfile supports it, together with a draft model deployed alongside it. A profile supports speculative decoding when its spec.features includes speculative_decoding:
The pairing itself is declared in the 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.
In the above example:
  • meta-llama-3-3-70b-instruct is the target model. It uses the llama-3p1-70b-sd profile, whose PEFs are compiled for speculative decoding.
  • meta-llama-3-2-1b-instruct is the draft model. It is marked routable: false, so clients cannot address it directly.
  • spec.specDecodingPairs declares the pairing between them.
  • gemma-4-31b-it is unrelated to the pairing and is served normally.
Note the following:
  • 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 specDecodingPairs reference models by their bare Model resource name, without an architecture or version suffix.

Speculative decoding fields

2

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.
  1. If you have not already set up the tool, follow the Download and set up instructions on the Checkpoint Conversion Tool documentation page.
  2. 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.
3

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:
  • 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 the validate-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.
This step is optional but strongly recommended to avoid runtime errors.
4

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.
5

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 checkpointOverrides on the draft model’s entry in spec.modelConfigs. The draft keeps its existing name, so specDecodingPairs needs no change. This is the simpler option and is shown in the next step.
  • Register a new Model resource. Use this to serve the draft checkpoint under its own name. You must then update the draft value in specDecodingPairs to 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.
6

Update your ModelBundle

Once your draft checkpoint is uploaded, point the draft model’s entry at it.

Before: using the SambaNova-provided draft

After: using a custom draft checkpoint

Add checkpointOverrides 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://).
To customize the target checkpoint as well, add 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.modelConfigs for 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:
Test by sending an inference request to your target model. SambaStack automatically uses the draft model for speculative decoding when handling the request. For examples of how to send inference requests using the SambaNova SDK, OpenAI-compatible libraries, or CURL, see the Quickstart Guide for Developers.

Troubleshooting