Getting it into your agent
One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.
npx skills add liortesta/ClawdAgent --skill speculative-decodinggit clone --depth 1 https://github.com/liortesta/ClawdAgentWrote this? Show the measurements
A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.
[](https://agentmods.dev/skills/liortesta/clawdagent/speculative-decoding)<a href="https://agentmods.dev/skills/liortesta/clawdagent/speculative-decoding"><img src="https://agentmods.dev/badge/skills/liortesta/clawdagent/speculative-decoding/github.svg" alt="Measured on agentmods" height="20"></a>Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.
<a href="https://agentmods.dev/skills/liortesta/clawdagent/speculative-decoding"><img src="https://agentmods.dev/badge/skills/liortesta/clawdagent/speculative-decoding.svg" alt="Reviewed on agentmods" width="80" height="20"></a>What it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00077 | $0.03753 |
| Opus 5.5 | $0.00031 | $0.01501 |
| Sonnet 5.5 | $0.00015 | $0.00751 |
| Haiku 4.5 | $0.00008 | $0.00375 |
Grade A, and why
speculative-decoding scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2mo ago.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
Nothing flagged
None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.
This is a copy
100% identical to emerging-techniques-speculative-decoding — 11 lines differ, which has more behind it and is treated as the original. This page carries a canonical link to it rather than competing with it.
How it starts
The opening of the file, as written. The whole thing — 468 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Speculative Decoding: Accelerating LLM Inference
When to Use This Skill
Use Speculative Decoding when you need to:
- Speed up inference by 1.5-3.6× without quality loss
- Reduce latency for real-time applications (chatbots, code generation)
- Optimize throughput for high-volume serving
- Deploy efficiently on limited hardware
- Generate faster without changing model architecture
Key Techniques: Draft model speculative decoding, Medusa (multiple heads), Lookahead Decoding (Jacobi iteration)
Papers: Medusa (arXiv 2401.10774), Lookahead Decoding (ICML 2024), Speculative Decoding Survey (ACL 2024)
Installation
# Standard speculative decoding (transformers)
pip install transformers accelerate
# Medusa (multiple decoding heads)
git clone https://github.com/FasterDecoding/Medusa
cd Medusa
pip install -e .
# Lookahead Decoding
git clone https://github.com/hao-ai-lab/LookaheadDecoding
cd LookaheadDecoding
pip install -e .
# Optional: vLLM with speculative decoding
pip install vllm
Quick Start
Basic Speculative Decoding (Draft Model)
from transformers import AutoModelForCausalLM, AutoTokenizer
# Load target model (large, slow)
target_model = AutoModelForCausalLM.from_pretrained(
"meta-llama/Llama-2-70b-hf",
device_map="auto",
torch_dtype=torch.float16
)
# Load draft model (small, fast)
draft_model = AutoModelForCausalLM.from_pretrained(
"meta-llama/Llama-2-7b-hf",
device_map="auto",
torch_dtype=torch.float16
)
tokenizer = AutoTokenizer.from_pretrained("meta-llama/Llama-2-70b-hf")
# Generate with speculative decoding
prompt = "Explain quantum computing in simple terms:"
inputs = tokenizer(prompt, return_tensors="pt").to("cuda")
# Transformers 4.36+ supports assisted generation
outputs = target_model.generate(
**inputs,
assistant_model=draft_model, # Enable speculative decoding
max_new_tokens=256,
do_sample=True,
temperature=0.7,
)
response = tokenizer.decode(outputs[0], skip_special_tokens=True)
print(response)
What ships with it
2 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.
What this file has done since we first saw it
Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.
- 2mo ago First seen · 468 lines · 77 tokens per session scan A d818b841ffe3
speculative-decoding is a skill published in the GitHub repository liortesta/ClawdAgent (12 stars, last pushed 2mo ago), licensed Apache-2.0. It adds 77 tokens to every session and 3,753 once invoked, about $0.0003 per session on Opus 5.5. A static security scan graded it A with 0 findings. It is 100% identical to emerging-techniques-speculative-decoding, differing in 11 lines, and is treated as a copy.
speculative-decoding compared with skills from other repositories
| Mod | Type | Stars | Last push | Licence | Scan | Tokens | Works with |
|---|---|---|---|---|---|---|---|
| speculative-decodingliortesta/ClawdAgent | Skill | 12 | 2mo ago | Apache-2.0 | A | 77 | Claude Code |
| speculative-decodingOpenLAIR/dr-claw | Skill | 1.2k | 2d ago | none | A | 77 | Claude Code, Codex |
| speculative-decodingsynthetic-sciences/openscience | Skill | 4.4k | today | Apache-2.0 | A | 77 | Claude Code, Codex |
| speculative-decodingOrchestra-Research/AI-Research-SKILLs | Skill | 14k | 28d ago | MIT | A | 77 | Claude Code |
| speculative-decodingOpenLAIR/dr-claw-plugin-cc | Skill | 5 | 5mo ago | none | A | 77 | Claude Code |
| speculative-decodingihatesea69/HieuNghi-AI-Skills | Skill | 3 | 8mo ago | MIT | A | 77 | Claude Code, Codex |
| model-pruningOpenLAIR/dr-claw | Skill | 1.2k | 2d ago | none | A | 70 | Claude Code, Codex |