Repository navigation
Stop unsloth chat and unsloth inference reloading a 16-bit model in 4-bit - #11477
Conversation
Review + GitHub Actions evidenceReviewed head: Setup. Real Studio on P2, found and fixed in Results on
The same workflow with the implementation reverted to UI (API monitor page, Chromium 1366x900, same workflow, resident at ctx 0 on both sides): before, the CLI adds a second "Model loaded" row, because it reloaded the model. After, the model is reused and there is a single row. Tests: |
|
Confirmed this on main, where unsloth_cli/_inference.py always ships the default load_in_4bit so a Studio-resident 16-bit model gets requantized, and the resident precision is not inherited when another setting forces the reload. Thanks for the staging evidence on both paths, will get this reviewed. |
…n-4bit on a running server
|
Codex review on a staging copy (Lyxot#69, diff identical to this PR at e1eeaf1) converged on the first pass with no findings: Lyxot#69 (comment) There were no review threads to address on this PR. CI on the staging PR: 52 passed, 4 skipped, 2 failed. Neither failure touches
The upstream run's other failures are unrelated too: the three |
Lyxot
left a comment
There was a problem hiding this comment.
LGTM. Rechecked against current main: merges cleanly, focused CLI and reload-settings tests pass on the merge, and Codex converged on this head.
|
Pushed 7b15f72 on top of the PR: the typed-flag filter the two commands duplicated is now one Codex review on the staging copy (Lyxot#69, diff identical to this PR at 7b15f72) converged with no findings: Lyxot#69 (comment) CI on the staging PR: 51 passed, 4 skipped, 3 failed. None touches
|
…-bit (unslothai#11477) `unsloth chat` and `unsloth inference` send `load_in_4bit` to a running Unsloth server only when `--load-in-4bit` or `--no-load-in-4bit` is typed, so the untyped default no longer reloads a resident 16-bit model in 4-bit. A load that omits `load_in_4bit` for the resident model inherits its requested precision, so a reload forced by another setting keeps it.

If Studio already has a model loaded in 16-bit, running
unsloth chatorunsloth inferenceon the same model unloads it and loads it again in 4-bit. The chosen quality is lost and the model reloads for no reason.The CLI always sent 4-bit because that was its default. It now only sends it when
--load-in-4bitor--no-load-in-4bitis typed, the same way #10257 fixed this for context length. Tested on a real Studio with Qwen2.5-0.5B: main reloaded the model in 4-bit, this branch kept the 16-bit model.