speculative_config block.
This tutorial deploys Qwen3-4B-Instruct-2507 with the Qwen3-4B Eagle3 draft head, from a config file to a production API. You’ll set up Truss, write the config, deploy to Baseten, and call the model’s OpenAI-compatible endpoint. For how the speculation loop works and the full parameter reference, see Speculative decoding for BIS-LLM.
Install and sign in
Before you begin, sign up or sign in to Baseten, then install uv, a fast Python package manager.Install Truss
Sign in
Write the config
BIS-LLM deployments need only aconfig.yaml. Create one that mounts the base model and the Eagle draft head, then turns on Eagle speculation in the speculative_config block:
Your Baseten representative provides the current
bis_llm.version and gpuTRTImage values for your workspace. The placeholders below stand in for the values they give you.config.yaml
weightsmounts the base model to/models/baseand the Eagle draft head to/models/eagle. Baseten mirrors both to the Baseten Delivery Network for fast cold starts. Qwen3-4B and this Eagle head are ungated, so no access token is needed.bis_llmselects the BIS-LLM (v2) inference stack. Theconfigblock holds the engine and runtime settings.speculative_configenables Eagle.speculative_model_dirpoints at the mounted draft head, andmax_draft_lensets how many tokens it proposes per step. Raise it for more aggressive speculation, lower it if acceptance drops. See the parameter reference.additional_autoscaling_configscales onin_flight_tokensrather than request count, which suits mixed-length prompts. See Autoscaling BIS-LLM.
Deploy
Push the model to Baseten:/models/ (for example, abc1d2ef). You’ll need it to call the model.
BIS-LLM deployments take roughly 15-20 minutes to reach Active. The engine loads the base model and Eagle head, then runs CUDA-graph warmup before the deployment passes its readiness check. Requests sent before then return
Model is not ready.Call the model
Once the deployment shows Active in the dashboard, call its OpenAI-compatible endpoint. Speculative decoding runs greedily, so settemperature to 0. Replace {model_id} with your model ID.
- Python
- cURL
Install the OpenAI SDK if you don’t have it:Send a request:
speculation_rate metric on the BIS-LLM dashboard.
Next steps
Speculative decoding for BIS-LLM
Eagle, MTP, and N-gram parameters, and the acceptance-rate metric to watch.
BIS-LLM configuration
Full
config.yaml reference for the v2 inference stack.Lookahead decoding (v1)
N-gram speculation on Engine-Builder-LLM, the self-serve v1 path.
Autoscaling BIS-LLM
Token-based autoscaling for prefill, decode, and aggregated replicas.