Skip to content

fix(server): fail closed on unregistered model IDs - #1696

Open
SashaMIT wants to merge 1 commit into
ml-explore:mainfrom
SashaMIT:fix/server-fail-closed-model-ids
Open

fix(server): fail closed on unregistered model IDs#1696
SashaMIT wants to merge 1 commit into
ml-explore:mainfrom
SashaMIT:fix/server-fail-closed-model-ids

Conversation

@SashaMIT

@SashaMIT SashaMIT commented Aug 9, 2026

Copy link
Copy Markdown

Summary

  • ModelProvider.load treated unknown request model / draft_model / adapters values as Hub or local paths (dict.get(key, key)), so a client could force arbitrary snapshot_download / path loads against a running mlx_lm.server.
  • Fail closed: only accept registered aliases from the CLI maps, then resolve them.
  • Resolve the CLI --adapter-path against the request model id (fixes the silent drop that open Fix mlx_lm.server --adapter-path silently ignored at startup #1249 also targets; this PR additionally rejects free-form adapter paths).

Test plan

  • pytest tests/test_server.py::TestModelProviderFailClosed (4 passed)
  • Tip parent: 254d153

Commit is SSH-signed.

Made with Cursor

Request model/draft_model/adapters values were treated as Hub or local
paths when absent from the alias maps, so a client could force arbitrary
downloads. Accept only registered aliases and resolve the CLI adapter
against the request model id.
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.

1 participant