veloxquant_mlx.cache.options module¶
Per-method option dataclasses for KVCacheConfig.
KVCacheConfig grew one flat dataclass field per quantization/eviction
method’s hyperparameter (207 fields across 37 method families as of this
module’s introduction) rather than one option object per method (#420). This
module groups each method’s already-adjacent fields into its own small
dataclass so a caller configuring, say, H2O only sees H2O’s five fields
instead of all 207.
Usage:
from veloxquant_mlx.cache.options import H2OOptions
config = KVCacheConfig(method="h2o", options=H2OOptions(budget=1024))
Passing options populates the matching flat fields on KVCacheConfig
(here, h2o_budget) for any flat field still at its dataclass default, so
every existing cache class – which reads getattr(config, "h2o_budget",
512) directly – keeps working unchanged; see KVCacheConfig.__post_init__.
Setting a flat per-method field directly still works too (backwards
compatible) but now emits a DeprecationWarning naming the options
replacement.
These classes are pure data containers with no behavior of their own –
field names, types, defaults, and comments are carried over verbatim from
the original flat fields on KVCacheConfig.
- class veloxquant_mlx.cache.options.VecInferOptions(key_sub_dim=4, value_sub_dim=8, key_codebook_bits=12, value_codebook_bits=8, residual_length=128)[source]¶
Bases:
objectVecInfer-specific configuration.
- Parameters:
- class veloxquant_mlx.cache.options.KIVIOptions(kivi_group_size=32)[source]¶
Bases:
objectKIVI configuration (asymmetric group quantization).
- Parameters:
kivi_group_size (int)
- class veloxquant_mlx.cache.options.SVDqOptions(svdq_rank=None, svdq_energy_threshold=0.95, svdq_bit_schedule=(8, 4, 2, 1, 1, 0, 0, 0), svdq_group_size=32)[source]¶
Bases:
objectSVDq configuration (sub-2-bit key compression via offline SVD).
- Parameters:
- class veloxquant_mlx.cache.options.KittyOptions(kitty_hi_fraction=0.25, kitty_hi_bit=4, kitty_lo_bit=2, kitty_group_size=32)[source]¶
Bases:
objectKitty configuration (dynamic channel-wise mixed-precision).
- class veloxquant_mlx.cache.options.AdaKVOptions(adakv_target_avg_bits=2.5, adakv_lo_bit=2, adakv_mid_bit=3, adakv_hi_bit=4, adakv_group_size=32, adakv_update_interval=1, adakv_importance='norm_variance', adakv_obs_window=32)[source]¶
Bases:
objectAdaKV-proxy configuration (per-head adaptive bit allocation).
- Parameters:
- class veloxquant_mlx.cache.options.XQuantOptions(xquant_group_size=2, xquant_base_bits=2, xquant_residual_bits=4, xquant_group_quant_size=32, xquant_max_ctx=8192)[source]¶
Bases:
objectXQuant configuration (cross-layer KV cache reuse).
- Parameters:
- class veloxquant_mlx.cache.options.KVQuantOptions(kvquant_bits=3, kvquant_outlier_fraction=0.01, kvquant_group_size=32, kvquant_lloyd_iters=8, kvquant_refit_interval=0, kvquant_n_sink=1)[source]¶
Bases:
objectKVQuant-NUQ configuration (non-uniform datatype + outlier isolation).
- Parameters:
- class veloxquant_mlx.cache.options.PALUOptions(palu_rank=None, palu_energy_threshold=0.9, palu_n_head_groups=4, palu_hi_bit=4, palu_lo_bit=2, palu_hi_fraction=0.25, palu_group_size=32, palu_quantize_values=True)[source]¶
Bases:
objectPALU configuration (true-latent low-rank K and V).
- Parameters:
- class veloxquant_mlx.cache.options.CacheGenOptions(cachegen_bits=4, cachegen_group_size=32, cachegen_use_delta=True, cachegen_per_channel=True, cachegen_layer_groups=3, cachegen_resolved_bits=None)[source]¶
Bases:
objectCacheGen configuration (entropy-coded byte model over group quant).
- Parameters:
- class veloxquant_mlx.cache.options.MiniCacheOptions(minicache_start_frac=0.5, minicache_group_size=2, minicache_retention_threshold=0.9, minicache_slerp_t=0.5, minicache_max_ctx=8192)[source]¶
Bases:
objectMiniCache configuration (cross-layer depth-dimension SLERP merge).
- Parameters:
- class veloxquant_mlx.cache.options.GEAROptions(gear_bits=2, gear_rank=None, gear_energy_threshold=0.9, gear_sparse_fraction=0.01, gear_group_size=32, gear_quantize_values=True)[source]¶
Bases:
objectGEAR configuration (error-feedback: residual low-rank + sparse outliers).
- Parameters:
- class veloxquant_mlx.cache.options.ZipCacheOptions(zipcache_hi_bits=4, zipcache_lo_bits=2, zipcache_hi_fraction=0.2, zipcache_group_size=32, zipcache_quantize_values=True)[source]¶
Bases:
objectZipCache-adapted configuration (saliency-adaptive per-token mixed-precision).
- Parameters:
- class veloxquant_mlx.cache.options.SnapKVOptions(snap_dtype='auto', snap_batched_scoring=True, snap_backend='auto', snap_budget=512, snap_obs_window=32, snap_n_sink=4)[source]¶
Bases:
objectSnapKV-adapted configuration (prefill observation-window token eviction).
- Parameters:
- class veloxquant_mlx.cache.options.StreamingLLMOptions(stream_n_sink=4, stream_window_size=512)[source]¶
Bases:
objectStreamingLLM-adapted configuration (sink + recency-window structural eviction).
- class veloxquant_mlx.cache.options.H2OOptions(h2o_budget=512, h2o_n_sink=4, h2o_rope_base=10000.0, h2o_grace=16, h2o_decay=0.98)[source]¶
Bases:
objectH2O-adapted configuration (cumulative attention-mass heavy-hitter eviction).
- Parameters:
- class veloxquant_mlx.cache.options.TOVAOptions(tova_budget=512, tova_n_sink=4, tova_backend='auto')[source]¶
Bases:
objectTOVA-adapted configuration (current-step attention-weight eviction, memoryless).
- class veloxquant_mlx.cache.options.PyramidKVOptions(pyramid_budget=512, pyramid_backend='reference', pyramid_n_sink=4, pyramid_beta=2.0, pyramid_resolved_budget=None)[source]¶
Bases:
objectPyramidKV-adapted configuration (layer-adaptive budget attention-mass eviction).
- Parameters:
- class veloxquant_mlx.cache.options.SqueezeAttentionOptions(squeeze_budget=512, squeeze_n_sink=4, squeeze_strength=1.0, squeeze_resolved_budget=None)[source]¶
Bases:
objectSqueezeAttention-adapted configuration (2D layer×token data-driven budget eviction).
- Parameters:
- class veloxquant_mlx.cache.options.ChunkKVOptions(chunkkv_budget=512, chunkkv_chunk_size=8, chunkkv_n_sink=4, chunkkv_score='attn_mass', chunkkv_reuse_layers=1)[source]¶
Bases:
objectChunkKV-adapted configuration (chunk-level / semantic-block eviction).
- Parameters:
- class veloxquant_mlx.cache.options.CaMOptions(cam_budget=512, cam_n_sink=4, cam_merge='sim_weighted', cam_merge_keys=False, cam_merge_gate=True)[source]¶
Bases:
objectCaM-adapted configuration (cache merging — merge evicted tokens, not drop).
- Parameters:
- class veloxquant_mlx.cache.options.XKVOptions(xkv_group_size=2, xkv_rank=None, xkv_energy_threshold=0.95, xkv_latent_bits=4, xkv_group_quant_size=32, xkv_max_ctx=8192)[source]¶
Bases:
objectxKV configuration (cross-layer shared-subspace key compression).
- Parameters:
- class veloxquant_mlx.cache.options.NSNQuantOptions(nsn_bits=2, nsn_residual_length=64, nsn_codebook_size=256, nsn_subvector_dim=8, nsn_seed=1234, nsn_max_ctx=8192)[source]¶
Bases:
objectNSNQuant configuration (calibration-free universal-codebook VQ).
- Parameters:
- class veloxquant_mlx.cache.options.L2NormOptions(knorm_budget=512, knorm_n_sink=4, knorm_recent=0, knorm_keep='low')[source]¶
Bases:
objectL2Norm-adapted configuration (intrinsic key-norm eviction).
- class veloxquant_mlx.cache.options.SKVQOptions(skvq_bits_key=2, skvq_bits_value=2, skvq_group_size=32, skvq_window=128, skvq_n_sink=5, skvq_reorder=True, skvq_clip_search=True, skvq_clip_alpha=1.0, skvq_max_ctx=None)[source]¶
Bases:
objectSKVQ-adapted configuration (sliding-window reorder + clip quant).
- Parameters:
- class veloxquant_mlx.cache.options.QFiltersOptions(qfilters_budget=512, qfilters_n_sink=4, qfilters_recent=0, qfilters_calib_tokens=128, qfilters_sign=1, qfilters_min_retention=0.9, qfilters_on_low_retention='warn')[source]¶
Bases:
objectQ-Filters-adapted configuration (query-agnostic projection eviction).
- Parameters:
- class veloxquant_mlx.cache.options.KeyformerOptions(keyformer_budget=512, keyformer_n_sink=4, keyformer_recent=0, keyformer_tau=None, keyformer_tau_init=1.0, keyformer_tau_end=1.0, keyformer_anneal_steps=0, keyformer_rope_base=10000.0, keyformer_seed=0)[source]¶
Bases:
objectKeyformer-adapted configuration (Gumbel-regularized eviction).
- Parameters:
- class veloxquant_mlx.cache.options.MorphKVOptions(morphkv_budget=512, morphkv_n_sink=4, morphkv_window=8)[source]¶
Bases:
objectMorphKV-adapted configuration (recent-window correlation retention).
- class veloxquant_mlx.cache.options.KVzipOptions(kvzip_budget=512, kvzip_n_sink=4, kvzip_probe='context')[source]¶
Bases:
objectKVzip-adapted configuration (context-reconstruction reliance eviction).
- class veloxquant_mlx.cache.options.KVTCOptions(kvtc_bit_budget=512, kvtc_bit_choices=(0, 1, 2, 3, 4, 6, 8), kvtc_beta=3.5)[source]¶
Bases:
objectKVTC-adapted configuration (local PCA + DP-optimal bit allocation + entropy coding).
- class veloxquant_mlx.cache.options.CurDKVOptions(curdkv_budget=512, curdkv_n_sink=4, curdkv_rank_cap=16, curdkv_rope_base=10000.0)[source]¶
Bases:
objectCurDKV-adapted configuration (value-aware leverage-score eviction).
- class veloxquant_mlx.cache.options.NestedKVOptions(nestedkv_budget=512, nestedkv_n_sink=4, nestedkv_window=64, nestedkv_beta=3.0, nestedkv_tau=0.6, nestedkv_kappa=10.0, nestedkv_safeguard_alpha=0.2)[source]¶
Bases:
objectNestedKV-adapted configuration (multi-scale ensembled prefill eviction; no verified venue).
- Parameters:
- class veloxquant_mlx.cache.options.AMCOptions(amc_k_high=0.2, amc_k_mid=0.3, amc_use_query_saliency=False, amc_query_alpha=0.5, amc_adaptive_thresholds=False, amc_threshold_window=64, amc_gamma=0.1, amc_calib_variance=None, amc_group_size=32)[source]¶
Bases:
objectAMC-adapted configuration (saliency-driven tiered rank+precision; no verified venue).
- Parameters:
- class veloxquant_mlx.cache.options.A2ATSOptions(a2ats_codebook_bits=8, a2ats_sub_dim=8, a2ats_window=128, a2ats_b=2048, a2ats_use_query_aware=True, a2ats_beta=0.5, a2ats_retrieval_fraction=0.2, a2ats_rope_base=10000.0, a2ats_rope_scaling=None, a2ats_query_h=None, a2ats_codebook=None)[source]¶
Bases:
objectA2ATS-adapted configuration (windowed RoPE + query-aware VQ).
- Parameters:
- class veloxquant_mlx.cache.options.AnchorKVOptions(anchorkv_theta=0.05, anchorkv_window=32, anchorkv_rho=0.7, anchorkv_anchor_frac=0.0078125, anchorkv_residual_bits=2, anchorkv_seed=42)[source]¶
Bases:
objectAnchorKV-adapted configuration (anchor-residual compression, no eviction; no verified venue).
- Parameters:
- class veloxquant_mlx.cache.options.RocketKVOptions(rocketkv_compression_ratio=8.0, rocketkv_page_size=None, rocketkv_head_topk1=None, rocketkv_obs_window=32, rocketkv_n_sink=4)[source]¶
Bases:
objectRocketKV-adapted configuration (two-stage: SnapKV eviction + hybrid sparse attention).
- Parameters:
- class veloxquant_mlx.cache.options.AgeTieredKVOptions(age_recent_boundary=128, age_mid_boundary=1024, age_bits_recent=8, age_bits_mid=4, age_bits_old=2, age_group_size=32)[source]¶
Bases:
objectAgeTieredKV configuration (position/age-gated 3-tier precision, issue #256).
- Parameters: