S
speculative-decoding
Accelerate LLM inference using speculative decoding, Medusa multiple heads, and lookahead decoding techniques. Use when optimizing inference speed (1.5-3.6× speedup), reducing latency for real-time applications, or deploying models with limited compute. Covers draft models,
Installation
Pick a client and clone the repository into its skills directory.
Installation
About this skill
Accelerate LLM inference using speculative decoding, Medusa multiple heads, and lookahead decoding techniques. Use when optimizing inference speed (1.5-3.6× speedup), reducing latency for real-time applications, or deploying models with limited compute. Covers draft models, tree-based attention, Jacobi iteration, parallel token generation, and production deployment strategies.
How to use
- Zainstaluj wymagane biblioteki: pip install transformers accelerate. 2. Dla Medusy (wielogłowicowe dekodowanie) sklonuj repozytorium: git clone https://github.com/FasterDecoding/Medusa, przejdź do katalogu i uruchom pip install -e . 3. Dla Lookahead Decoding sklonuj https://github.com/hao-ai-lab/LookaheadDecoding, przejdź do folderu i zainstaluj pakiet poleceniem pip install -e . 4. Opcjonalnie zainstaluj vLLM dla zaawansowanego serwowania: pip install vllm. 5. Załaduj model docelowy (duży, wolny) i model draft (szybki, mały) za pomocą AutoModelForCausalLM z transformers. 6. Uruchom dekodowanie spekulacyjne, przekazując oba modele do funkcji generacji — system automatycznie przyspieszy wnioskowanie o 1,5–3,6× bez zmian w architekturze modelu.