Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
145 commits
Select commit Hold shift + click to select a range
c34b981
Add Apple Silicon / MLX support with CCE training
Manan17 Feb 10, 2026
20ea262
Delete unsloth_compiled_cache/moe_utils.py
Manan17 Feb 10, 2026
18aaf4f
Add gradient checkpointing, compile support, and improved benchmarking
Manan17 Feb 13, 2026
82d75e0
Improve compiled training loop, CCE memory optimizations, and LoRA st…
Manan17 Mar 13, 2026
40a85c4
updading git ignore
Mar 14, 2026
a61cb84
adding compatibility tests file
Mar 14, 2026
d6b2624
Adding saving, exporting support
Manan17 Mar 31, 2026
f0029b6
cleanup for MLX
Manan17 Apr 1, 2026
901c868
shifting the save and merge model funcitons
Manan17 Apr 1, 2026
ad8a7d5
Bundle runtime-cce into unsloth_zoo
Manan17 Apr 7, 2026
dfade5d
Make GPU deps conditional - skip torch/triton/trl/peft on macOS arm64
Manan17 Apr 7, 2026
8530d72
Use shared transformers version across platforms
Manan17 Apr 7, 2026
531f085
channging the transformers versions
Manan17 Apr 7, 2026
7e46e8a
Clean up dead code and experimental code in mlx cce
mmathew23 Apr 8, 2026
b56285b
Merge pull request #1 from Manan17/pr/cleancce
Manan17 Apr 8, 2026
a708dc4
Initial mlx-vlm support
mmathew23 Apr 9, 2026
a65a7a6
After fixes
mmathew23 Apr 9, 2026
ea73d30
Add Apple Silicon MLX support with bundled CCE
Manan17 Apr 9, 2026
11e1b36
add review fixes
mmathew23 Apr 9, 2026
9067d08
fix bugs
mmathew23 Apr 9, 2026
38d394f
accumulate loss in 32 bit
mmathew23 Apr 9, 2026
26f1fc6
add check for fullly masked prompt after train on responses
mmathew23 Apr 9, 2026
4f7fbfa
Add step callback to MLXTrainer for real-time progress reporting
Manan17 Apr 10, 2026
718d154
Merge pull request #3 from Manan17/feat/mlx-vlm
Manan17 Apr 10, 2026
44d4e68
mlx with studio
Manan17 Apr 14, 2026
706822f
fixing vision training
Manan17 Apr 14, 2026
5732c0c
fixing the variable size images for training
Manan17 Apr 14, 2026
67618d8
fixing dtype issues
Manan17 Apr 14, 2026
8aba702
send extra kwargs
Manan17 Apr 14, 2026
78b741a
adding chat
Manan17 Apr 14, 2026
e71427a
removing max grad norm atm
Manan17 Apr 16, 2026
b010501
Adding export and fixing training issues, inference with lora adaptors
Manan17 Apr 19, 2026
233d0f0
cherry-pick: fix vlm compile (e40c76b)
Manan17 Apr 19, 2026
0734bb5
fix gemmas
mmathew23 Apr 17, 2026
039f68c
fix chat template
mmathew23 Apr 17, 2026
2d311fb
update
mmathew23 Apr 17, 2026
02ca8dd
quick refactor
mmathew23 Apr 17, 2026
447014a
refactor
mmathew23 Apr 17, 2026
2f36056
maybe another refactor done
mmathew23 Apr 18, 2026
3b3efba
better grad clipping
mmathew23 Apr 18, 2026
6fb3179
clip grad norm 1
mmathew23 Apr 18, 2026
fbbd89e
minor updates
mmathew23 Apr 18, 2026
295f014
find vision loras correctly
mmathew23 Apr 20, 2026
879ef25
Merge pull request #4 from Manan17/fix/vision-lora
Manan17 Apr 20, 2026
317c7de
fix: add _fix_missing_no_grad to text path for VLM models loaded via …
Manan17 Apr 21, 2026
1ab21b4
Merge branch 'mlx-apple-silicon'
Manan17 Apr 21, 2026
175b772
fix: ensure gguf package installed before GGUF export
Manan17 Apr 21, 2026
492f98f
feat: memory-efficient custom VJP for GatedDeltaNet (Qwen3.5)
Manan17 Apr 24, 2026
5fca3ec
fix: call install_mlx_compile_patches before training for Qwen3.5 cac…
Manan17 Apr 24, 2026
cab1ad0
fix: patch Qwen3.5 attention cache=None crash during training
Manan17 Apr 24, 2026
13e6529
refactor: unify MLX trainer step_fn and data prep, remove dead CCE code
Manan17 Apr 27, 2026
0ac3ddd
feat(mlx): add dtype param to FastMLXModel.from_pretrained
Manan17 Apr 28, 2026
c44757c
fix(mlx-vlm): make Gemma3 + LaTeX_OCR training work with VLM CCE and CE
Manan17 Apr 28, 2026
116d4cd
feat(mlx): add full_finetuning param to FastMLXModel
Manan17 Apr 28, 2026
5e9aeee
feat(mlx): add revision + random_state plumbing to FastMLXModel
Manan17 Apr 29, 2026
c0986f7
feat(mlx): add save_method to save_pretrained_merged
Manan17 Apr 29, 2026
c97f027
fix(mlx): wire save_method through and fix HF Hub auth on push
Manan17 Apr 29, 2026
d1ab894
quantization config support
mmathew23 Apr 30, 2026
161ac88
eager fixes
mmathew23 Apr 30, 2026
7cd904c
clean up
mmathew23 Apr 30, 2026
1009126
make gemma4 patch more generic
mmathew23 Apr 30, 2026
fe38c99
add new 4bit quant types
mmathew23 Apr 30, 2026
d25869a
Merge pull request #5 from Manan17/feat/quant_config
Manan17 Apr 30, 2026
521f003
feat(mlx): GPU-parity push_to_hub_merged params + private toggle fix
Manan17 Apr 30, 2026
cc973ce
feat(mlx): expose first_conversion in save_pretrained_gguf
Manan17 Apr 30, 2026
856efd7
fix(mlx): apply VLM runtime quantization without monkey-patching mlx-vlm
Manan17 Apr 30, 2026
9fb24a2
rslora, init lora, random_state for peft model
mmathew23 Apr 30, 2026
3677e64
update token gaps
mmathew23 Apr 30, 2026
75c8071
target module fix
mmathew23 Apr 30, 2026
ae1a78d
handle unknown optim and lr scheduler
mmathew23 Apr 30, 2026
2212399
feat(mlx): auto-pick dtype when None based on chip
Manan17 Apr 30, 2026
5ac0f74
Merge pull request #6 from Manan17/update/peftkwargs
Manan17 May 1, 2026
4a7c5ae
Merge remote-tracking branch 'upstream/main'
Manan17 May 1, 2026
98d6f27
fix(mlx): drop VLM training memory by 60-90% across Gemma3, Qwen2.5-VL
Manan17 May 1, 2026
3f90381
feat(mlx): wire finetune_language/attention/mlp/vision flags through …
Manan17 May 1, 2026
2847103
fix(mlx): make finetune flags work for target_modules='all-linear' too
Manan17 May 2, 2026
535b250
fix(mlx): use FastMLXModel for adapter base load — fixes VLM export
Manan17 May 3, 2026
29d47e9
fix(mlx): drop track_grad_norm regression, add elementwise grad clip
Manan17 May 4, 2026
9d57b69
Merge branch 'unslothai:main' into main
Manan17 May 4, 2026
e91fd4d
removing test files
Manan17 May 4, 2026
67ca051
add
Manan17 May 4, 2026
2053539
fix(mlx): repair stub injection on Apple Silicon (3 sub-bugs)
Manan17 May 5, 2026
46866ce
fix(mlx): correct GatedDeltaNet VJP mask handling + actually run it
Manan17 May 5, 2026
7f8b0ca
fix(mlx): make target_modules='all-linear' actually mean every nn.Linear
Manan17 May 5, 2026
7d2bb95
fix(mlx): reject full_finetuning against pre-quantized repos loudly
Manan17 May 5, 2026
70b93ad
fix(mlx): migrate deprecated mx.metal memory APIs + restore device-ag…
Manan17 May 5, 2026
58a2602
Allow local convert_hf_to_gguf.py via UNSLOTH_LLAMA_CPP_SCRIPTS_DIR (…
mmathew23 May 5, 2026
919fd3e
Merge upstream main: add device-type empty_cache/is_bf16 helpers, rou…
danielhanchen May 5, 2026
92290f4
Update __init__.py
danielhanchen May 5, 2026
e9c2d06
Apple Silicon MLX backend correctness fixes
danielhanchen May 5, 2026
04d1a18
Tests
danielhanchen May 5, 2026
79d0469
Trim verbose rationale comments in MLX backend
danielhanchen May 5, 2026
fd58aa1
saving_utils: route LoRA merge through accelerator-family probe
danielhanchen May 5, 2026
b0dc09b
fix(mlx): apply memory caps before compile + linked-disable shortcut
Manan17 May 6, 2026
c242d48
tests: add MLX-on-torch simulation suite for Linux+CUDA review
danielhanchen May 6, 2026
8ec3a39
Add AGPL-3.0 header to MLX modules + bundled test suite
danielhanchen May 6, 2026
077bfc1
Register Gemma-4 MoE LoRA extractor to fix grouped_mm contraction cra…
danielhanchen May 6, 2026
395e680
Merge branch 'main' of origin into MLX work
danielhanchen May 6, 2026
eea9de8
Merge pull request #620 from Manan17/main
danielhanchen May 6, 2026
030e4ba
tests: add accelerator dispatch matrix for _active_merge_device
danielhanchen May 6, 2026
7502595
tests: skip MoE LoRA extractor coverage when discovery finds zero cla…
danielhanchen May 7, 2026
300cfff
tests: pivot MoE-coverage canary to _unsloth_already_patched marker (…
danielhanchen May 7, 2026
f98dbbc
fix(compiler): make higher_precision_softmax idempotent (#631)
danielhanchen May 7, 2026
e9d1be8
fix(mlx): unblock GGUF export and LoRA reload on Apple Silicon (#627)
danielhanchen May 8, 2026
232d950
fix(compiler): unblock all model_types across transformers 4.57.6 and…
danielhanchen May 8, 2026
c28ae17
Mask for gemma3 attn (#635)
Datta0 May 13, 2026
9829ade
Multi Image GRPO (#613)
Datta0 May 13, 2026
466334c
[GRPO] Try returning hidden statex for GRPO (#609)
Datta0 May 13, 2026
b91fbf3
Refactor and consolidate moe lora extractors (#629)
Datta0 May 13, 2026
0e98145
security + CI: mirror unsloth's hardening stack onto zoo (greenfield …
danielhanchen May 14, 2026
f4bb7bc
remove unsloth_zoo/import_fixes.py: redundant with unsloth/import_fix…
danielhanchen May 14, 2026
02875d0
chore: trim verbose comments across PR #637 landing (#640)
danielhanchen May 14, 2026
f37d510
scripts: ship deterministic comment / docstring-only diff verifier (#…
danielhanchen May 14, 2026
e6d8f7f
fix mlx: Adds the MLX training path used by Studio on Apple Silicon (…
mmathew23 May 14, 2026
44cf46c
tests: drift detectors cover transformers 5.x (mirror unsloth PR #542…
danielhanchen May 14, 2026
1c31084
gpt_oss: reorder helpers before patch_gpt_oss_bnb4bit_auto (#643)
danielhanchen May 14, 2026
6650aa6
__init__: lazy-load legacy MLX aliases on every host (#644)
danielhanchen May 14, 2026
9fe4396
tests: contain security-conftest network block; fix stale mlx paths; …
danielhanchen May 15, 2026
2efe4cb
fix CI fallout from MLX subpackage refactor (#634) (#646)
danielhanchen May 15, 2026
afc8502
tests: tolerate transformers 5.x source/signature drift in two zoo dr…
danielhanchen May 15, 2026
8c1dd61
tests: skip _assert_params_superset when upstream forward is (*args, …
danielhanchen May 15, 2026
7997558
mlx: lower max_grad_value default from 5.0 to 1.0 (#652)
danielhanchen May 15, 2026
faee224
saving: layout-aware MoE LoRA merge + loud-fail on fallback (#5410) (…
danielhanchen May 15, 2026
57bbdc0
tests: follow MoE merge wrapper delegation in drift detector (#653)
danielhanchen May 15, 2026
7b90fec
additional import try except handling for mlx (#654)
mmathew23 May 15, 2026
b6d292b
Patch every LOSS_MAPPING key aliased to ForCausalLMLoss (#656)
danielhanchen May 17, 2026
af59335
deps: bump torch upper cap to <2.13.0 (allow xpu 2.11.0 / 2.12.0)
danielhanchen May 17, 2026
8f9d692
Versioning -> 2026.5.2
danielhanchen May 17, 2026
3c80e8b
Auto-install fused lm_head + cross_entropy forward across transformers
danielhanchen May 16, 2026
e88ccdb
Backfill transformers.modeling_outputs into the exec namespace
danielhanchen May 16, 2026
bb3242e
Scrub .github/workflows for staging push (matches staging base)
danielhanchen May 16, 2026
f27f175
Harden fused-forward AST rewriter and adapter
danielhanchen May 16, 2026
ee730ae
Trim verbose fused-forward comments and docstrings
danielhanchen May 16, 2026
4ee2aa2
Sync .github/workflows with upstream author branch
danielhanchen May 16, 2026
5ced088
Pin review-applied behaviour with eight new tests
danielhanchen May 16, 2026
587136a
Default fused-forward installer to on
danielhanchen May 16, 2026
bf5e4c3
Route pre-shifted labels through the fused kernel for PR #657
danielhanchen May 17, 2026
0bcbf69
Fix CI: read modeling source from disk in upstream-pattern probes
danielhanchen May 17, 2026
adc76ae
tests: CPU regression detectors for the MoE merge / save path (#5410)…
danielhanchen May 17, 2026
d50b31a
Fix GGUF converter sibling imports (#661)
alkinun May 17, 2026
fc983dd
fix embedding matrix size mismatch bug (#645)
CodeMan62 May 17, 2026
d50526e
Honor UNSLOTH_RETURN_LOGITS in fused forward (#665)
danielhanchen May 18, 2026
23a50a9
__init__: include HF_DATASETS_OFFLINE in the offline env cross-sync (…
danielhanchen May 18, 2026
14a759e
Fix Studio q2_k_l GGUF export + new llama.cpp converter package layout
May 18, 2026
0461ae1
ci: add tqdm to slim install (imported by llama_cpp.py at module level)
May 18, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 37 additions & 0 deletions .github/CODEOWNERS
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# Inspired from https://github.com/vllm-project/vllm/blob/main/.github/CODEOWNERS
# Mirrors unslothai/unsloth's CODEOWNERS shape, scoped to zoo's layout.

/unsloth_zoo/rl_replacements.py @Datta0 @pluesclues @danielhanchen
/unsloth_zoo/compiler.py @danielhanchen
/unsloth_zoo/compiler_replacements.py @danielhanchen
/unsloth_zoo/device_type.py @danielhanchen
/unsloth_zoo/tokenizer_utils.py @mmathew23 @danielhanchen
/unsloth_zoo/saving_utils.py @rolandtannous @danielhanchen
/unsloth_zoo/peft_utils.py @danielhanchen
/unsloth_zoo/loss_utils.py @danielhanchen

# Temporary model-specific patch subsystem.
/unsloth_zoo/temporary_patches/*.py @danielhanchen
/unsloth_zoo/temporary_patches/gemma*.py @danielhanchen
/unsloth_zoo/temporary_patches/qwen3*.py @danielhanchen
/unsloth_zoo/temporary_patches/gpt_oss.py @danielhanchen
/unsloth_zoo/temporary_patches/moe_*.py @Datta0 @danielhanchen
/unsloth_zoo/temporary_patches/mxfp4.py @Datta0 @danielhanchen
/unsloth_zoo/temporary_patches/bitsandbytes.py @danielhanchen

# MLX subsystem (macOS arm64 only).
/unsloth_zoo/mlx_*.py @danielhanchen
/unsloth_zoo/mlx_cce/*.py @danielhanchen

# MoE / fused / flex attention kernels.
/unsloth_zoo/fused_losses/*.py @danielhanchen
/unsloth_zoo/flex_attention/*.py @danielhanchen

# Security + CI infrastructure ported from unsloth via this PR.
/.github/workflows/security-audit.yml @danielhanchen
/scripts/scan_packages.py @danielhanchen
/scripts/lint_workflow_triggers.py @danielhanchen
/scripts/enforce_kwargs_spacing.py @danielhanchen
/tests/security/ @danielhanchen
/.github/dependabot.yml @danielhanchen
/.github/CODEOWNERS @danielhanchen
13 changes: 13 additions & 0 deletions .github/FUNDING.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# These are supported funding model platforms

github: unslothai
patreon: # Replace with a single Patreon username
open_collective: # Replace with a single Open Collective username
ko_fi: # unsloth
tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel
community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry
liberapay: # Replace with a single Liberapay username
issuehunt: # Replace with a single IssueHunt username
otechie: # Replace with a single Otechie username
lfx_crowdfunding: # Replace with a single LFX Crowdfunding project-name e.g., cloud-foundry
custom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2']
22 changes: 22 additions & 0 deletions .github/ISSUE_TEMPLATE/bug---issue.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
---
name: Bug / Issue
about: Bug / Issue
title: "[Bug] Please fill in your issue title here."
labels: bug
assignees: ''

---
Note: Please do not remove the questions. Answer beside them.
1. Did you update? `pip install --upgrade unsloth unsloth_zoo`
2. `Colab` or `Kaggle` or local / cloud
3. Number GPUs used, use `nvidia-smi`
4. Which notebook? Please link!
5. Which Unsloth version, TRL version, transformers version, PyTorch version?
6. Which trainer? `SFTTrainer`, `GRPOTrainer` etc

```python
Put Minimal code to reproduce error here ###Remove Hugging Face token###
###Please make sure to check formatting properly, edit if needed.###
```

🦥 You can also ask via our Reddit page: https://reddit.com/r/unsloth/
21 changes: 21 additions & 0 deletions .github/ISSUE_TEMPLATE/feature-request.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
---
name: Feature Request
about: New features, model support, ideas
title: "[Feature]"
labels: feature request
assignees: ''

---

For new models, have you tried:
```python
from unsloth import FastModel
model, tokenizer = FastModel.from_pretrained(
"microsoft/Phi-4-multimodal-instruct",
trust_remote_code = True,
)
from transformers import AutoModelForSequenceClassification
model, tokenizer = FastModel.from_pretrained(
auto_model = AutoModelForSequenceClassification,
)
```
51 changes: 51 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
---
# Mirrors the shape of unslothai/unsloth's .github/dependabot.yml,
# scoped to unsloth-zoo's actual surface:
# - github-actions (this very directory once the workflows land)
# - pip (root pyproject.toml -- zoo is published to PyPI as `unsloth_zoo`)
#
# Dropped entries that exist on the unsloth repo but are N/A here:
# - bun / npm (no package-lock.json / bun.lock anywhere in zoo)
# - cargo (no Cargo.toml / Cargo.lock anywhere in zoo)
#
# Add a real entry IF and WHEN one of those manifests lands.

version: 2
updates:
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "weekly"
cooldown:
# github-actions refs are git tags / SHAs, not semver -- the
# `semver-minor-days` / `semver-patch-days` knobs are rejected by
# Dependabot's validator for this ecosystem. Only the
# `default-days` floor applies. (Pinned via PR #5397 on unsloth
# after the validator surfaced the bug on a sibling repo.)
default-days: 7
groups:
actions:
patterns: ["*"]
actions-security:
applies-to: security-updates
patterns: ["*"]

# pip dependencies for the unsloth_zoo wheel. Weekly version-update
# PRs are grouped + cooled-down 7 days; security-advisory PRs flow
# through the *-security group independently. The cooldown is the
# supply-chain gate -- it matches studio/frontend/.npmrc
# min-release-age=7 over on the unsloth repo, so we never auto-ingest
# a freshly-published tarball.
- package-ecosystem: "pip"
directory: "/"
schedule:
interval: "weekly"
open-pull-requests-limit: 5
cooldown:
default-days: 7
groups:
python:
patterns: ["*"]
python-security:
applies-to: security-updates
patterns: ["*"]
Loading
Loading