> For the complete documentation index, see [llms.txt](https://seekspeed.gitbook.io/seekspeed-docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://seekspeed.gitbook.io/seekspeed-docs/spec-lab/dspark.md).

# DSpark Integration

**DSpark** is the speculative-decoding stack behind DeepSeek's `*-fast` model variants — most visibly `DeepSeek-V4-Pro-DSpark` and the recent `glm-5.2-fast`-style derivatives that run on it. It builds on the [DeepSpec](/seekspeed-docs/spec-lab/deepspec.md) primitives with three productionisation layers:

1. **Quantised draft** (typically FP8 or 8-bit) for cheap per-token drafting.
2. **Dynamic-*****k*****&#x20;scheduling** that lowers `num_speculative_tokens` when acceptance drops, raising it when acceptance is high.
3. **Prefill-aware batching** that defers spec decoding until the target's KV-cache is warm.

Each layer is also a bottleneck class. SeekSpeed's Spec Lab exposes a panel per class — see [Bottleneck Analysis](/seekspeed-docs/spec-lab/bottlenecks.md).

## DSpark as a first-class connector

DSpark / DeepSpec is a dedicated connector kind, not just an OpenAI-compatible URL. Pick the **DSpark / DeepSpec** preset on `/app/connectors` (or run `New DSpark connector` from the `⌘K` command palette) and you get extra fields:

| Field                                  | Stored on                                     | Used by                              |
| -------------------------------------- | --------------------------------------------- | ------------------------------------ |
| Base URL (target)                      | `connectors.base_url`                         | Benchmark runner, `/metrics` probe   |
| Baseline base URL                      | `connectors.baseline_base_url`                | A/B speedup, Spec Lab baseline       |
| Adapter (`vllm` / `tgi` / `llama.cpp`) | `connectors.spec_meta.adapter`                | `/metrics` parser                    |
| Draft model                            | `connectors.spec_meta.draft_model`            | Spec Lab prefill                     |
| `num_speculative_tokens`               | `connectors.spec_meta.num_speculative_tokens` | Bottleneck panel, dynamic-*k* checks |

Testing the connector now runs the normal `/v1/models` ping **plus** a `/metrics` probe that looks for `vllm:spec_decode_num_accepted_tokens`, `vllm:spec_decode_num_draft_tokens`, and `vllm:spec_decode_num_emitted_tokens`. The result panel reports the live acceptance rate and tokens-per-step so you can sanity-check the endpoint before you ever open Spec Lab.

## Import from a DSpark connector

Once a DSpark connector exists, Spec Lab shows an **Import from DSpark connector** picker at the top of the form. Selecting a connector prefills:

* target endpoint and baseline endpoint
* adapter
* target and draft model
* `num_speculative_tokens`

so a fresh run is one click away — no copy-pasting URLs between tabs.

## Running DSpark inside Spec Lab

DSpark exposes the same vLLM `/metrics` surface as DeepSpec, so the adapter is identical:

```
Adapter:           vllm
Endpoint:          http://dspark-vllm:8000/v1
Baseline endpoint: http://vanilla-vllm:8000/v1
Target model:      deepseek-ai/DeepSeek-V4-Pro-DSpark
Draft model:       deepseek-ai/DeepSpec-Draft-V3   (or the FP8 draft DSpark ships)
Sample count:      32
Max tokens:        256
```

Click **Probe** to confirm the spec counters are present, then **Run** to fire 32 prompts at each endpoint and compute the measured throughput speedup, acceptance rate, and tokens-per-step.

## What "the DSpark bottleneck" usually is

In our own runs against a DSpark endpoint serving DeepSeek-V4-Pro-DSpark:

* The **draft overhead** card is the most common offender. A heavily quantised draft is still \~10-15% of the target's forward-pass cost, and at low acceptance rates it erases most of the theoretical ceiling.
* The **prefill share** card lights up on short prompts. Spec decoding accelerates *decode*, not *prefill*; if your TTFT is dominated by prefill, the speedup will look smaller than the marketing number.
* The **batch pressure** card flips to "marginal" once concurrency passes the target's natural batch size. DSpark's dynamic-*k* helps but doesn't fully cancel it.
* The **acceptance rate** card is the headline — if `α < 0.4`, the breakeven curve drops below 1× and you'd be faster without spec decoding at all.

Bring the four card scores together and you get an honest answer to "is DSpark helping me?" — instead of trusting the README.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://seekspeed.gitbook.io/seekspeed-docs/spec-lab/dspark.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
