Repository navigation
MLX: Clef Omni in Unsloth Studio, with audio in the Decision API and decision training - #13538
Conversation
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
3046769 to
0ed0dc3
Compare
c186786 to
296a39d
Compare
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 98d6e8c4d5
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 4cd690292b
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
@codex review |
|
Codex Review: Something went wrong. Try again later by commenting “@codex review”. ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
…s it FastDecisionModel.build_dataset reads a row's "audio" (data URLs, an undecoded audio column's bytes or file, or decoded 16 kHz mono clips) and predict takes audio = the same way, passing both to unsloth-zoo's MLX decision engine. An unsloth-zoo that takes no audio is reported instead of training without those rows, as for images.
…ough MLX POST /v1/systemone accepts `audio`, an array of base64 data URLs, beside `images`. Only unsloth-zoo's MLX engine hears, so a request with clips is answered by a Clef that has an audio tower on Apple Silicon or refused: an entry that does not hear, a PyTorch or llama.cpp runtime setting, and a Decision API connection all say so instead of answering without the clips. The route checks the number of clips, their shape and their total size; the engine decodes them. Such a Clef lists `audio` among its input modalities. A local Clef folder that keeps its towers under `thinker_config` is now recognized as reading images too.
… decision run on rows with audio
…g for a model pin it never uses
…ewritten to its download
|
@codex review |
|
Codex Review: Something went wrong. Try again later by commenting “@codex review”. ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 03f899b813
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Review and CI summaryCodex: five review rounds ran; the last, on the current head CI on a copy of this head and base, run while the upstream checks were queued (Lyxot#163): 60 passed, 7 skipped, 2 failed. Both failures come from
Changed during review:
|
…udio, S3 path-string clips survive cleanup
|
Codex Review: Something went wrong. Try again later by commenting “@codex review”. ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
|
Codex Review: Didn't find any major issues. Keep them coming! Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
What this adds
unsloth-zoo's MLX decision engine serves and trains a Clef on an omni base model, which hears audio as well as reading images (unslothai/unsloth-zoo#1689, merged). Neither
FastDecisionModelnor Unsloth Studio had a way to hand it audio, and Unsloth Studio did not offer Clef Omni at all. This is the companion change, for Apple Silicon only. It also makes training a plain text, vision or omni model as a decision model (a fresh Clef head) work end to end on a Mac: train, save, serve.One commit per piece:
FastDecisionModelon MLX carries audio.build_datasetreads a row's"audio"(data URLs, the{"bytes", "path"}of an undecoded audio column, decoded{"array", "sampling_rate"}clips at 16 kHz mono, or the decoder objectdatasets4 yields), andpredict(..., audio=)takes the same forms. With an unsloth-zoo that takes no audio both raise anImportErrorasking for a newer one, where skipping the rows would silently train without them. Laya'spredictrefuses audio, as it refuses images, and the Unsloth Studio training page blocks an audio dataset for a Laya run. Rows whose audio the model cannot hear or that cannot be decoded are skipped with the reason in the dataset report, as image rows are.POST /v1/systemoneacceptsaudio: up to 8 base64data:audio/...URLs, 40 MiB together, besideimages. The route checks count, shape, base64 and size; the engine decodes and applies its own length limit. Audio is never dropped: only the MLX engine serving a Clef that hears answers such a request. Any other model, the PyTorch or llama.cpp runtime, and a Decision API connection refuse it with a 4xx that says why. Settings and/v1/modelsreportaudioininput_modalitiesfor a model that hears.clef-omniismlx-community/clef-omni-8bit(33 GB). It is the first catalog entry whose own backend is MLX: it is served by the MLX engine or refused, under every runtime setting, the way a GGUF entry is served by llama.cpp or refused. Where the engine is not available (not Apple Silicon, or the Decision API set to CPU) the settings list it as unavailable with the reason.mlx-community/clef-omni-8bit. The Hub tagclefnow marks a decision model before the model's config loads, so a Clef repo tagged for audio is no longer read as a chat audio model and refused on a Mac. A Clef decision run on a Mac is no longer held to the chat audio limits: the MLX trainer reads the audio in its own rows and reports the ones the model cannot hear, so a dataset with anaudiocolumn can start, and the request no longer carries the chat audio flag the backend refuses on Apple Silicon. Laya, a Clef on another device and chat models are held as before.vision_configoraudio_configin its config. Phi-4-multimodal names its towers underembd_layer, and Nemotron Omni its audio towersound_config, so either was served as text only.Scope: MLX only
llama.cpp has no decision graph for Clef Omni, so there is no GGUF entry and nothing changes on the GGUF side:
export_decision_ggufalready refuses a Clef whose backbone is not Qwen3.5. The PyTorch decision path is not touched.Depends on
ValueError: [broadcast_shapes] Shapes (1,303,2048) and (303,3,2048) cannot be broadcast). Serving does not depend on it.Not in this PR
decidetool, and Decision API connections.clef-omniis still listed by/v1/modelson machines that cannot serve it, as GGUF entries are without a llama-server; a request for it gets a 400 with the reason.mlx-community/NVIDIA-Nemotron-3-Nano-Omni-30B-A3B-4bitkeeps its decoder as top-levelbackbone.*, which mlx-vlm does not load for chat training either;mlx-community/Nemotron-3-Nano-Omni-30B-A3B-Reasoning-8bitworks.Validation
On an M3 Max, with the unsloth-zoo fixes above:
POST /v1/systemonewith modelclef-omniand one WAV clip names the clip's topic at 0.97 to 0.99 confidence for three different clips and for a 44.1 kHz stereo one; two clips and no clip answer differently; an undecodable clip is a 422. The response header reports themlxbackend and the settings report["text", "image", "audio"].POST /api/train/startas the training page sends a decision run (12 rows: audio only, image only, image and audio, text only; 12 steps), saved, set as the Decision API model and asked with text, an image and three clips:UI before and after
Settings > API keys > Decision API > Model on a Linux CUDA host (merge base vs this PR): the list gains a disabled "Clef Omni 35 GB" row whose hover reason reads "clef-omni is served only by MLX. The MLX runtime needs Apple Silicon with the Decision API on the GPU."; every other row is unchanged.