├── .gitattributes ├── .github ├── FUNDING.yml ├── ISSUE_TEMPLATE │ ├── bug---issue.md │ └── feature-request.md └── workflows │ └── stale.yml ├── .gitignore ├── .pre-commit-ci.yaml ├── .pre-commit-config.yaml ├── CODE_OF_CONDUCT.md ├── CONTRIBUTING.md ├── LICENSE ├── README.md ├── images ├── Assistant.png ├── Colab.png ├── Discord button.png ├── Discord.png ├── Documentation Button.png ├── Free version button.png ├── Kaggle.png ├── Kofi button.png ├── LAION 2GPU.png ├── Merge.png ├── Run.png ├── Slim Orca 2GPUs.png ├── Terminal_Type.png ├── Where_Terminal.png ├── buy me a coffee button.png ├── documentation github button.png ├── documentation green button.png ├── documentation lighter.png ├── documentation white button.png ├── made with unsloth.png ├── ollama.png ├── peft x trl button.png ├── start free finetune button.png ├── unsloth end.png ├── unsloth loading page render.png ├── unsloth logo black text.png ├── unsloth logo only.png ├── unsloth logo white text.png ├── unsloth made with love.png ├── unsloth new logo.png └── unsloth sticker.png ├── pyproject.toml ├── scripts ├── enforce_kwargs_spacing.py └── run_ruff_format.py ├── tests ├── __init__.py ├── qlora │ ├── README.md │ ├── test_hf_qlora_train_and_merge.py │ └── test_unsloth_qlora_train_and_merge.py ├── saving │ ├── gpt-oss-merge │ │ ├── run_test.sh │ │ ├── test_merged_model.py │ │ └── train_and_merge.py │ ├── language_models │ │ ├── test_merge_4bit_validation.py │ │ ├── test_merge_model_perplexity_llama-3.2.py │ │ ├── test_merge_model_perplexity_mistral.py │ │ ├── test_merge_model_perplexity_phi_4.py │ │ ├── test_merged_model_perplexity_llama-3.1-8b.py │ │ ├── test_merged_model_perplexity_qwen_2.5.py │ │ ├── test_push_to_hub_merged.py │ │ ├── test_push_to_hub_merged_sharded_index_file.py │ │ └── test_save_merged_grpo_model.py │ ├── non_peft │ │ ├── test_mistral_non_peft.py │ │ └── test_whisper_non_peft.py │ ├── test_unsloth_save.py │ ├── text_to_speech_models │ │ ├── test_csm.py │ │ ├── test_lasa.py │ │ ├── test_orpheus.py │ │ └── test_whisper.py │ └── vision_models │ │ ├── test_index_file_sharded_model.py │ │ ├── test_push_to_hub_merged.py │ │ ├── test_save_merge_qwen2.5vl32B_model_ocr_benchmark.py │ │ └── test_save_merge_vision_model_ocr_benchmark.py ├── test_model_registry.py └── utils │ ├── __init__.py │ ├── aime_eval.md │ ├── aime_eval.py │ ├── cleanup_utils.py │ ├── data_utils.py │ ├── hf_utils.py │ ├── ocr_eval.md │ ├── ocr_eval.py │ ├── os_utils.py │ ├── perplexity_eval.md │ ├── perplexity_eval.py │ └── test_qat.py ├── unsloth-cli.py └── unsloth ├── __init__.py ├── _auto_install.py ├── chat_templates.py ├── dataprep ├── __init__.py ├── synthetic.py └── synthetic_configs.py ├── device_type.py ├── import_fixes.py ├── kernels ├── __init__.py ├── cross_entropy_loss.py ├── fast_lora.py ├── flex_attention.py ├── fp8.py ├── geglu.py ├── layernorm.py ├── moe │ ├── LICENSE │ ├── README.md │ ├── __init__.py │ ├── benchmark │ │ ├── benchmark_fused_moe.py │ │ └── utils.py │ ├── grouped_gemm │ │ ├── LICENSE │ │ ├── __init__.py │ │ ├── interface.py │ │ ├── kernels │ │ │ ├── __init__.py │ │ │ ├── autotuning.py │ │ │ ├── backward.py │ │ │ ├── forward.py │ │ │ └── tuning.py │ │ └── reference │ │ │ ├── __init__.py │ │ │ ├── layers │ │ │ ├── llama4_moe.py │ │ │ └── qwen3_moe.py │ │ │ ├── moe_block.py │ │ │ └── moe_ops.py │ ├── requirements.txt │ └── tests │ │ ├── __init__.py │ │ ├── common.py │ │ ├── moe_utils.py │ │ ├── run_qwen3_moe_tests.sh │ │ ├── test_grouped_gemm.py │ │ ├── test_llama4_moe.py │ │ └── test_qwen3_moe.py ├── rms_layernorm.py ├── rope_embedding.py ├── swiglu.py └── utils.py ├── models ├── __init__.py ├── _utils.py ├── cohere.py ├── dpo.py ├── falcon_h1.py ├── gemma.py ├── gemma2.py ├── granite.py ├── llama.py ├── llama4.py ├── loader.py ├── loader_utils.py ├── mapper.py ├── mistral.py ├── qwen2.py ├── qwen3.py ├── qwen3_moe.py ├── rl.py ├── rl_replacements.py └── vision.py ├── ollama_template_mappers.py ├── registry ├── REGISTRY.md ├── __init__.py ├── _deepseek.py ├── _gemma.py ├── _llama.py ├── _mistral.py ├── _phi.py ├── _qwen.py └── registry.py ├── save.py ├── tokenizer_utils.py ├── trainer.py └── utils ├── __init__.py └── hf_hub.py /.gitattributes: -------------------------------------------------------------------------------- 1 | # Normalize Python files to LF line endings 2 | *.py text eol=lf 3 | -------------------------------------------------------------------------------- /.github/FUNDING.yml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unslothai/unsloth/HEAD/.github/FUNDING.yml -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/bug---issue.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unslothai/unsloth/HEAD/.github/ISSUE_TEMPLATE/bug---issue.md -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/feature-request.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unslothai/unsloth/HEAD/.github/ISSUE_TEMPLATE/feature-request.md -------------------------------------------------------------------------------- /.github/workflows/stale.yml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unslothai/unsloth/HEAD/.github/workflows/stale.yml -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unslothai/unsloth/HEAD/.gitignore -------------------------------------------------------------------------------- /.pre-commit-ci.yaml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unslothai/unsloth/HEAD/.pre-commit-ci.yaml -------------------------------------------------------------------------------- /.pre-commit-config.yaml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unslothai/unsloth/HEAD/.pre-commit-config.yaml -------------------------------------------------------------------------------- /CODE_OF_CONDUCT.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unslothai/unsloth/HEAD/CODE_OF_CONDUCT.md -------------------------------------------------------------------------------- /CONTRIBUTING.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unslothai/unsloth/HEAD/CONTRIBUTING.md -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unslothai/unsloth/HEAD/LICENSE -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unslothai/unsloth/HEAD/README.md -------------------------------------------------------------------------------- /images/Assistant.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unslothai/unsloth/HEAD/images/Assistant.png -------------------------------------------------------------------------------- /images/Colab.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unslothai/unsloth/HEAD/images/Colab.png -------------------------------------------------------------------------------- /images/Discord button.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unslothai/unsloth/HEAD/images/Discord button.png -------------------------------------------------------------------------------- /images/Discord.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unslothai/unsloth/HEAD/images/Discord.png -------------------------------------------------------------------------------- /images/Documentation Button.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unslothai/unsloth/HEAD/images/Documentation Button.png -------------------------------------------------------------------------------- /images/Free version button.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unslothai/unsloth/HEAD/images/Free version button.png -------------------------------------------------------------------------------- /images/Kaggle.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unslothai/unsloth/HEAD/images/Kaggle.png -------------------------------------------------------------------------------- /images/Kofi button.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unslothai/unsloth/HEAD/images/Kofi button.png -------------------------------------------------------------------------------- /images/LAION 2GPU.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unslothai/unsloth/HEAD/images/LAION 2GPU.png -------------------------------------------------------------------------------- /images/Merge.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unslothai/unsloth/HEAD/images/Merge.png -------------------------------------------------------------------------------- /images/Run.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unslothai/unsloth/HEAD/images/Run.png -------------------------------------------------------------------------------- /images/Slim Orca 2GPUs.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unslothai/unsloth/HEAD/images/Slim Orca 2GPUs.png -------------------------------------------------------------------------------- /images/Terminal_Type.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unslothai/unsloth/HEAD/images/Terminal_Type.png -------------------------------------------------------------------------------- /images/Where_Terminal.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unslothai/unsloth/HEAD/images/Where_Terminal.png -------------------------------------------------------------------------------- /images/buy me a coffee button.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unslothai/unsloth/HEAD/images/buy me a coffee button.png -------------------------------------------------------------------------------- /images/documentation github button.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unslothai/unsloth/HEAD/images/documentation github button.png -------------------------------------------------------------------------------- /images/documentation green button.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unslothai/unsloth/HEAD/images/documentation green button.png -------------------------------------------------------------------------------- /images/documentation lighter.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unslothai/unsloth/HEAD/images/documentation lighter.png -------------------------------------------------------------------------------- /images/documentation white button.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unslothai/unsloth/HEAD/images/documentation white button.png -------------------------------------------------------------------------------- /images/made with unsloth.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unslothai/unsloth/HEAD/images/made with unsloth.png -------------------------------------------------------------------------------- /images/ollama.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unslothai/unsloth/HEAD/images/ollama.png -------------------------------------------------------------------------------- /images/peft x trl button.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unslothai/unsloth/HEAD/images/peft x trl button.png -------------------------------------------------------------------------------- /images/start free finetune button.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unslothai/unsloth/HEAD/images/start free finetune button.png -------------------------------------------------------------------------------- /images/unsloth end.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unslothai/unsloth/HEAD/images/unsloth end.png -------------------------------------------------------------------------------- /images/unsloth loading page render.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unslothai/unsloth/HEAD/images/unsloth loading page render.png -------------------------------------------------------------------------------- /images/unsloth logo black text.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unslothai/unsloth/HEAD/images/unsloth logo black text.png -------------------------------------------------------------------------------- /images/unsloth logo only.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unslothai/unsloth/HEAD/images/unsloth logo only.png -------------------------------------------------------------------------------- /images/unsloth logo white text.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unslothai/unsloth/HEAD/images/unsloth logo white text.png -------------------------------------------------------------------------------- /images/unsloth made with love.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unslothai/unsloth/HEAD/images/unsloth made with love.png -------------------------------------------------------------------------------- /images/unsloth new logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unslothai/unsloth/HEAD/images/unsloth new logo.png -------------------------------------------------------------------------------- /images/unsloth sticker.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unslothai/unsloth/HEAD/images/unsloth sticker.png -------------------------------------------------------------------------------- /pyproject.toml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unslothai/unsloth/HEAD/pyproject.toml -------------------------------------------------------------------------------- /scripts/enforce_kwargs_spacing.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unslothai/unsloth/HEAD/scripts/enforce_kwargs_spacing.py -------------------------------------------------------------------------------- /scripts/run_ruff_format.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unslothai/unsloth/HEAD/scripts/run_ruff_format.py -------------------------------------------------------------------------------- /tests/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/qlora/README.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unslothai/unsloth/HEAD/tests/qlora/README.md -------------------------------------------------------------------------------- /tests/qlora/test_hf_qlora_train_and_merge.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unslothai/unsloth/HEAD/tests/qlora/test_hf_qlora_train_and_merge.py -------------------------------------------------------------------------------- /tests/qlora/test_unsloth_qlora_train_and_merge.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unslothai/unsloth/HEAD/tests/qlora/test_unsloth_qlora_train_and_merge.py -------------------------------------------------------------------------------- /tests/saving/gpt-oss-merge/run_test.sh: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unslothai/unsloth/HEAD/tests/saving/gpt-oss-merge/run_test.sh -------------------------------------------------------------------------------- /tests/saving/gpt-oss-merge/test_merged_model.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unslothai/unsloth/HEAD/tests/saving/gpt-oss-merge/test_merged_model.py -------------------------------------------------------------------------------- /tests/saving/gpt-oss-merge/train_and_merge.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unslothai/unsloth/HEAD/tests/saving/gpt-oss-merge/train_and_merge.py -------------------------------------------------------------------------------- /tests/saving/language_models/test_merge_4bit_validation.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unslothai/unsloth/HEAD/tests/saving/language_models/test_merge_4bit_validation.py -------------------------------------------------------------------------------- /tests/saving/language_models/test_merge_model_perplexity_llama-3.2.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unslothai/unsloth/HEAD/tests/saving/language_models/test_merge_model_perplexity_llama-3.2.py -------------------------------------------------------------------------------- /tests/saving/language_models/test_merge_model_perplexity_mistral.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unslothai/unsloth/HEAD/tests/saving/language_models/test_merge_model_perplexity_mistral.py -------------------------------------------------------------------------------- /tests/saving/language_models/test_merge_model_perplexity_phi_4.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unslothai/unsloth/HEAD/tests/saving/language_models/test_merge_model_perplexity_phi_4.py -------------------------------------------------------------------------------- /tests/saving/language_models/test_merged_model_perplexity_llama-3.1-8b.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unslothai/unsloth/HEAD/tests/saving/language_models/test_merged_model_perplexity_llama-3.1-8b.py -------------------------------------------------------------------------------- /tests/saving/language_models/test_merged_model_perplexity_qwen_2.5.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unslothai/unsloth/HEAD/tests/saving/language_models/test_merged_model_perplexity_qwen_2.5.py -------------------------------------------------------------------------------- /tests/saving/language_models/test_push_to_hub_merged.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unslothai/unsloth/HEAD/tests/saving/language_models/test_push_to_hub_merged.py -------------------------------------------------------------------------------- /tests/saving/language_models/test_push_to_hub_merged_sharded_index_file.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unslothai/unsloth/HEAD/tests/saving/language_models/test_push_to_hub_merged_sharded_index_file.py -------------------------------------------------------------------------------- /tests/saving/language_models/test_save_merged_grpo_model.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unslothai/unsloth/HEAD/tests/saving/language_models/test_save_merged_grpo_model.py -------------------------------------------------------------------------------- /tests/saving/non_peft/test_mistral_non_peft.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unslothai/unsloth/HEAD/tests/saving/non_peft/test_mistral_non_peft.py -------------------------------------------------------------------------------- /tests/saving/non_peft/test_whisper_non_peft.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unslothai/unsloth/HEAD/tests/saving/non_peft/test_whisper_non_peft.py -------------------------------------------------------------------------------- /tests/saving/test_unsloth_save.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unslothai/unsloth/HEAD/tests/saving/test_unsloth_save.py -------------------------------------------------------------------------------- /tests/saving/text_to_speech_models/test_csm.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unslothai/unsloth/HEAD/tests/saving/text_to_speech_models/test_csm.py -------------------------------------------------------------------------------- /tests/saving/text_to_speech_models/test_lasa.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unslothai/unsloth/HEAD/tests/saving/text_to_speech_models/test_lasa.py -------------------------------------------------------------------------------- /tests/saving/text_to_speech_models/test_orpheus.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unslothai/unsloth/HEAD/tests/saving/text_to_speech_models/test_orpheus.py -------------------------------------------------------------------------------- /tests/saving/text_to_speech_models/test_whisper.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unslothai/unsloth/HEAD/tests/saving/text_to_speech_models/test_whisper.py -------------------------------------------------------------------------------- /tests/saving/vision_models/test_index_file_sharded_model.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unslothai/unsloth/HEAD/tests/saving/vision_models/test_index_file_sharded_model.py -------------------------------------------------------------------------------- /tests/saving/vision_models/test_push_to_hub_merged.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unslothai/unsloth/HEAD/tests/saving/vision_models/test_push_to_hub_merged.py -------------------------------------------------------------------------------- /tests/saving/vision_models/test_save_merge_qwen2.5vl32B_model_ocr_benchmark.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unslothai/unsloth/HEAD/tests/saving/vision_models/test_save_merge_qwen2.5vl32B_model_ocr_benchmark.py -------------------------------------------------------------------------------- /tests/saving/vision_models/test_save_merge_vision_model_ocr_benchmark.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unslothai/unsloth/HEAD/tests/saving/vision_models/test_save_merge_vision_model_ocr_benchmark.py -------------------------------------------------------------------------------- /tests/test_model_registry.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unslothai/unsloth/HEAD/tests/test_model_registry.py -------------------------------------------------------------------------------- /tests/utils/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unslothai/unsloth/HEAD/tests/utils/__init__.py -------------------------------------------------------------------------------- /tests/utils/aime_eval.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unslothai/unsloth/HEAD/tests/utils/aime_eval.md -------------------------------------------------------------------------------- /tests/utils/aime_eval.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unslothai/unsloth/HEAD/tests/utils/aime_eval.py -------------------------------------------------------------------------------- /tests/utils/cleanup_utils.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unslothai/unsloth/HEAD/tests/utils/cleanup_utils.py -------------------------------------------------------------------------------- /tests/utils/data_utils.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unslothai/unsloth/HEAD/tests/utils/data_utils.py -------------------------------------------------------------------------------- /tests/utils/hf_utils.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unslothai/unsloth/HEAD/tests/utils/hf_utils.py -------------------------------------------------------------------------------- /tests/utils/ocr_eval.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unslothai/unsloth/HEAD/tests/utils/ocr_eval.md -------------------------------------------------------------------------------- /tests/utils/ocr_eval.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unslothai/unsloth/HEAD/tests/utils/ocr_eval.py -------------------------------------------------------------------------------- /tests/utils/os_utils.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unslothai/unsloth/HEAD/tests/utils/os_utils.py -------------------------------------------------------------------------------- /tests/utils/perplexity_eval.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unslothai/unsloth/HEAD/tests/utils/perplexity_eval.md -------------------------------------------------------------------------------- /tests/utils/perplexity_eval.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unslothai/unsloth/HEAD/tests/utils/perplexity_eval.py -------------------------------------------------------------------------------- /tests/utils/test_qat.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unslothai/unsloth/HEAD/tests/utils/test_qat.py -------------------------------------------------------------------------------- /unsloth-cli.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unslothai/unsloth/HEAD/unsloth-cli.py -------------------------------------------------------------------------------- /unsloth/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unslothai/unsloth/HEAD/unsloth/__init__.py -------------------------------------------------------------------------------- /unsloth/_auto_install.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unslothai/unsloth/HEAD/unsloth/_auto_install.py -------------------------------------------------------------------------------- /unsloth/chat_templates.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unslothai/unsloth/HEAD/unsloth/chat_templates.py -------------------------------------------------------------------------------- /unsloth/dataprep/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unslothai/unsloth/HEAD/unsloth/dataprep/__init__.py -------------------------------------------------------------------------------- /unsloth/dataprep/synthetic.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unslothai/unsloth/HEAD/unsloth/dataprep/synthetic.py -------------------------------------------------------------------------------- /unsloth/dataprep/synthetic_configs.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unslothai/unsloth/HEAD/unsloth/dataprep/synthetic_configs.py -------------------------------------------------------------------------------- /unsloth/device_type.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unslothai/unsloth/HEAD/unsloth/device_type.py -------------------------------------------------------------------------------- /unsloth/import_fixes.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unslothai/unsloth/HEAD/unsloth/import_fixes.py -------------------------------------------------------------------------------- /unsloth/kernels/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unslothai/unsloth/HEAD/unsloth/kernels/__init__.py -------------------------------------------------------------------------------- /unsloth/kernels/cross_entropy_loss.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unslothai/unsloth/HEAD/unsloth/kernels/cross_entropy_loss.py -------------------------------------------------------------------------------- /unsloth/kernels/fast_lora.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unslothai/unsloth/HEAD/unsloth/kernels/fast_lora.py -------------------------------------------------------------------------------- /unsloth/kernels/flex_attention.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unslothai/unsloth/HEAD/unsloth/kernels/flex_attention.py -------------------------------------------------------------------------------- /unsloth/kernels/fp8.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unslothai/unsloth/HEAD/unsloth/kernels/fp8.py -------------------------------------------------------------------------------- /unsloth/kernels/geglu.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unslothai/unsloth/HEAD/unsloth/kernels/geglu.py -------------------------------------------------------------------------------- /unsloth/kernels/layernorm.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unslothai/unsloth/HEAD/unsloth/kernels/layernorm.py -------------------------------------------------------------------------------- /unsloth/kernels/moe/LICENSE: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unslothai/unsloth/HEAD/unsloth/kernels/moe/LICENSE -------------------------------------------------------------------------------- /unsloth/kernels/moe/README.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unslothai/unsloth/HEAD/unsloth/kernels/moe/README.md -------------------------------------------------------------------------------- /unsloth/kernels/moe/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /unsloth/kernels/moe/benchmark/benchmark_fused_moe.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unslothai/unsloth/HEAD/unsloth/kernels/moe/benchmark/benchmark_fused_moe.py -------------------------------------------------------------------------------- /unsloth/kernels/moe/benchmark/utils.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unslothai/unsloth/HEAD/unsloth/kernels/moe/benchmark/utils.py -------------------------------------------------------------------------------- /unsloth/kernels/moe/grouped_gemm/LICENSE: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unslothai/unsloth/HEAD/unsloth/kernels/moe/grouped_gemm/LICENSE -------------------------------------------------------------------------------- /unsloth/kernels/moe/grouped_gemm/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /unsloth/kernels/moe/grouped_gemm/interface.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unslothai/unsloth/HEAD/unsloth/kernels/moe/grouped_gemm/interface.py -------------------------------------------------------------------------------- /unsloth/kernels/moe/grouped_gemm/kernels/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /unsloth/kernels/moe/grouped_gemm/kernels/autotuning.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unslothai/unsloth/HEAD/unsloth/kernels/moe/grouped_gemm/kernels/autotuning.py -------------------------------------------------------------------------------- /unsloth/kernels/moe/grouped_gemm/kernels/backward.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unslothai/unsloth/HEAD/unsloth/kernels/moe/grouped_gemm/kernels/backward.py -------------------------------------------------------------------------------- /unsloth/kernels/moe/grouped_gemm/kernels/forward.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unslothai/unsloth/HEAD/unsloth/kernels/moe/grouped_gemm/kernels/forward.py -------------------------------------------------------------------------------- /unsloth/kernels/moe/grouped_gemm/kernels/tuning.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unslothai/unsloth/HEAD/unsloth/kernels/moe/grouped_gemm/kernels/tuning.py -------------------------------------------------------------------------------- /unsloth/kernels/moe/grouped_gemm/reference/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /unsloth/kernels/moe/grouped_gemm/reference/layers/llama4_moe.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unslothai/unsloth/HEAD/unsloth/kernels/moe/grouped_gemm/reference/layers/llama4_moe.py -------------------------------------------------------------------------------- /unsloth/kernels/moe/grouped_gemm/reference/layers/qwen3_moe.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unslothai/unsloth/HEAD/unsloth/kernels/moe/grouped_gemm/reference/layers/qwen3_moe.py -------------------------------------------------------------------------------- /unsloth/kernels/moe/grouped_gemm/reference/moe_block.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unslothai/unsloth/HEAD/unsloth/kernels/moe/grouped_gemm/reference/moe_block.py -------------------------------------------------------------------------------- /unsloth/kernels/moe/grouped_gemm/reference/moe_ops.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unslothai/unsloth/HEAD/unsloth/kernels/moe/grouped_gemm/reference/moe_ops.py -------------------------------------------------------------------------------- /unsloth/kernels/moe/requirements.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unslothai/unsloth/HEAD/unsloth/kernels/moe/requirements.txt -------------------------------------------------------------------------------- /unsloth/kernels/moe/tests/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /unsloth/kernels/moe/tests/common.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unslothai/unsloth/HEAD/unsloth/kernels/moe/tests/common.py -------------------------------------------------------------------------------- /unsloth/kernels/moe/tests/moe_utils.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unslothai/unsloth/HEAD/unsloth/kernels/moe/tests/moe_utils.py -------------------------------------------------------------------------------- /unsloth/kernels/moe/tests/run_qwen3_moe_tests.sh: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unslothai/unsloth/HEAD/unsloth/kernels/moe/tests/run_qwen3_moe_tests.sh -------------------------------------------------------------------------------- /unsloth/kernels/moe/tests/test_grouped_gemm.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unslothai/unsloth/HEAD/unsloth/kernels/moe/tests/test_grouped_gemm.py -------------------------------------------------------------------------------- /unsloth/kernels/moe/tests/test_llama4_moe.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unslothai/unsloth/HEAD/unsloth/kernels/moe/tests/test_llama4_moe.py -------------------------------------------------------------------------------- /unsloth/kernels/moe/tests/test_qwen3_moe.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unslothai/unsloth/HEAD/unsloth/kernels/moe/tests/test_qwen3_moe.py -------------------------------------------------------------------------------- /unsloth/kernels/rms_layernorm.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unslothai/unsloth/HEAD/unsloth/kernels/rms_layernorm.py -------------------------------------------------------------------------------- /unsloth/kernels/rope_embedding.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unslothai/unsloth/HEAD/unsloth/kernels/rope_embedding.py -------------------------------------------------------------------------------- /unsloth/kernels/swiglu.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unslothai/unsloth/HEAD/unsloth/kernels/swiglu.py -------------------------------------------------------------------------------- /unsloth/kernels/utils.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unslothai/unsloth/HEAD/unsloth/kernels/utils.py -------------------------------------------------------------------------------- /unsloth/models/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unslothai/unsloth/HEAD/unsloth/models/__init__.py -------------------------------------------------------------------------------- /unsloth/models/_utils.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unslothai/unsloth/HEAD/unsloth/models/_utils.py -------------------------------------------------------------------------------- /unsloth/models/cohere.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unslothai/unsloth/HEAD/unsloth/models/cohere.py -------------------------------------------------------------------------------- /unsloth/models/dpo.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unslothai/unsloth/HEAD/unsloth/models/dpo.py -------------------------------------------------------------------------------- /unsloth/models/falcon_h1.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unslothai/unsloth/HEAD/unsloth/models/falcon_h1.py -------------------------------------------------------------------------------- /unsloth/models/gemma.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unslothai/unsloth/HEAD/unsloth/models/gemma.py -------------------------------------------------------------------------------- /unsloth/models/gemma2.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unslothai/unsloth/HEAD/unsloth/models/gemma2.py -------------------------------------------------------------------------------- /unsloth/models/granite.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unslothai/unsloth/HEAD/unsloth/models/granite.py -------------------------------------------------------------------------------- /unsloth/models/llama.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unslothai/unsloth/HEAD/unsloth/models/llama.py -------------------------------------------------------------------------------- /unsloth/models/llama4.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unslothai/unsloth/HEAD/unsloth/models/llama4.py -------------------------------------------------------------------------------- /unsloth/models/loader.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unslothai/unsloth/HEAD/unsloth/models/loader.py -------------------------------------------------------------------------------- /unsloth/models/loader_utils.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unslothai/unsloth/HEAD/unsloth/models/loader_utils.py -------------------------------------------------------------------------------- /unsloth/models/mapper.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unslothai/unsloth/HEAD/unsloth/models/mapper.py -------------------------------------------------------------------------------- /unsloth/models/mistral.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unslothai/unsloth/HEAD/unsloth/models/mistral.py -------------------------------------------------------------------------------- /unsloth/models/qwen2.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unslothai/unsloth/HEAD/unsloth/models/qwen2.py -------------------------------------------------------------------------------- /unsloth/models/qwen3.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unslothai/unsloth/HEAD/unsloth/models/qwen3.py -------------------------------------------------------------------------------- /unsloth/models/qwen3_moe.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unslothai/unsloth/HEAD/unsloth/models/qwen3_moe.py -------------------------------------------------------------------------------- /unsloth/models/rl.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unslothai/unsloth/HEAD/unsloth/models/rl.py -------------------------------------------------------------------------------- /unsloth/models/rl_replacements.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unslothai/unsloth/HEAD/unsloth/models/rl_replacements.py -------------------------------------------------------------------------------- /unsloth/models/vision.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unslothai/unsloth/HEAD/unsloth/models/vision.py -------------------------------------------------------------------------------- /unsloth/ollama_template_mappers.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unslothai/unsloth/HEAD/unsloth/ollama_template_mappers.py -------------------------------------------------------------------------------- /unsloth/registry/REGISTRY.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unslothai/unsloth/HEAD/unsloth/registry/REGISTRY.md -------------------------------------------------------------------------------- /unsloth/registry/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unslothai/unsloth/HEAD/unsloth/registry/__init__.py -------------------------------------------------------------------------------- /unsloth/registry/_deepseek.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unslothai/unsloth/HEAD/unsloth/registry/_deepseek.py -------------------------------------------------------------------------------- /unsloth/registry/_gemma.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unslothai/unsloth/HEAD/unsloth/registry/_gemma.py -------------------------------------------------------------------------------- /unsloth/registry/_llama.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unslothai/unsloth/HEAD/unsloth/registry/_llama.py -------------------------------------------------------------------------------- /unsloth/registry/_mistral.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unslothai/unsloth/HEAD/unsloth/registry/_mistral.py -------------------------------------------------------------------------------- /unsloth/registry/_phi.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unslothai/unsloth/HEAD/unsloth/registry/_phi.py -------------------------------------------------------------------------------- /unsloth/registry/_qwen.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unslothai/unsloth/HEAD/unsloth/registry/_qwen.py -------------------------------------------------------------------------------- /unsloth/registry/registry.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unslothai/unsloth/HEAD/unsloth/registry/registry.py -------------------------------------------------------------------------------- /unsloth/save.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unslothai/unsloth/HEAD/unsloth/save.py -------------------------------------------------------------------------------- /unsloth/tokenizer_utils.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unslothai/unsloth/HEAD/unsloth/tokenizer_utils.py -------------------------------------------------------------------------------- /unsloth/trainer.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unslothai/unsloth/HEAD/unsloth/trainer.py -------------------------------------------------------------------------------- /unsloth/utils/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /unsloth/utils/hf_hub.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/unslothai/unsloth/HEAD/unsloth/utils/hf_hub.py --------------------------------------------------------------------------------