Commit 2b049b8
authored
QVAC-23810 doc: cover multi-job continuous batching and per-request cancel (#3980)
* doc: cover multi-job continuous batching and per-request cancel
- ai-capabilities/text-generation.mdx: new "Concurrent completions"
subsection covering `modelConfig.parallel >= 2` to fan out several
`completion()` calls on one loaded model, the burst-finishes-in-time-
of-slowest throughput promise, and per-request `cancel({ requestId })`
isolation from concurrent peers. Embeds the SDK's
`multi-job-completion.ts` example (JS + TS tabs). Adds a matching
bullet in "Features".
- ai-capabilities/batch-processing.mdx: cross-link callout in the
Overview pointing at the new subsection, flagging that mixing
`completion()` and `batchCompletion()` on one model does not multiply
concurrency past `parallel`.
- runtime/cancellation.mdx: sharpened the "peer isolation" sentence in
the targeted-cancel section to name it as the right form for a
per-request stop button that leaves the rest of the workload alone;
rewrote the `RequestRejectedByPolicyError` bullet — the old
`oneAtATimePerModel` framing is stale — to describe the shared
per-model queue (up to `parallel` concurrent, 64-deep FCFS wait,
65th rejected up-front), the exclusive-writer finetune, and a
short "raise `parallel`, back-pressure, or retry" recovery hint.
- cli/http-server/index.mdx: one extra paragraph in "Request
cancellation" naming `serve.models.<alias>.config.parallel` for how
many HTTP requests to the same alias run in parallel, and confirming
a client disconnect cancels only its own request.
Reflects the SDK behavior shipped in #3682 (merged
2026-08-19) and its published `multi-job-completion.ts` example.
* doc: address review — clarify parallel/ctx_size and cancel scopes
- text-generation.mdx: state `modelConfig.parallel` default (1);
explain that `ctx_size` is split evenly across `parallel` slots
with the `parallel × per-request context` sizing rule; link the
addon-side `packages/llm-llamacpp/docs/continuous-batching.md`.
- cancellation.mdx: scope the targeted-cancel isolation promise to
`completion()`, `batchCompletion()` and LLM `translate()`; add a
"watch out" paragraph and matching Coverage-callout bucket for
`embed()` / `transcribe()` / `audioGen()`, which route to model-wide
cancel and abort peers on the same model; disambiguate NMT
`translate` from LLM `translate`; on the `RequestRejectedByPolicyError`
bullet, cross-link `modelConfig.parallel` and note that raising
`parallel` requires raising `ctx_size` proportionally.
- packages/sdk/examples/multi-job-completion.ts: drop the "Non-cached"
qualifier from the header comment — the disk-KV-cache-in-private-lane
design was reverted before #3682 merged, so cached completions ride
the same admission lane. Docs page renders the fix on next site build
via `prebuild:examples`.
* doc: drop external addon-side link from concurrent completions
- text-generation.mdx: remove the trailing sentence pointing at
`packages/llm-llamacpp/docs/continuous-batching.md` in the
Concurrent completions section. The section already explains the
`ctx_size`-shared-across-slots interaction inline, and linking
to an addon repo doc from the SDK-facing page mixes audiences.
* doc: bound throughput claim and name HTTP parallel default
- text-generation.mdx: the "burst finishes in roughly the time of
the slowest prompt" promise now carries "up to `parallel`" on both
the Features bullet and the Concurrent completions paragraph, with
"extras queue" / "beyond that they queue" to keep the selling point
intact without over-claiming for `N > parallel`.
- cli/http-server/index.mdx: the Request-cancellation paragraph on
same-alias parallelism now states that `serve.models.<alias>.config.parallel`
defaults to `1` and instructs the operator to set it explicitly to
serve an alias concurrently — the CLI ships no default, so the prior
wording read as a description of behavior that only kicks in after
explicit opt-in.
* doc: sharpen parallel and cancel accuracy per review
- cancellation.mdx: move audioGen() out of the "targeted cancel also aborts
peers" bucket in the Coverage callout and the Watch out callout. Its
admission is capped at 1 and audio-gen-stream.ts drops queued waiters
without calling model-wide cancel, so peers survive — the collateral
warning only applies to embed() and transcribe().
- cancellation.mdx: rewrite the RequestRejectedByPolicyError bullet so
finetune no longer sits with the readers. completion / batchCompletion /
LLM translate share the "parallel + 64 waiters" queue; a second finetune
while one runs is rejected earlier with CompletionFailedError (52406)
before it reaches admission, so branch on that code to distinguish
"already training" from "queue full".
- text-generation.mdx: rewrite the Concurrent completions paragraph so it
captures the two-layer behaviour of parallel without jargon. Each call is
one request (a big batchCompletion never blocks more than one peer from
starting), but each prompt in a batch takes one decode slot — so a large
batch fills every parallel slot itself and a concurrent completion() only
starts decoding once the batch has room.
- cli/http-server/index.mdx: repoint the parallel link from
/reference/api#loadmodel (auto-generated, does not document parallel) to
/ai-capabilities/text-generation#concurrent-completions, matching the
anchor already used from cancellation.mdx.1 parent ae97a0e commit 2b049b8
5 files changed
Lines changed: 49 additions & 7 deletions
File tree
- docs/website/content/docs
- ai-capabilities
- cli/http-server
- runtime
- packages/sdk/examples
Lines changed: 4 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
20 | 20 | | |
21 | 21 | | |
22 | 22 | | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
23 | 27 | | |
24 | 28 | | |
25 | 29 | | |
| |||
Lines changed: 31 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
40 | 40 | | |
41 | 41 | | |
42 | 42 | | |
| 43 | + | |
43 | 44 | | |
44 | 45 | | |
45 | 46 | | |
| |||
78 | 79 | | |
79 | 80 | | |
80 | 81 | | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
81 | 112 | | |
82 | 113 | | |
83 | 114 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1341 | 1341 | | |
1342 | 1342 | | |
1343 | 1343 | | |
| 1344 | + | |
| 1345 | + | |
1344 | 1346 | | |
1345 | 1347 | | |
1346 | 1348 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
14 | | - | |
| 14 | + | |
15 | 15 | | |
16 | | - | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
17 | 19 | | |
18 | 20 | | |
19 | 21 | | |
| |||
75 | 77 | | |
76 | 78 | | |
77 | 79 | | |
78 | | - | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
79 | 85 | | |
80 | 86 | | |
81 | 87 | | |
| |||
182 | 188 | | |
183 | 189 | | |
184 | 190 | | |
185 | | - | |
| 191 | + | |
186 | 192 | | |
187 | 193 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
20 | | - | |
21 | | - | |
22 | | - | |
| 20 | + | |
| 21 | + | |
23 | 22 | | |
24 | 23 | | |
25 | 24 | | |
| |||
0 commit comments