Repository navigation
docs: simpler quickstart - #55
Merged
Merged
Conversation
…nt the drafter strategy) Under drafter_strategy="auto" the arm count follows the drafters when no BanditConfig is passed, so the quickstart, two recipes and the examples page drop bandit=BanditConfig(n_arms=1). The lookup-only recipe keeps it (explicit "bandit" strategy). The quickstart prints engine.drafter_strategy. A new test runs the quickstart block as written: composite-g6-f2, 128 tokens equal to HF generate(do_sample=False).
This was referenced Oct 26, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
docs: simpler quickstart
Removes
bandit=BanditConfig(n_arms=1)from the README quickstart and the docs examples wherever one model drafter isused, and prints which drafter strategy ran. Docs and tests only; no library change. Do not merge until reviewed.
Why it can go
Under the default
drafter_strategy="auto",SpeculativeEnginechecksconfig.bandit.n_armsonly when you pass aBanditConfigyourself (check_n_arms = requested != "auto" or "bandit" in config.model_fields_set). With one model drafter,"auto" resolves to
composite-g6-f2, which is one arm, so the defaultBanditConfig()(n_arms=2) is never compared.Changes
BanditConfigimport and argument; the config is one line:FlashSpecConfig(device=..., sampling=SamplingConfig(temperature=0.0));print("drafter strategy:", engine.drafter_strategy);bandit=BanditConfig(n_arms=1).drafter_strategy="bandit"explicitly, and an explicitstrategy still checks the arm count against the config. That recipe now imports
BanditConfigitself.docs/examples.md(the TinyLlamaload_draftersexample) dropsBanditConfig(n_arms=1, strategy="ucb1")and says that"auto" runs
composite-g6-f2there.Proof
New
tests/unit/test_readme.py::test_quickstart_auto_runs_composite_and_matches_hf_greedyruns the README quickstart block aswritten, on tiny models on CPU. It asserts:
BanditConfigin the block;engine.drafter_strategy == "composite-g6-f2", the reason is "auto: one model drafter…", and the arm is lookup 6 / fallback 2;drafter strategy: composite-g6-f2;generate(do_sample=False)(max_new_tokens=128, no EOS).The existing README and examples code-block tests still run every block (examples included) with the bandit config removed.
Gate
Local, on this branch:
make lint(ruff, format, import-linter),mypy --strict flashspec: cleanpytest tests/unit tests/integration -m "not gpu": 559 passed, 5 skippedpython scripts/readme_api.py --check: current (no API change)Merging this before #54 or after makes no difference; they touch different files.