jetson-speculative-decoding — скилл для Claude Code: ускорить
Скилл добавляет спекулятивное декодирование EAGLE-3 или draft-модель к серверу vLLM на Jetson, когда медленно генерируются токены.
npx skills add NVIDIA/skills --skill jetson-speculative-decoding -a claude-codeЧто делает jetson-speculative-decoding
Скилл правит уже работающий сервер vLLM на Jetson: дописывает --speculative-config в команду vllm serve из рецепта jetson-llm-serve. Маленькая draft-модель предлагает токены, целевая проверяет их за один проход, и время на токен падает.
На Jetson исход решает не качество draft-модели, а запас VRAM. Поэтому скилл разрешает EAGLE-3 только на Thor и AGX Orin, а на Orin Nano и NX запускать не советует: памяти на целевую и draft-модель сразу не хватит, старт упадёт с OOM. Число спекулятивных токенов советует начать с 5 на Thor и 3 на AGX Orin, а --gpu-memory-utilization снизить примерно на 0.05 против базовой линии. Смысл есть на одном потоке или низкой конкурентности, до двух запросов; при восьми и выше пакетное декодирование обычно выигрывает, а draft только съедает память.
Перед включением нужна базовая линия из jetson-llm-benchmark и совместимая голова EAGLE-3 либо небольшая draft-модель того же семейства. После включения скилл требует прогнать замер при --concurrency 1 до и после: если прирост меньше 10% или пропускная способность падает на восьми потоках, спекуляцию надо выключить.
Какие задачи решает
- ускорить выдачу токенов на сервере vLLM под Jetson, когда TTFT в норме
- подобрать число спекулятивных токенов под Thor или AGX Orin
- проверить, окупает ли draft-модель потраченную память
- освободить VRAM под draft-модель, не сломав запуск сервера
- откатить спекуляцию, если замер показал регресс
Примеры запросов агенту
- Допиши
--speculative-configс методом eagle3 в командуvllm serveизjetson-llm-serveи подбери число спекулятивных токенов под Thor - Сравни
throughput_tok_sиtpot_ms_p50при--concurrency 1до и после включения спекулятивного декодирования - Старт падает с OOM после включения спекуляции — что снизить в первую очередь?
Как установить jetson-speculative-decoding
1Через Skills CLI (Vercel)
npx skills add NVIDIA/skills --skill jetson-speculative-decoding -a claude-code2Вручную: положить файлы
~/.claude/skills/jetson-speculative-decoding/SKILL.mdПапка скилла целиком; для одного проекта — .claude/skills/jetson-speculative-decoding/
1Через Skills CLI (Vercel)
npx skills add NVIDIA/skills --skill jetson-speculative-decoding -a codex2Вручную: положить файлы
.agents/skills/jetson-speculative-decoding/SKILL.mdДля всех проектов — ~/.agents/skills/
1Через Skills CLI (Vercel)
npx skills add NVIDIA/skills --skill jetson-speculative-decoding -a cursor2Вручную: положить файлы
.cursor/skills/jetson-speculative-decoding/SKILL.mdCursor читает и .agents/skills/, и .claude/skills/
1GitHub CLI
gh skill install NVIDIA/skills jetson-speculative-decoding2Вручную: положить файлы
.github/skills/jetson-speculative-decoding/SKILL.md1Через Skills CLI (Vercel)
npx skills add NVIDIA/skills --skill jetson-speculative-decoding -a gemini-cli2Командой платформы
gemini skills install https://github.com/NVIDIA/skills --path skills/jetson-speculative-decodingВручную: положить файлы
.devin/skills/jetson-speculative-decoding/SKILL.mdСтарый путь .windsurf/skills/ тоже читается
Через Skills CLI (Vercel)
npx skills add NVIDIA/skills --skill jetson-speculative-decoding -a opencodeClaude.ai
Упакуйте папку в zip и загрузите в Settings → Capabilities → Skills
По шагам, с командами для каждой платформы: Как установить скилл в Claude Code: пять способов
Вопросы о jetson-speculative-decoding
Как установить jetson-speculative-decoding в Claude?
Выполните npx skills add NVIDIA/skills --skill jetson-speculative-decoding -a claude-code. Скилл появится в ~/.claude/skills/jetson-speculative-decoding/SKILL.md.
Что делает jetson-speculative-decoding?
Добавляет спекулятивное декодирование к серверу vLLM на Jetson: либо голову EAGLE-3, либо небольшую draft-модель того же семейства. Заодно задаёт правила подбора числа спекулятивных токенов и проверки результата замером.
На каких Jetson это заработает?
На Thor и AGX Orin. На Orin Nano и NX запускать не стоит: свободной памяти на целевую и draft-модель обычно не хватает, и сервер упадёт при старте. Нужен ещё рабочий рецепт из jetson-llm-serve и замер из jetson-llm-benchmark.
Исходный текст
SKILL.md · Apache-2.0
---
name: jetson-speculative-decoding
description: Add EAGLE-3 or draft-model speculative decoding to a Jetson vLLM server when TPOT is the bottleneck.
version: 0.0.1
license: "Apache-2.0"
metadata:
author: "Jetson Team"
tags: [jetson, llm, speculative-decoding]
languages: [markdown]
data-classification: public
---
# Jetson Speculative Decoding (vLLM)
Speculative decoding lets a small "draft" model propose tokens that the target model verifies in a single forward pass, reducing per-token latency. On Jetson, the win/loss is **dominated by VRAM headroom**, not by the draft quality. This skill encodes the parts an LLM won't already know.
## Purpose
Tune an existing Jetson vLLM deployment for faster token generation by appending the right `--speculative-config` and validating whether it improves single-stream decode speed.
## When to use
- TPOT/ITL is the bottleneck (TTFT is fine, output is just slow).
- Workload is single-stream or low-concurrency (≤2). Speculation usually loses at high concurrency.
- Jetson family is **Thor or AGX Orin**. Do **not** suggest EAGLE-3 on Orin Nano/NX — there is rarely enough VRAM headroom to host both target and draft, and you'll OOM at startup.
## When NOT to use
- High-concurrency serving (≥8): batched decode usually beats speculation; the draft model just steals VRAM.
- Models without a published EAGLE-3 head — do not train one ad-hoc as a "fix".
- After applying `jetson-inference-mem-tune` flags that already pushed `--gpu-memory-utilization` near the ceiling. Free at least ~2 GB first.
## Prerequisites
- A working vLLM server recipe from `jetson-llm-serve`.
- Enough memory headroom for the draft model or EAGLE-3 head in addition to the target model.
- A benchmark baseline from `jetson-llm-benchmark` before enabling speculation.
- A target model with a compatible EAGLE-3 head, or a small same-family draft model for the fallback path.
## Instructions
Append `--speculative-config` to the `vllm serve` command shown in `jetson-llm-serve`.
EAGLE-3 (preferred when a head is published for the target model):
```bash
--speculative-config '{
"method": "eagle3",
"model": "<eagle3-head-repo-id>",
"num_speculative_tokens": 5,
"draft_tensor_parallel_size": 1
}'
```
Draft-model (fallback — pair a small same-family model):
```bash
--speculative-config '{
"method": "draft_model",
"model": "<small-draft-model-repo-id>",
"num_speculative_tokens": 4,
"draft_tensor_parallel_size": 1
}'
```
### Jetson-specific tuning rules
- `num_speculative_tokens`: start at **5** on Thor, **3** on AGX Orin. Higher values pay off only if the draft acceptance rate is >0.6.
- Always pair with the same vLLM runtime path used by `jetson-llm-serve`: upstream vLLM 0.20+ (`vllm/vllm-openai:latest`) or validated native vLLM 0.20+ on Thor, upstream vLLM 0.20+ on Orin JetPack 7.2 / L4T r39+, or the NVIDIA-AI-IOT vLLM image on older Orin. Do not use an Orin NVIDIA-AI-IOT vLLM image on Thor. Older runtimes may lack EAGLE-3 or the current `--speculative-config` shape.
- Drop `--gpu-memory-utilization` by ~0.05 vs the non-speculative baseline to give the draft model headroom.
## How to verify it actually helped
1. Run `jetson-llm-benchmark` (vLLM path) at `--concurrency 1` **before and after** enabling speculation.
2. Acceptance: target ≥30% improvement in `throughput_tok_s` and ≥20% drop in `tpot_ms_p50` at concurrency 1.
3. If improvement is <10%, or `throughput_tok_s` regresses at concurrency 8, **disable** speculation. The draft model is costing more than it returns.
## Limitations
- Speculative decoding improves decode-heavy workloads; it does not reduce TTFT-dominated latency.
- High concurrency can erase the benefit because continuous batching already keeps the GPU busy.
- Orin Nano/NX usually lack enough memory headroom for both target and draft models.
- Acceptance rate and draft overhead are model-specific, so benchmark before and after instead of assuming a speedup.
## Error handling
- If vLLM rejects `--speculative-config`, verify that Thor and Orin JetPack 7.2 / L4T r39+ are using vLLM 0.20+ and that older Orin is using a JetPack-matched NVIDIA-AI-IOT vLLM image; then switch back to the non-speculative serving command if the runtime still rejects it.
- If startup OOMs, lower `--gpu-memory-utilization`, use a smaller draft, or disable speculation and hand off to `jetson-inference-mem-tune`.
- If benchmark throughput regresses, remove `--speculative-config`; a bad draft path is worse than no speculation.
## Hand off to
- `jetson-llm-benchmark` to quantify the change.
- `jetson-inference-mem-tune` if startup OOMs after enabling speculation.
## Source
vLLM speculative decoding docs and the [Jetson AI Lab GenAI tutorial](https://www.jetson-ai-lab.com/tutorials/genai-on-jetson-llms-vlms/).
© Jetson Team · Apache-2.0 · NVIDIA/skills