pub struct PeftAdapterConfig {
pub r: usize,
pub lora_alpha: f64,
pub target_modules: Vec<String>,
pub target_modules_pattern: Option<String>,
pub use_rslora: bool,
pub layers_to_transform: Option<Vec<usize>>,
pub trainable_token_indices: Vec<u32>,
pub modules_to_save: Vec<String>,
pub lora_embedding: bool,
}Expand description
2026-09-26: The fields of a PEFT adapter_config.json that the engine uses, as validated
by parse_peft_adapter_config. lora_dropout, a training-only setting, is ignored.
Fields§
§r: usize2026-09-26: LoRA rank, greater than 0.
lora_alpha: f642026-09-26: LoRA alpha, finite and positive; the JSON may hold an integer or a float.
target_modules: Vec<String>2026-09-26: The target_modules list as written: bare module names or full paths, each
validated on its last .-segment. Per-layer matching is the weight loader’s.
target_modules_pattern: Option<String>2026-09-26: PEFT’s regex form of target_modules (a JSON string other than
all-linear), kept as written and not expanded. It skips the name-level allow-list,
but every adapter tensor is still checked by classify_key, which accepts only the
projections it names.
use_rslora: bool2026-09-26: rsLoRA: scaling is alpha/sqrt(r) instead of alpha/r. The config must
state it; an absent key is rejected rather than read as false.
layers_to_transform: Option<Vec<usize>>2026-09-26: The layers_to_transform list, if present. Nothing reads it; the weight
loader decides which layers receive deltas.
trainable_token_indices: Vec<u32>2026-09-26: Token ids for the trainable-token overlay, unique and ascending, from the
trainable_token_indices list or the list shared by its embed_tokens and lm_head
entries. Empty means no overlay.
modules_to_save: Vec<String>2026-09-26: The accepted modules_to_save leaves, embed_tokens and lm_head, sorted
and deduplicated. Any other leaf is a REJECT(modules_to_save). Empty means no
full-module overlay.
lora_embedding: bool2026-09-26: Always false from this parser. Low-rank embedding LoRA
(lora_embedding_A/B) is detected from tensor names by the overlay loader, which
rejects it.
Implementations§
Trait Implementations§
Source§impl Clone for PeftAdapterConfig
impl Clone for PeftAdapterConfig
Source§fn clone(&self) -> PeftAdapterConfig
fn clone(&self) -> PeftAdapterConfig
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more