speculators.convert.eagle
Eagle checkpoint conversion utilities.
Modules:
-
eagle3_converter–Eagle-3 checkpoint converter with loguru logging.
-
eagle3_legacy_model–Legacy model implementation of EAGLE-3. This is deprecated and will be removed in the
-
eagle_converter–Eagle checkpoint converter with loguru logging.
-
eagle_legacy_model–Speculators implementations providing a unified implementation
-
utils–Utility functions for checkpoint conversion operations.
Classes:
-
Eagle3Converter–Converter for Eagle3 checkpoints to speculators format.
-
EagleConverter–Converter for Eagle/HASS checkpoints to speculators format.
Eagle3Converter
Converter for Eagle3 checkpoints to speculators format.
Handles weight remapping, embeddings replacement, and vLLM compatibility fixes. Produces production-ready models with standardized speculators_config metadata.
EagleConverter
Converter for Eagle/HASS checkpoints to speculators format.
This converter handles the transformation of Eagle-style checkpoints (including HASS variants) into the standardized speculators format. It supports automatic feature detection, weight remapping, and optional validation.
:Example:
>>> converter = EagleConverter()
>>> converter.convert(
... "yuhuili/EAGLE-LLaMA3.1-Instruct-8B",
... "./output",
... "meta-llama/Meta-Llama-3.1-8B-Instruct"
... )
Methods:
-
convert–Convert an Eagle checkpoint to speculators format.
convert
convert(
input_path: str | Path,
output_path: str | Path,
base_model: str,
fusion_bias: bool = False,
layernorms: bool = False,
validate: bool = True,
cache_dir: str | Path | None = None,
) -> None
Convert an Eagle checkpoint to speculators format.
This method orchestrates the complete conversion process:
- Ensures the checkpoint is available locally
- Loads the original config and weights
- Auto-detects features if not explicitly specified (layernorms, fusion bias)
- Builds the speculators configuration
- Processes and remaps the weights
- Saves the converted checkpoint
- Optionally validates the result by running a forward pass
:Example:
>>> # Convert standard Eagle checkpoint
>>> converter = EagleConverter()
>>> converter.convert(
... "yuhuili/EAGLE-LLaMA3.1-Instruct-8B",
... "./eagle-converted",
... "meta-llama/Meta-Llama-3.1-8B-Instruct",
... validate=True
... )
>>> # Convert HASS checkpoint with layernorms
>>> converter.convert(
... "nm-testing/Eagle_Speculator_Llama_3_1_8B_TTT",
... "./hass-converted",
... "meta-llama/Meta-Llama-3.1-8B-Instruct",
... layernorms=True
... )
Parameters:
-
(input_pathstr | Path) –Path to Eagle checkpoint (local or HuggingFace ID)
-
(output_pathstr | Path) –Where to save converted checkpoint
-
(base_modelstr) –Base model name (e.g., meta-llama/Llama-3.1-8B-Instruct)
-
(fusion_biasbool, default:False) –Enable fusion bias (auto-detected if not specified)
-
(layernormsbool, default:False) –Enable extra layernorms (auto-detected if not specified)
-
(validatebool, default:True) –Whether to validate the converted checkpoint
-
(cache_dirstr | Path | None, default:None) –Optional cache directory for downloads