ml-explore / ml-explore/mlx-examples

[Feature Request] Unable to Unload or Swap adapters at runtime

Open
#1,108 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
9k
Forks
1.2k
PR merge metrics
No merged PRs in 30d

Description

Currently, adapters can be loaded with:

model.load_weights('/path/to/weights', strict=False)

However, there is no way to either unload the weights:

model.unload_weights()

or to swap in a new one dynamically:

model.swap_weights('/path/to/other/weights')

This is useful for several use cases, including DPO loss calculation & Dynamically serving LoRA Adapters

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by tracing the existing model.load_weights('/path/to/weights', strict=False) entry point and how loaded adapters are tracked. Define how unload_weights() and swap_weights('/path/to/other/weights') should behave at runtime, including the DPO and dynamic-serving use cases linked in the issue. Done means both operations work without rebuilding the model and are covered by appropriate tests.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
machine-learning
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.