speculators.models.eagle3
Modules:
Classes:
-
Eagle3DraftModel– -
Eagle3SpeculatorConfig–Configuration for EAGLE-3 speculator with vocabulary mapping.
Eagle3DraftModel
Bases: SpeculatorModel
Methods:
-
from_training_args–Create Eagle3 model from training arguments.
-
get_trainer_kwargs–Get training and validation kwargs for Eagle3.
Source code in speculators/models/eagle3/core.py
from_training_args classmethod
Create Eagle3 model from training arguments.
Args: verifier_config: Verifier model configuration **kwargs: Training arguments with Eagle3-specific params - num_layers: Number of decoder layers - norm_before_residual: Whether to normalize before residual connection - t2d: Target-to-draft vocabulary mapping tensor - d2t: Draft-to-target vocabulary mapping tensor - ttt_steps: Number of TTT steps - verifier_name_or_path: Path to verifier model
Returns: Initialized Eagle3DraftModel
Source code in speculators/models/eagle3/core.py
get_trainer_kwargs staticmethod
Get training and validation kwargs for Eagle3.
Args: **kwargs: Training arguments
Returns: Tuple of (train_call_kwargs, val_call_kwargs)
Source code in speculators/models/eagle3/core.py
Eagle3SpeculatorConfig
Bases: SpeculatorModelConfig
Configuration for EAGLE-3 speculator with vocabulary mapping.
EAGLE-3 features vocabulary mapping between draft (32K) and target (128K) vocabularies, enabling cross-tokenizer speculation.
Parameters:
-
–transformer_layer_configConfiguration for the transformer decoder layer
-
–draft_vocab_sizeSize of draft model vocabulary for speculation
-
–norm_before_residualApply hidden_norm before storing residual
Methods:
-
serialize_transformer_config–Serialize transformer config to dict.
-
validate_transformer_config–Validate and convert transformer config.
Attributes:
-
target_vocab_size(int) –Get target vocabulary size from transformer config.
Source code in speculators/config.py
target_vocab_size property
Get target vocabulary size from transformer config.
serialize_transformer_config
validate_transformer_config classmethod
Validate and convert transformer config.