Paper Feed

Issue 43 · Project 06 GitHub AI / ML ✓ read

eagle-hq/EAGLE-4

Official Inference Code of EAGLE-4

TL;DR: EAGLE-4 is the next iteration of the EAGLE speculative-decoding line, and the headline change isn't a better draft model — it's eagle-harness, a runtime layer that measures actual draft/verify costs on your hardware and picks speculation depth and tree size per batch size and workload. That attacks the real-world failure mode of speculative decoding (it helps at batch 1, hurts at high concurrency, so operators turn it off), with claimed lossless speedups of 3.42× at one request down to 1.39× at 64 concurrent on 4×B300, and "keeps pace with plain decoding up to 512 concurrent." One big caveat: unlike earlier EAGLEs, this is source-available with commercial restrictions, not open source.

What it is and why it matters

EAGLE (1–3) established the dominant family of speculative decoding methods: a small drafter extrapolates target-model features, proposes a token tree, and the target verifies in one forward pass, with outputs guaranteed identical to plain decoding. The known weakness is that fixed speculation configs (tree depth, top-k, draft tokens) are tuned for a sweet spot — usually low batch — and lose to vanilla decoding as concurrency rises, because verification FLOPs stop being free when the GPU is already saturated. Most serving stacks therefore disable speculation under load.

EAGLE-4's pitch is "leave speculation on." The harness measures live costs on your specific setup (it calibrates during the first requests after startup) and decides how far to speculate so the draft tree fits the current batch size, hardware, and workload. The README's framing — "one flexible drafter for all batch sizes and hardware" — is exactly the gap worth closing. Note the honest shape of the high-load claim: at 512 concurrent requests it keeps pace with plain decoding, i.e., no regression, not a speedup. That's still the thing that lets you leave it enabled.

What's actually in the repo

This repo is the inference harness, not training code. Concretely:

  • eagle-harness, a Python package that plugs EAGLE-4 into SGLang, vLLM, and TokenSpeed via a EAGLE_HARNESS speculative-algorithm hook.
  • A released EAGLE-4 draft model for Qwen3.8-27B (the only draft mentioned in the README; docs apparently cover adding new models).
  • Docker images, pinned pip wheels (CUDA 13), engine guides with the exact measured commands, a support matrix with tokens/s and correctness checks, and a ROCm/MI355X path contributed by AMD-side contributors (AITER, Triton kernels, Split-KV on GFX950).

Measured speedups vs. the same engine without speculation, Qwen3.8-27B, temperature 0, SPEED-Bench, 4×B300:

EAGLE-4 speedup vs. non-speculative baseline (Qwen3.8-27B, 4×B300)speedup ×00.511.522.533.53.422.833.091 request2.091.722.028 concurrent1.391.141.4164 concurrentSGLangvLLMTokenSpeedFrom the README's support matrix. AMD MI355X (SGLang): 2.07× at 8 concurrent, 1.56× at 32.

Standard speculative-decoding caveats apply: temperature-0 benchmarks flatter acceptance rates, and gains are strongly workload- and model-dependent. The graceful degradation curve (3.4× → 1.14–1.41× at 64 concurrent, break-even at 512) is the honest and interesting part — most published speculative-decoding numbers hide the right side of that curve. The README says output is exactly what the target would generate, with correctness checks in the support matrix, consistent with prior EAGLE verification guarantees.

How it works (as far as the README says)

The README is thin on mechanism — the paper and a "How it works" doc carry the details. What's inferable: the drafter is EAGLE-style (feature-level extrapolation, tree drafting), and the harness replaces fixed --speculative-num-steps/topk/num-draft-tokens tuning with cost-model-driven selection from live measurements. The quick start still passes those flags explicitly for SGLang with --speculative-algorithm-config '{}', suggesting the config can be overridden or that the harness operates within bounds. First requests after startup compile kernels and measure costs, so you must warm up before benchmarking. Don't take more than this from me — the method specifics aren't in the README.

Maturity, license, and gotchas

  • License is the big one. Source-available, explicitly not OSI open source. Any "Competing Offering" requires a commercial license regardless of revenue; other commercial use is capped at $20M aggregate revenue over any 12-month window, and the requirement persists after revenue later drops. The license claims acceptance by downloading or forking. If you run an inference-serving business, read it before touching the repo. EAGLE-1/2/3 remain available under their original terms if you need a permissive baseline.
  • Week-old repo (1k stars already), one released draft model, pinned dependency stack: Python 3.12, CUDA 13, a dev build of SGLang (0.5.23.dev252+eagle.9). Expect integration friction outside the blessed recipes.
  • ~62 GB first-start download for Qwen3.8-27B plus draft; measured numbers use 4×B300, though the quick start runs on one.
  • AMD support is real but newer (community-contributed ROCm port).

Try it

Fastest path is the Docker SGLang route on one B300-class GPU:

docker run --gpus all --ipc host -p 127.0.0.1:30000:30000 \
  -e HF_HOME=/hf -v ~/.cache/huggingface:/hf \
  ghcr.io/eagle-hq/eagle-4-sglang:0.1.2 \
  sglang serve --model-path Qwen/Qwen3.8-27B --host 0.0.0.0 \
  --disable-overlap-schedule --speculative-algorithm EAGLE_HARNESS \
  --speculative-draft-model-path EAGLE-Corp/Qwen3.8-27B-EAGLE4 \
  --speculative-num-steps 12 --speculative-eagle-topk 4 \
  --speculative-num-draft-tokens 16 --speculative-algorithm-config '{}'

Send a few warm-up requests before timing, then benchmark against the same command minus the --speculative-* flags, at your concurrency levels — that's where this either earns its keep or doesn't.