Skip to content

Raise clear error when LoRA config uses 'alpha' instead of 'scale' - #1671

Open
arjunneema09 wants to merge 1 commit into
ml-explore:mainfrom
arjunneema09:arjunneema09-patch-1
Open

Raise clear error when LoRA config uses 'alpha' instead of 'scale'#1671
arjunneema09 wants to merge 1 commit into
ml-explore:mainfrom
arjunneema09:arjunneema09-patch-1

Conversation

@arjunneema09

Copy link
Copy Markdown

Fixes #1670

What

Raises a clear KeyError message when a LoRA config uses alpha instead
of scale, instead of the previous bare KeyError: 'scale' with no context.

Why

mlx-lm's LoRA config format requires scale, but many LoRA tutorials and
other frameworks (e.g. PEFT) use alpha for a related concept. This is an
easy mistake to make with a confusing failure mode.

Testing

Verified the syntax compiles cleanly. I wasn't able to run the full
reproduction locally due to an unrelated MLX/macOS 26.2 compatibility
issue on my machine (metallib load failure, independent of this change) —
happy to confirm behavior further if needed, or a maintainer can verify.

mlx-lm's LoRA config format uses 'scale', but many LoRA tutorials and
other frameworks use 'alpha' for a related concept, which previously
caused a bare, unhelpful KeyError. This adds a message pointing users
at the correct key.

Fixes ml-explore#1670
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Confusing bare KeyError when LoRA config uses "alpha" instead of "scale"

1 participant