@synsci/cli-darwin-x64 1.1.70 → 1.1.72
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bin/skills/citation-management/SKILL.md +1109 -0
- package/bin/skills/citation-management/assets/bibtex_template.bib +264 -0
- package/bin/skills/citation-management/assets/citation_checklist.md +386 -0
- package/bin/skills/citation-management/references/bibtex_formatting.md +908 -0
- package/bin/skills/citation-management/references/citation_validation.md +794 -0
- package/bin/skills/citation-management/references/google_scholar_search.md +725 -0
- package/bin/skills/citation-management/references/metadata_extraction.md +870 -0
- package/bin/skills/citation-management/references/pubmed_search.md +839 -0
- package/bin/skills/citation-management/scripts/doi_to_bibtex.py +182 -0
- package/bin/skills/citation-management/scripts/extract_metadata.py +570 -0
- package/bin/skills/citation-management/scripts/format_bibtex.py +349 -0
- package/bin/skills/citation-management/scripts/search_google_scholar.py +251 -0
- package/bin/skills/citation-management/scripts/search_pubmed.py +348 -0
- package/bin/skills/citation-management/scripts/validate_citations.py +494 -0
- package/bin/skills/clinical-decision-support/README.md +129 -0
- package/bin/skills/clinical-decision-support/SKILL.md +506 -0
- package/bin/skills/clinical-decision-support/assets/biomarker_report_template.tex +380 -0
- package/bin/skills/clinical-decision-support/assets/clinical_pathway_template.tex +222 -0
- package/bin/skills/clinical-decision-support/assets/cohort_analysis_template.tex +359 -0
- package/bin/skills/clinical-decision-support/assets/color_schemes.tex +149 -0
- package/bin/skills/clinical-decision-support/assets/example_gbm_cohort.md +208 -0
- package/bin/skills/clinical-decision-support/assets/recommendation_strength_guide.md +328 -0
- package/bin/skills/clinical-decision-support/assets/treatment_recommendation_template.tex +529 -0
- package/bin/skills/clinical-decision-support/references/biomarker_classification.md +719 -0
- package/bin/skills/clinical-decision-support/references/clinical_decision_algorithms.md +604 -0
- package/bin/skills/clinical-decision-support/references/evidence_synthesis.md +840 -0
- package/bin/skills/clinical-decision-support/references/outcome_analysis.md +640 -0
- package/bin/skills/clinical-decision-support/references/patient_cohort_analysis.md +427 -0
- package/bin/skills/clinical-decision-support/references/treatment_recommendations.md +521 -0
- package/bin/skills/clinical-decision-support/scripts/biomarker_classifier.py +383 -0
- package/bin/skills/clinical-decision-support/scripts/build_decision_tree.py +417 -0
- package/bin/skills/clinical-decision-support/scripts/create_cohort_tables.py +509 -0
- package/bin/skills/clinical-decision-support/scripts/generate_survival_analysis.py +441 -0
- package/bin/skills/clinical-decision-support/scripts/validate_cds_document.py +326 -0
- package/bin/skills/clinical-reports/IMPLEMENTATION_SUMMARY.md +641 -0
- package/bin/skills/clinical-reports/README.md +236 -0
- package/bin/skills/clinical-reports/SKILL.md +1127 -0
- package/bin/skills/clinical-reports/assets/case_report_template.md +352 -0
- package/bin/skills/clinical-reports/assets/clinical_trial_csr_template.md +353 -0
- package/bin/skills/clinical-reports/assets/clinical_trial_sae_template.md +359 -0
- package/bin/skills/clinical-reports/assets/consult_note_template.md +305 -0
- package/bin/skills/clinical-reports/assets/discharge_summary_template.md +453 -0
- package/bin/skills/clinical-reports/assets/hipaa_compliance_checklist.md +395 -0
- package/bin/skills/clinical-reports/assets/history_physical_template.md +305 -0
- package/bin/skills/clinical-reports/assets/lab_report_template.md +309 -0
- package/bin/skills/clinical-reports/assets/pathology_report_template.md +249 -0
- package/bin/skills/clinical-reports/assets/quality_checklist.md +338 -0
- package/bin/skills/clinical-reports/assets/radiology_report_template.md +318 -0
- package/bin/skills/clinical-reports/assets/soap_note_template.md +253 -0
- package/bin/skills/clinical-reports/references/case_report_guidelines.md +570 -0
- package/bin/skills/clinical-reports/references/clinical_trial_reporting.md +693 -0
- package/bin/skills/clinical-reports/references/data_presentation.md +530 -0
- package/bin/skills/clinical-reports/references/diagnostic_reports_standards.md +629 -0
- package/bin/skills/clinical-reports/references/medical_terminology.md +588 -0
- package/bin/skills/clinical-reports/references/patient_documentation.md +744 -0
- package/bin/skills/clinical-reports/references/peer_review_standards.md +585 -0
- package/bin/skills/clinical-reports/references/regulatory_compliance.md +577 -0
- package/bin/skills/clinical-reports/scripts/check_deidentification.py +332 -0
- package/bin/skills/clinical-reports/scripts/compliance_checker.py +78 -0
- package/bin/skills/clinical-reports/scripts/extract_clinical_data.py +97 -0
- package/bin/skills/clinical-reports/scripts/format_adverse_events.py +97 -0
- package/bin/skills/clinical-reports/scripts/generate_report_template.py +149 -0
- package/bin/skills/clinical-reports/scripts/terminology_validator.py +126 -0
- package/bin/skills/clinical-reports/scripts/validate_case_report.py +323 -0
- package/bin/skills/clinical-reports/scripts/validate_trial_report.py +88 -0
- package/bin/skills/fireworks-ai/SKILL.md +665 -0
- package/bin/skills/generate-image/SKILL.md +178 -0
- package/bin/skills/generate-image/scripts/generate_image.py +254 -0
- package/bin/skills/groq/SKILL.md +347 -0
- package/bin/skills/hypothesis-generation/SKILL.md +293 -0
- package/bin/skills/hypothesis-generation/assets/FORMATTING_GUIDE.md +672 -0
- package/bin/skills/hypothesis-generation/assets/hypothesis_generation.sty +307 -0
- package/bin/skills/hypothesis-generation/assets/hypothesis_report_template.tex +572 -0
- package/bin/skills/hypothesis-generation/references/experimental_design_patterns.md +329 -0
- package/bin/skills/hypothesis-generation/references/hypothesis_quality_criteria.md +198 -0
- package/bin/skills/hypothesis-generation/references/literature_search_strategies.md +622 -0
- package/bin/skills/latex-posters/README.md +417 -0
- package/bin/skills/latex-posters/SKILL.md +1602 -0
- package/bin/skills/latex-posters/assets/baposter_template.tex +257 -0
- package/bin/skills/latex-posters/assets/beamerposter_template.tex +244 -0
- package/bin/skills/latex-posters/assets/poster_quality_checklist.md +358 -0
- package/bin/skills/latex-posters/assets/tikzposter_template.tex +251 -0
- package/bin/skills/latex-posters/references/latex_poster_packages.md +745 -0
- package/bin/skills/latex-posters/references/poster_content_guide.md +748 -0
- package/bin/skills/latex-posters/references/poster_design_principles.md +806 -0
- package/bin/skills/latex-posters/references/poster_layout_design.md +900 -0
- package/bin/skills/latex-posters/scripts/review_poster.sh +214 -0
- package/bin/skills/literature-review/SKILL.md +641 -0
- package/bin/skills/literature-review/assets/review_template.md +412 -0
- package/bin/skills/literature-review/references/citation_styles.md +166 -0
- package/bin/skills/literature-review/references/database_strategies.md +455 -0
- package/bin/skills/literature-review/scripts/generate_pdf.py +184 -0
- package/bin/skills/literature-review/scripts/search_databases.py +310 -0
- package/bin/skills/literature-review/scripts/verify_citations.py +218 -0
- package/bin/skills/market-research-reports/SKILL.md +904 -0
- package/bin/skills/market-research-reports/assets/FORMATTING_GUIDE.md +428 -0
- package/bin/skills/market-research-reports/assets/market_report_template.tex +1380 -0
- package/bin/skills/market-research-reports/assets/market_research.sty +564 -0
- package/bin/skills/market-research-reports/references/data_analysis_patterns.md +548 -0
- package/bin/skills/market-research-reports/references/report_structure_guide.md +999 -0
- package/bin/skills/market-research-reports/references/visual_generation_guide.md +1077 -0
- package/bin/skills/market-research-reports/scripts/generate_market_visuals.py +472 -0
- package/bin/skills/markitdown/INSTALLATION_GUIDE.md +318 -0
- package/bin/skills/markitdown/LICENSE.txt +22 -0
- package/bin/skills/markitdown/OPENROUTER_INTEGRATION.md +359 -0
- package/bin/skills/markitdown/QUICK_REFERENCE.md +309 -0
- package/bin/skills/markitdown/README.md +184 -0
- package/bin/skills/markitdown/SKILL.md +486 -0
- package/bin/skills/markitdown/SKILL_SUMMARY.md +307 -0
- package/bin/skills/markitdown/assets/example_usage.md +463 -0
- package/bin/skills/markitdown/references/api_reference.md +399 -0
- package/bin/skills/markitdown/references/file_formats.md +542 -0
- package/bin/skills/markitdown/scripts/batch_convert.py +195 -0
- package/bin/skills/markitdown/scripts/convert_literature.py +262 -0
- package/bin/skills/markitdown/scripts/convert_with_ai.py +224 -0
- package/bin/skills/ml-paper-writing/SKILL.md +937 -0
- package/bin/skills/ml-paper-writing/references/checklists.md +361 -0
- package/bin/skills/ml-paper-writing/references/citation-workflow.md +562 -0
- package/bin/skills/ml-paper-writing/references/reviewer-guidelines.md +367 -0
- package/bin/skills/ml-paper-writing/references/sources.md +159 -0
- package/bin/skills/ml-paper-writing/references/writing-guide.md +476 -0
- package/bin/skills/ml-paper-writing/templates/README.md +251 -0
- package/bin/skills/ml-paper-writing/templates/aaai2026/README.md +534 -0
- package/bin/skills/ml-paper-writing/templates/aaai2026/aaai2026-unified-supp.tex +144 -0
- package/bin/skills/ml-paper-writing/templates/aaai2026/aaai2026-unified-template.tex +952 -0
- package/bin/skills/ml-paper-writing/templates/aaai2026/aaai2026.bib +111 -0
- package/bin/skills/ml-paper-writing/templates/aaai2026/aaai2026.bst +1493 -0
- package/bin/skills/ml-paper-writing/templates/aaai2026/aaai2026.sty +315 -0
- package/bin/skills/ml-paper-writing/templates/acl/README.md +50 -0
- package/bin/skills/ml-paper-writing/templates/acl/acl.sty +312 -0
- package/bin/skills/ml-paper-writing/templates/acl/acl_latex.tex +377 -0
- package/bin/skills/ml-paper-writing/templates/acl/acl_lualatex.tex +101 -0
- package/bin/skills/ml-paper-writing/templates/acl/acl_natbib.bst +1940 -0
- package/bin/skills/ml-paper-writing/templates/acl/anthology.bib.txt +26 -0
- package/bin/skills/ml-paper-writing/templates/acl/custom.bib +70 -0
- package/bin/skills/ml-paper-writing/templates/acl/formatting.md +326 -0
- package/bin/skills/ml-paper-writing/templates/colm2025/README.md +3 -0
- package/bin/skills/ml-paper-writing/templates/colm2025/colm2025_conference.bib +11 -0
- package/bin/skills/ml-paper-writing/templates/colm2025/colm2025_conference.bst +1440 -0
- package/bin/skills/ml-paper-writing/templates/colm2025/colm2025_conference.pdf +0 -0
- package/bin/skills/ml-paper-writing/templates/colm2025/colm2025_conference.sty +218 -0
- package/bin/skills/ml-paper-writing/templates/colm2025/colm2025_conference.tex +305 -0
- package/bin/skills/ml-paper-writing/templates/colm2025/fancyhdr.sty +485 -0
- package/bin/skills/ml-paper-writing/templates/colm2025/math_commands.tex +508 -0
- package/bin/skills/ml-paper-writing/templates/colm2025/natbib.sty +1246 -0
- package/bin/skills/ml-paper-writing/templates/iclr2026/fancyhdr.sty +485 -0
- package/bin/skills/ml-paper-writing/templates/iclr2026/iclr2026_conference.bib +24 -0
- package/bin/skills/ml-paper-writing/templates/iclr2026/iclr2026_conference.bst +1440 -0
- package/bin/skills/ml-paper-writing/templates/iclr2026/iclr2026_conference.pdf +0 -0
- package/bin/skills/ml-paper-writing/templates/iclr2026/iclr2026_conference.sty +246 -0
- package/bin/skills/ml-paper-writing/templates/iclr2026/iclr2026_conference.tex +414 -0
- package/bin/skills/ml-paper-writing/templates/iclr2026/math_commands.tex +508 -0
- package/bin/skills/ml-paper-writing/templates/iclr2026/natbib.sty +1246 -0
- package/bin/skills/ml-paper-writing/templates/icml2026/algorithm.sty +79 -0
- package/bin/skills/ml-paper-writing/templates/icml2026/algorithmic.sty +201 -0
- package/bin/skills/ml-paper-writing/templates/icml2026/example_paper.bib +75 -0
- package/bin/skills/ml-paper-writing/templates/icml2026/example_paper.pdf +0 -0
- package/bin/skills/ml-paper-writing/templates/icml2026/example_paper.tex +662 -0
- package/bin/skills/ml-paper-writing/templates/icml2026/fancyhdr.sty +864 -0
- package/bin/skills/ml-paper-writing/templates/icml2026/icml2026.bst +1443 -0
- package/bin/skills/ml-paper-writing/templates/icml2026/icml2026.sty +767 -0
- package/bin/skills/ml-paper-writing/templates/icml2026/icml_numpapers.pdf +0 -0
- package/bin/skills/ml-paper-writing/templates/neurips2025/Makefile +36 -0
- package/bin/skills/ml-paper-writing/templates/neurips2025/extra_pkgs.tex +53 -0
- package/bin/skills/ml-paper-writing/templates/neurips2025/main.tex +38 -0
- package/bin/skills/ml-paper-writing/templates/neurips2025/neurips.sty +382 -0
- package/bin/skills/paper-2-web/SKILL.md +491 -0
- package/bin/skills/paper-2-web/references/installation.md +141 -0
- package/bin/skills/paper-2-web/references/paper2poster.md +346 -0
- package/bin/skills/paper-2-web/references/paper2video.md +305 -0
- package/bin/skills/paper-2-web/references/paper2web.md +187 -0
- package/bin/skills/paper-2-web/references/usage_examples.md +436 -0
- package/bin/skills/peer-review/SKILL.md +702 -0
- package/bin/skills/peer-review/references/calibration_guidelines.md +196 -0
- package/bin/skills/peer-review/references/common_issues.md +552 -0
- package/bin/skills/peer-review/references/paper_mechanics.md +269 -0
- package/bin/skills/peer-review/references/reporting_standards.md +290 -0
- package/bin/skills/peer-review/references/scoring_rubric.md +239 -0
- package/bin/skills/pptx-posters/SKILL.md +410 -0
- package/bin/skills/pptx-posters/assets/poster_html_template.html +257 -0
- package/bin/skills/pptx-posters/assets/poster_quality_checklist.md +358 -0
- package/bin/skills/pptx-posters/references/poster_content_guide.md +748 -0
- package/bin/skills/pptx-posters/references/poster_design_principles.md +806 -0
- package/bin/skills/pptx-posters/references/poster_layout_design.md +900 -0
- package/bin/skills/research-grants/README.md +285 -0
- package/bin/skills/research-grants/SKILL.md +938 -0
- package/bin/skills/research-grants/assets/budget_justification_template.md +453 -0
- package/bin/skills/research-grants/assets/nih_specific_aims_template.md +166 -0
- package/bin/skills/research-grants/assets/nsf_project_summary_template.md +92 -0
- package/bin/skills/research-grants/references/broader_impacts.md +392 -0
- package/bin/skills/research-grants/references/darpa_guidelines.md +636 -0
- package/bin/skills/research-grants/references/doe_guidelines.md +586 -0
- package/bin/skills/research-grants/references/nih_guidelines.md +851 -0
- package/bin/skills/research-grants/references/nsf_guidelines.md +570 -0
- package/bin/skills/research-grants/references/specific_aims_guide.md +458 -0
- package/bin/skills/research-lookup/README.md +156 -0
- package/bin/skills/research-lookup/SKILL.md +606 -0
- package/bin/skills/research-lookup/examples.py +174 -0
- package/bin/skills/research-lookup/lookup.py +187 -0
- package/bin/skills/research-lookup/research_lookup.py +483 -0
- package/bin/skills/research-lookup/scripts/research_lookup.py +483 -0
- package/bin/skills/scholar-evaluation/SKILL.md +289 -0
- package/bin/skills/scholar-evaluation/references/evaluation_framework.md +663 -0
- package/bin/skills/scholar-evaluation/scripts/calculate_scores.py +366 -0
- package/bin/skills/scientific-critical-thinking/SKILL.md +566 -0
- package/bin/skills/scientific-critical-thinking/references/common_biases.md +364 -0
- package/bin/skills/scientific-critical-thinking/references/evidence_hierarchy.md +484 -0
- package/bin/skills/scientific-critical-thinking/references/experimental_design.md +496 -0
- package/bin/skills/scientific-critical-thinking/references/logical_fallacies.md +478 -0
- package/bin/skills/scientific-critical-thinking/references/scientific_method.md +169 -0
- package/bin/skills/scientific-critical-thinking/references/statistical_pitfalls.md +506 -0
- package/bin/skills/scientific-schematics/QUICK_REFERENCE.md +207 -0
- package/bin/skills/scientific-schematics/README.md +327 -0
- package/bin/skills/scientific-schematics/SKILL.md +615 -0
- package/bin/skills/scientific-schematics/example_usage.sh +89 -0
- package/bin/skills/scientific-schematics/references/best_practices.md +559 -0
- package/bin/skills/scientific-schematics/scripts/generate_schematic.py +135 -0
- package/bin/skills/scientific-schematics/scripts/generate_schematic_ai.py +807 -0
- package/bin/skills/scientific-schematics/test_ai_generation.py +243 -0
- package/bin/skills/scientific-slides/SKILL.md +942 -0
- package/bin/skills/scientific-slides/assets/timing_guidelines.md +597 -0
- package/bin/skills/scientific-slides/references/data_visualization_slides.md +708 -0
- package/bin/skills/scientific-slides/references/presentation_structure.md +642 -0
- package/bin/skills/scientific-slides/references/slide_design_principles.md +849 -0
- package/bin/skills/scientific-slides/references/talk_types_guide.md +687 -0
- package/bin/skills/scientific-slides/references/visual_review_workflow.md +775 -0
- package/bin/skills/scientific-slides/scripts/generate_slide_image.py +143 -0
- package/bin/skills/scientific-slides/scripts/generate_slide_image_ai.py +748 -0
- package/bin/skills/scientific-slides/scripts/pdf_to_images.py +201 -0
- package/bin/skills/scientific-slides/scripts/slides_to_pdf.py +220 -0
- package/bin/skills/scientific-slides/scripts/validate_presentation.py +367 -0
- package/bin/skills/scientific-writing/SKILL.md +714 -0
- package/bin/skills/scientific-writing/assets/REPORT_FORMATTING_GUIDE.md +574 -0
- package/bin/skills/scientific-writing/assets/scientific_report.sty +606 -0
- package/bin/skills/scientific-writing/assets/scientific_report_template.tex +449 -0
- package/bin/skills/scientific-writing/references/citation_styles.md +720 -0
- package/bin/skills/scientific-writing/references/figures_tables.md +806 -0
- package/bin/skills/scientific-writing/references/imrad_structure.md +686 -0
- package/bin/skills/scientific-writing/references/professional_report_formatting.md +664 -0
- package/bin/skills/scientific-writing/references/reporting_guidelines.md +748 -0
- package/bin/skills/scientific-writing/references/writing_principles.md +824 -0
- package/bin/skills/tinker/SKILL.md +2 -3
- package/bin/skills/together-ai/SKILL.md +722 -0
- package/bin/skills/treatment-plans/README.md +488 -0
- package/bin/skills/treatment-plans/SKILL.md +1579 -0
- package/bin/skills/treatment-plans/assets/STYLING_QUICK_REFERENCE.md +185 -0
- package/bin/skills/treatment-plans/assets/chronic_disease_management_plan.tex +665 -0
- package/bin/skills/treatment-plans/assets/general_medical_treatment_plan.tex +547 -0
- package/bin/skills/treatment-plans/assets/medical_treatment_plan.sty +222 -0
- package/bin/skills/treatment-plans/assets/mental_health_treatment_plan.tex +774 -0
- package/bin/skills/treatment-plans/assets/one_page_treatment_plan.tex +193 -0
- package/bin/skills/treatment-plans/assets/pain_management_plan.tex +799 -0
- package/bin/skills/treatment-plans/assets/perioperative_care_plan.tex +753 -0
- package/bin/skills/treatment-plans/assets/quality_checklist.md +471 -0
- package/bin/skills/treatment-plans/assets/rehabilitation_treatment_plan.tex +756 -0
- package/bin/skills/treatment-plans/references/goal_setting_frameworks.md +411 -0
- package/bin/skills/treatment-plans/references/intervention_guidelines.md +507 -0
- package/bin/skills/treatment-plans/references/regulatory_compliance.md +476 -0
- package/bin/skills/treatment-plans/references/specialty_specific_guidelines.md +655 -0
- package/bin/skills/treatment-plans/references/treatment_plan_standards.md +485 -0
- package/bin/skills/treatment-plans/scripts/check_completeness.py +322 -0
- package/bin/skills/treatment-plans/scripts/generate_template.py +233 -0
- package/bin/skills/treatment-plans/scripts/timeline_generator.py +385 -0
- package/bin/skills/treatment-plans/scripts/validate_treatment_plan.py +369 -0
- package/bin/skills/unsloth/SKILL.md +565 -47
- package/bin/skills/unsloth/docs/advanced-rl.md +222 -0
- package/bin/skills/unsloth/docs/chat-templates.md +141 -0
- package/bin/skills/unsloth/docs/datasets.md +489 -0
- package/bin/skills/unsloth/docs/docker-extended.md +99 -0
- package/bin/skills/unsloth/docs/dynamic-ggufs-2.0.md +116 -0
- package/bin/skills/unsloth/docs/dynamic-ggufs-aider.md +118 -0
- package/bin/skills/unsloth/docs/faq.md +91 -0
- package/bin/skills/unsloth/docs/fp16-vs-bf16.md +61 -0
- package/bin/skills/unsloth/docs/fp8-rl.md +224 -0
- package/bin/skills/unsloth/docs/glm-4.7-flash.md +997 -0
- package/bin/skills/unsloth/docs/inference-deployment-overview.md +17 -0
- package/bin/skills/unsloth/docs/inference.md +27 -0
- package/bin/skills/unsloth/docs/installation-docker.md +155 -0
- package/bin/skills/unsloth/docs/installation-pip.md +148 -0
- package/bin/skills/unsloth/docs/kernels-packing.md +190 -0
- package/bin/skills/unsloth/docs/kimi-k2.5.md +634 -0
- package/bin/skills/unsloth/docs/lm-studio.md +235 -0
- package/bin/skills/unsloth/docs/lora-hot-swapping.md +75 -0
- package/bin/skills/unsloth/docs/lora-hyperparameters.md +363 -0
- package/bin/skills/unsloth/docs/memory-efficient-rl.md +267 -0
- package/bin/skills/unsloth/docs/model-selection.md +70 -0
- package/bin/skills/unsloth/docs/models.md +532 -0
- package/bin/skills/unsloth/docs/multi-gpu-ddp.md +90 -0
- package/bin/skills/unsloth/docs/notebooks.md +223 -0
- package/bin/skills/unsloth/docs/overview.md +110 -0
- package/bin/skills/unsloth/docs/qwen3-coder-next-extended.md +900 -0
- package/bin/skills/unsloth/docs/qwen3-coder-next.md +900 -0
- package/bin/skills/unsloth/docs/requirements.md +45 -0
- package/bin/skills/unsloth/docs/reward-hacking.md +25 -0
- package/bin/skills/unsloth/docs/saving-to-gguf.md +138 -0
- package/bin/skills/unsloth/docs/saving-to-ollama.md +46 -0
- package/bin/skills/unsloth/docs/sglang-guide.md +278 -0
- package/bin/skills/unsloth/docs/speculative-decoding.md +70 -0
- package/bin/skills/unsloth/docs/tool-calling.md +334 -0
- package/bin/skills/unsloth/docs/troubleshooting-faq.md +204 -0
- package/bin/skills/unsloth/docs/troubleshooting-inference.md +26 -0
- package/bin/skills/unsloth/docs/tts-fine-tuning.md +149 -0
- package/bin/skills/unsloth/docs/tutorial-grpo.md +273 -0
- package/bin/skills/unsloth/docs/tutorial-llama3-ollama.md +356 -0
- package/bin/skills/unsloth/docs/vision-fine-tuning.md +135 -0
- package/bin/skills/unsloth/docs/vision-rl.md +170 -0
- package/bin/skills/unsloth/docs/vllm-engine-arguments.md +43 -0
- package/bin/skills/unsloth/docs/vllm-guide.md +98 -0
- package/bin/skills/venue-templates/SKILL.md +686 -0
- package/bin/skills/venue-templates/assets/examples/cell_summary_example.md +247 -0
- package/bin/skills/venue-templates/assets/examples/medical_structured_abstract.md +313 -0
- package/bin/skills/venue-templates/assets/examples/nature_abstract_examples.md +213 -0
- package/bin/skills/venue-templates/assets/examples/neurips_introduction_example.md +245 -0
- package/bin/skills/venue-templates/assets/grants/nih_specific_aims.tex +235 -0
- package/bin/skills/venue-templates/assets/grants/nsf_proposal_template.tex +375 -0
- package/bin/skills/venue-templates/assets/journals/nature_article.tex +171 -0
- package/bin/skills/venue-templates/assets/journals/neurips_article.tex +283 -0
- package/bin/skills/venue-templates/assets/journals/plos_one.tex +317 -0
- package/bin/skills/venue-templates/assets/posters/beamerposter_academic.tex +311 -0
- package/bin/skills/venue-templates/references/cell_press_style.md +483 -0
- package/bin/skills/venue-templates/references/conferences_formatting.md +564 -0
- package/bin/skills/venue-templates/references/cs_conference_style.md +463 -0
- package/bin/skills/venue-templates/references/grants_requirements.md +787 -0
- package/bin/skills/venue-templates/references/journals_formatting.md +486 -0
- package/bin/skills/venue-templates/references/medical_journal_styles.md +535 -0
- package/bin/skills/venue-templates/references/ml_conference_style.md +556 -0
- package/bin/skills/venue-templates/references/nature_science_style.md +405 -0
- package/bin/skills/venue-templates/references/posters_guidelines.md +628 -0
- package/bin/skills/venue-templates/references/reviewer_expectations.md +417 -0
- package/bin/skills/venue-templates/references/venue_writing_styles.md +321 -0
- package/bin/skills/venue-templates/scripts/customize_template.py +195 -0
- package/bin/skills/venue-templates/scripts/query_template.py +266 -0
- package/bin/skills/venue-templates/scripts/validate_format.py +250 -0
- package/bin/synsc +0 -0
- package/package.json +1 -1
- package/bin/skills/unsloth/references/index.md +0 -7
- package/bin/skills/unsloth/references/llms-full.md +0 -16799
- package/bin/skills/unsloth/references/llms-txt.md +0 -12044
- package/bin/skills/unsloth/references/llms.md +0 -82
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
# Inference & Deployment
|
|
2
|
+
|
|
3
|
+
You can also run your fine-tuned models by using [Unsloth's 2x faster inference](https://unsloth.ai/docs/basics/inference-and-deployment/unsloth-inference).
|
|
4
|
+
|
|
5
|
+
## Deployment Options
|
|
6
|
+
|
|
7
|
+
- [llama.cpp - Saving to GGUF](saving-to-gguf.md)
|
|
8
|
+
- [vLLM](vllm-guide.md)
|
|
9
|
+
- [Ollama](saving-to-ollama.md)
|
|
10
|
+
- [LM Studio](lm-studio.md)
|
|
11
|
+
- [SGLang](sglang-guide.md)
|
|
12
|
+
- [Unsloth Inference](inference.md)
|
|
13
|
+
- [Troubleshooting](troubleshooting-inference.md)
|
|
14
|
+
- [llama-server & OpenAI endpoint](llama-server-and-openai-endpoint.md)
|
|
15
|
+
- [vLLM Engine Arguments](vllm-engine-arguments.md)
|
|
16
|
+
- [LoRA Hotswapping](lora-hot-swapping-guide.md)
|
|
17
|
+
- [Tool Calling](tool-calling-guide-for-local-llms.md)
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
# Unsloth Inference
|
|
2
|
+
|
|
3
|
+
Unsloth supports natively 2x faster inference. For our inference only notebook, click [here](https://colab.research.google.com/drive/1aqlNQi7MMJbynFDyOQteD2t0yVfjb9Zh?usp=sharing).
|
|
4
|
+
|
|
5
|
+
All QLoRA, LoRA and non LoRA inference paths are 2x faster. This requires no change of code or any new dependencies.
|
|
6
|
+
|
|
7
|
+
```python
|
|
8
|
+
from unsloth import FastLanguageModel
|
|
9
|
+
model, tokenizer = FastLanguageModel.from_pretrained(
|
|
10
|
+
model_name = "lora_model", # YOUR MODEL YOU USED FOR TRAINING
|
|
11
|
+
max_seq_length = max_seq_length,
|
|
12
|
+
dtype = dtype,
|
|
13
|
+
load_in_4bit = load_in_4bit,
|
|
14
|
+
)
|
|
15
|
+
FastLanguageModel.for_inference(model) # Enable native 2x faster inference
|
|
16
|
+
text_streamer = TextStreamer(tokenizer)
|
|
17
|
+
_ = model.generate(**inputs, streamer = text_streamer, max_new_tokens = 64)
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
#### NotImplementedError: A UTF-8 locale is required. Got ANSI
|
|
21
|
+
|
|
22
|
+
Sometimes when you execute a cell [this error](https://github.com/googlecolab/colabtools/issues/3409) can appear. To solve this, in a new cell, run the below:
|
|
23
|
+
|
|
24
|
+
```python
|
|
25
|
+
import locale
|
|
26
|
+
locale.getpreferredencoding = lambda: "UTF-8"
|
|
27
|
+
```
|
|
@@ -0,0 +1,155 @@
|
|
|
1
|
+
# Install Unsloth via Docker
|
|
2
|
+
|
|
3
|
+
Learn how to use our Docker containers with all dependencies pre-installed for immediate installation. No setup required, just run and start training!
|
|
4
|
+
|
|
5
|
+
Unsloth Docker image: [**`unsloth/unsloth`**](https://hub.docker.com/r/unsloth/unsloth)
|
|
6
|
+
|
|
7
|
+
{% hint style="success" %}
|
|
8
|
+
You can now use our main Docker image `unsloth/unsloth` for Blackwell and 50-series GPUs - no separate image needed.
|
|
9
|
+
{% endhint %}
|
|
10
|
+
|
|
11
|
+
### ⚡ Quickstart
|
|
12
|
+
|
|
13
|
+
{% stepper %}
|
|
14
|
+
{% step %}
|
|
15
|
+
**Install Docker and NVIDIA Container Toolkit.**
|
|
16
|
+
|
|
17
|
+
Install Docker via [Linux](https://docs.docker.com/engine/install/) or [Desktop](https://docs.docker.com/desktop/) (other).\
|
|
18
|
+
Then install [NVIDIA Container Toolkit](https://docs.nvidia.com/datacenter/cloud-native/container-toolkit/latest/install-guide.html#installation):
|
|
19
|
+
|
|
20
|
+
<pre class="language-bash"><code class="lang-bash"><strong>export NVIDIA_CONTAINER_TOOLKIT_VERSION=1.17.8-1
|
|
21
|
+
</strong>sudo apt-get update && sudo apt-get install -y \
|
|
22
|
+
nvidia-container-toolkit=${NVIDIA_CONTAIR_TOOLKIT_VERSION} \
|
|
23
|
+
nvidia-container-toolkit-base=${NVIDIA_CONTAINER_TOOLKIT_VERSION} \
|
|
24
|
+
libnvidia-container-tools=${NVIDIA_CONTAINER_TOOLKIT_VERSION} \
|
|
25
|
+
libnvidia-container1=${NVIDIA_CONTAINER_TOOLKIT_VERSION}
|
|
26
|
+
</code></pre>
|
|
27
|
+
|
|
28
|
+
<figure><img src="https://3215535692-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FxhOjnexMCB3dmuQFQ2Zq%2Fuploads%2Fgit-blob-41cae231ed4761f844ce9836e03b17aabd7c803c%2Fnvidia%20toolkit.png?alt=media" alt=""><figcaption></figcaption></figure>
|
|
29
|
+
{% endstep %}
|
|
30
|
+
|
|
31
|
+
{% step %}
|
|
32
|
+
**Run the container.**
|
|
33
|
+
|
|
34
|
+
[**`unsloth/unsloth`**](https://hub.docker.com/r/unsloth/unsloth) is Unsloth's only Docker image. For Blackwell and 50-series GPUs, use this same image - no separate one needed.
|
|
35
|
+
|
|
36
|
+
```bash
|
|
37
|
+
docker run -d -e JUPYTER_PASSWORD="mypassword" \
|
|
38
|
+
-p 8888:8888 -p 2222:22 \
|
|
39
|
+
-v $(pwd)/work:/workspace/work \
|
|
40
|
+
--gpus all \
|
|
41
|
+
unsloth/unsloth
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
<figure><img src="https://3215535692-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FxhOjnexMCB3dmuQFQ2Zq%2Fuploads%2Fgit-blob-2b50d78c5d54eaf189c0a40d46c405585ea23082%2Fdocker%20run.png?alt=media" alt=""><figcaption></figcaption></figure>
|
|
45
|
+
{% endstep %}
|
|
46
|
+
|
|
47
|
+
{% step %}
|
|
48
|
+
**Access Jupyter Lab**
|
|
49
|
+
|
|
50
|
+
Go to [http://localhost:8888](http://localhost:8888/) and open Unsloth.
|
|
51
|
+
|
|
52
|
+
<figure><img src="https://3215535692-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FxhOjnexMCB3dmuQFQ2Zq%2Fuploads%2Fgit-blob-828df0a668fd94025c1193c24a7f09c1d58dcbd8%2Fjupyter.png?alt=media" alt="" width="563"><figcaption></figcaption></figure>
|
|
53
|
+
|
|
54
|
+
Access the `unsloth-notebooks` tabs to see Unsloth notebooks.
|
|
55
|
+
|
|
56
|
+
<div><figure><img src="https://3215535692-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FxhOjnexMCB3dmuQFQ2Zq%2Fuploads%2Fgit-blob-e7a3f620a3ec5bff335632ff9b0cb422f76528a1%2FScreenshot_from_2025-09-30_21-38-15.png?alt=media" alt=""><figcaption></figcaption></figure> <figure><img src="https://3215535692-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FxhOjnexMCB3dmuQFQ2Zq%2Fuploads%2Fgit-blob-531882c33eb96dec24e2d7673471d6a3928a3951%2FScreenshot_from_2025-09-30_21-39-41.png?alt=media" alt=""><figcaption></figcaption></figure></div>
|
|
57
|
+
{% endstep %}
|
|
58
|
+
|
|
59
|
+
{% step %}
|
|
60
|
+
**Start training with Unsloth**
|
|
61
|
+
|
|
62
|
+
If you're new, follow our step-by-step [Fine-tuning Guide](https://unsloth.ai/docs/get-started/fine-tuning-llms-guide), [RL Guide](https://unsloth.ai/docs/get-started/reinforcement-learning-rl-guide) or just save/copy any of our premade [notebooks](https://unsloth.ai/docs/get-started/unsloth-notebooks).
|
|
63
|
+
|
|
64
|
+
<figure><img src="https://3215535692-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FxhOjnexMCB3dmuQFQ2Zq%2Fuploads%2Fgit-blob-665f900b008991ddcd8fdabb773b292de3c41e72%2FScreenshot_from_2025-09-30_21-40-29.png?alt=media" alt=""><figcaption></figcaption></figure>
|
|
65
|
+
{% endstep %}
|
|
66
|
+
{% endstepper %}
|
|
67
|
+
|
|
68
|
+
#### 📂 Container Structure
|
|
69
|
+
|
|
70
|
+
* `/workspace/work/` — Your mounted work directory
|
|
71
|
+
* `/workspace/unsloth-notebooks/` — Example fine-tuning notebooks
|
|
72
|
+
* `/home/unsloth/` — User home directory
|
|
73
|
+
|
|
74
|
+
### 📖 Usage Ex# Full Example
|
|
75
|
+
|
|
76
|
+
```bash
|
|
77
|
+
docker run -d -e JUPYTER_PORT=8000 \
|
|
78
|
+
-e JUPYTER_PASSWORD="mypassword" \
|
|
79
|
+
-e "SSH_KEY=$(cat ~/.ssh/container_key.pub)" \
|
|
80
|
+
-e USER_PASSWORD="unsloth2024" \
|
|
81
|
+
-p 8000:8000 -p 2222:22 \
|
|
82
|
+
-v $(pwd)/work:/workspace/work \
|
|
83
|
+
--gpus all \
|
|
84
|
+
unsloth/unsloth
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
#### Setting up SSH Key
|
|
88
|
+
|
|
89
|
+
If you don't have an SSH key pair:
|
|
90
|
+
|
|
91
|
+
```bash
|
|
92
|
+
# Generate new key pair
|
|
93
|
+
ssh-keygen -t rsa -b 4096 -f ~/.ssh/container_key
|
|
94
|
+
|
|
95
|
+
# Use the public key in docker run
|
|
96
|
+
-e "SSH_KEY=$(cat ~/.ssh/container_key.pub)"
|
|
97
|
+
|
|
98
|
+
# Connect via SSH
|
|
99
|
+
ssh -i ~/.ssh/container_key -p 2222 unsloth@localhost
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
### 🦥Why Unsloth Containers?
|
|
103
|
+
|
|
104
|
+
* **Reliable**: Curated environment with stable & maintained package versions. Just 7 GB compressed (vs. 10–11 GB elsewhere)
|
|
105
|
+
* **Ready-to-use**: Pre-installed notebooks in `/workspace/unsloth-notebooks/`
|
|
106
|
+
* **Secure**: Runs safely as a non-root user
|
|
107
|
+
* **Universal**: Compatible with all transformer-based models (TTS, BERT, etc.)
|
|
108
|
+
|
|
109
|
+
### ⚙️ Advanced Settings
|
|
110
|
+
|
|
111
|
+
```bash
|
|
112
|
+
# Generate SSH key pair
|
|
113
|
+
ssh-keygen-b 4096 -f ~/.ssh/container_key
|
|
114
|
+
|
|
115
|
+
# Connect to container
|
|
116
|
+
ssh -i ~/.ssh/container_key -p 2222 unsloth@localhost
|
|
117
|
+
```
|
|
118
|
+
|
|
119
|
+
| Variable | Description | Default |
|
|
120
|
+
| ------------------ | ---------------------------------- | --------- |
|
|
121
|
+
| `JUPYTER_PASSWORD` | Jupyter Lab password | `unsloth` |
|
|
122
|
+
| `JUPYTER_PORT` | Jupyter Lab port inside container | `8888` |
|
|
123
|
+
| `SSH_KEY` | SSH public key for authentication | `None` |
|
|
124
|
+
| `USER_PASSWORD` | Password for `unsloth` user (sudo) | `unsloth` |
|
|
125
|
+
|
|
126
|
+
```bash
|
|
127
|
+
-p <host_port>:<container_port>
|
|
128
|
+
```
|
|
129
|
+
|
|
130
|
+
* Jupyter Lab: `-p 8000:8888`
|
|
131
|
+
* SSH access: `-p 2222:22`
|
|
132
|
+
|
|
133
|
+
{% hint style="warning" %}
|
|
134
|
+
**Important**: Use volume mounts to preserve your work between container runs.
|
|
135
|
+
{% endhint %}
|
|
136
|
+
|
|
137
|
+
```bash
|
|
138
|
+
-v <local_folder>:<container_folder>
|
|
139
|
+
```
|
|
140
|
+
|
|
141
|
+
```bash
|
|
142
|
+
docker run -d -e JUPYTER_PORT=8000 \
|
|
143
|
+
-e JUPYTER_PASSWORD="mypassword" \
|
|
144
|
+
-e "SSH_KEY=$(cat ~/.ssh/container_key.pub)" \
|
|
145
|
+
-e USER_PASSWORD="unsloth2024" \
|
|
146
|
+
-p 8000:8000 -p 2222:22 \
|
|
147
|
+
-v $(pwd)/work:/workspace/work \
|
|
148
|
+
--gpus all \
|
|
149
|
+
unsloth/unsloth
|
|
150
|
+
```
|
|
151
|
+
|
|
152
|
+
### **🔒 Security Notes**
|
|
153
|
+
|
|
154
|
+
* Container runs as non-root `unsloth` user by default
|
|
155
|
+
* Use `USER_PASSWORD` for sudo operations inside container
|
|
@@ -0,0 +1,148 @@
|
|
|
1
|
+
# Instal Unsloth via pip and uv
|
|
2
|
+
|
|
3
|
+
## **Recommended installation method**
|
|
4
|
+
|
|
5
|
+
**Install with pip (recommended) for the latest pip release:**
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
pip install unsloth
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
To use **uv**:
|
|
12
|
+
|
|
13
|
+
```bash
|
|
14
|
+
pip install --upgrade pip && pip install uv
|
|
15
|
+
uv pip install unsloth
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
To install **vLLM and Unsloth** together, do:
|
|
19
|
+
|
|
20
|
+
```bash
|
|
21
|
+
uv pip install unsloth vllm
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
To install the **latest main branch** of Unsloth, do:
|
|
25
|
+
|
|
26
|
+
{% code overflow="wrap" %}
|
|
27
|
+
|
|
28
|
+
```bash
|
|
29
|
+
pip install unsloth
|
|
30
|
+
pip uninstall unsloth unsloth_zoo -y && pip install --no-deps git+https://github.com/unslothai/unsloth_zoo.git && pip install --no-deps git+https://github.com/unslothai/unsloth.git
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
{% endcode %}
|
|
34
|
+
|
|
35
|
+
For **venv and virtual environments installs** to isolate your installation to not break system packages, and to reduce irreparable damage to your system, use venv:
|
|
36
|
+
|
|
37
|
+
{% code overflow="wrap" %}
|
|
38
|
+
|
|
39
|
+
```bash
|
|
40
|
+
apt install python3.10-venv python3.11-venv python3.12-venv python3.13-venv -y
|
|
41
|
+
python -m venv unsloth_env
|
|
42
|
+
source unsloth_env/bin/activate
|
|
43
|
+
pip install --upgrade pip && pip install uv
|
|
44
|
+
uv pip install unsloth
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
{% endcode %}
|
|
48
|
+
|
|
49
|
+
If you're installing Unsloth in Jupyter, Colab, or other notebooks, be sure to prefix the command with `!`. This isn't necessary when using a terminal
|
|
50
|
+
|
|
51
|
+
{% hint style="info" %}
|
|
52
|
+
Python 3.13 is now supported!
|
|
53
|
+
{% endhint %}
|
|
54
|
+
|
|
55
|
+
## Uninstall or Reinstall
|
|
56
|
+
|
|
57
|
+
If you're still encountering dependency issues with Unsloth, many users have resolved them by forcing uninstalling and reinstalling Unsloth:
|
|
58
|
+
|
|
59
|
+
{% code overflow="wrap" %}
|
|
60
|
+
|
|
61
|
+
```bash
|
|
62
|
+
pip install --upgrade --force-reinstall --no-cache-dir --no-deps unsloth
|
|
63
|
+
pip install --upgrade --force-reinstall --no-cache-dir --no-deps unsloth_zoo
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
{% endcode %}
|
|
67
|
+
|
|
68
|
+
***
|
|
69
|
+
|
|
70
|
+
## Advanced Pip Installation
|
|
71
|
+
|
|
72
|
+
{% hint style="warning" %}
|
|
73
|
+
Do **NOT** use this if you have [Conda](https://unsloth.ai/docs/get-started/install/conda-install).
|
|
74
|
+
{% endhint %}
|
|
75
|
+
|
|
76
|
+
Pip is a bit more complex since there are dependency issues. The pip command is different for `torch 2.2,2.3,2.4,2.5` and CUDA versions.
|
|
77
|
+
|
|
78
|
+
For other torch versions, we support `torch211`, `torch212`, `torch220`, `torch230`, `torch240` and for CUDA versions, we support `cu118` and `cu121` and `cu124`. For Ampere devices (A100, H100, RTX3090) and above, use `cu118-ampere` or `cu121-ampere` or `cu124-ampere`.
|
|
79
|
+
|
|
80
|
+
For example, if you have `torch 2.4` and `CUDA 12.1`, use:
|
|
81
|
+
|
|
82
|
+
```bash
|
|
83
|
+
pip install --upgrade pip
|
|
84
|
+
pip install "unsloth[cu121-torch240] @ git+https://github.com/unslothai/unsloth.git"
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
Another example, if you have `torch 2.5` and `CUDA 12.4`, use:
|
|
88
|
+
|
|
89
|
+
```bash
|
|
90
|
+
pip install --upgrade pip
|
|
91
|
+
pip install "unsloth[cu124-torch250] @ git+https://github.com/unslothai/unsloth.git"
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
And other examples:
|
|
95
|
+
|
|
96
|
+
```bash
|
|
97
|
+
pip install "unsloth[cu121-ampere-torch240] @ git+https://github.com/unslothai/unsloth.git"
|
|
98
|
+
pip install "unsloth[cu118-ampere-torch240] @ git+https://github.com/unslothai/unsloth.git"
|
|
99
|
+
pip install "unsloth[cu121-torch240] @ git+https://github.com/unslothai/unsloth.git"
|
|
100
|
+
pip install "unsloth[cu118-torch240] @ git+https://github.com/unslothai/unsloth.git"
|
|
101
|
+
|
|
102
|
+
pip install "unsloth[cu121-torch230] @ git+https://github.com/unslothai/unsloth.git"
|
|
103
|
+
pip install "unsloth[cu121-ampere-torch230] @ git+https://github.com/unslothai/unsloth.git"
|
|
104
|
+
|
|
105
|
+
pip install "unsloth[cu121-torch250] @ git+https://github.com/unslothai/unsloth.git"
|
|
106
|
+
pip install "unsloth[cu124-ampere-torch250] @ git+https://github.com/unslothai/unsloth.git"
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
Or, run the below in a terminal to get the **optimal** pip installation command:
|
|
110
|
+
|
|
111
|
+
```bash
|
|
112
|
+
wget -qO- https://raw.githubusercontent.com/unslothai/unsloth/main/unsloth/_auto_install.py | python -
|
|
113
|
+
```
|
|
114
|
+
|
|
115
|
+
Or, run the below manually in a Python REPL:
|
|
116
|
+
|
|
117
|
+
{% code overflow="wrap" %}
|
|
118
|
+
|
|
119
|
+
```python
|
|
120
|
+
# Licensed under the Apache License, Version 2.0 (the "License")
|
|
121
|
+
try: import torch
|
|
122
|
+
except: raise ImportError('Install torch via `pip install torch`')
|
|
123
|
+
from packaging.version import Version as V
|
|
124
|
+
import re
|
|
125
|
+
v = V(re.match(r"[0-9\.]{3,}", torch.__version__).group(0))
|
|
126
|
+
cuda = str(torch.version.cuda)
|
|
127
|
+
is_ampere = torch.cuda.get_device_capability()[0] >= 8
|
|
128
|
+
USE_ABI = torch._C._GLIBCXX_USE_CXX11_ABI
|
|
129
|
+
if cuda not in ("11.8", "12.1", "12.4", "12.6", "12.8", "13.0"): raise RuntimeError(f"CUDA = {cuda} not supported!")
|
|
130
|
+
if v <= V('2.1.0'): raise RuntimeError(f"Torch = {v} too old!")
|
|
131
|
+
elif v <= V('2.1.1'): x = 'cu{}{}-torch211'
|
|
132
|
+
elif v <= V('2.1.2'): x = 'cu{}{}-torch212'
|
|
133
|
+
elif v < V('2.3.0'): x = 'cu{}{}-torch220'
|
|
134
|
+
elif v < V('2.4.0'): x = 'cu{}{}-torch230'
|
|
135
|
+
elif v < V('2.5.0'): x = 'cu{}{}-torch240'
|
|
136
|
+
elif v < V('2.5.1'): x = 'cu{}{}-torch250'
|
|
137
|
+
elif v <= V('2.5.1'): x = 'cu{}{}-torch251'
|
|
138
|
+
elif v < V('2.7.0'): x = 'cu{}{}-torch260'
|
|
139
|
+
elif v < V('2.7.9'): x = 'cu{}{}-torch270'
|
|
140
|
+
elif v < V('2.8.0'): x = 'cu{}{}-torch271'
|
|
141
|
+
elif v < V('2.8.9'): x = 'cu{}{}-torch280'
|
|
142
|
+
elif v < V('2.9.1'): x = 'cu{}{}-torch290'
|
|
143
|
+
elif v < V('2.9.2'): x = 'cu{}{}-torch291'
|
|
144
|
+
else: raise RuntimeError(f"Torch = {v} too new!")
|
|
145
|
+
if v > V('2.6.9') and cuda not in ("11.8", "12.6", "12.8", "13.0"): raise RuntimeError(f"CUDA = {cuda} not supported!")
|
|
146
|
+
x = x.format(cuda.replace(".", ""), "-ampere" if False else "") # is_ampere is broken due to flash-attn
|
|
147
|
+
print(f'pip install --upgrade pip && pip install --no-deps git+https://github.com/unslothai/unsloth-zoo.git && pip install "unsloth[{x}] @ git+https://github.com/unslothai/unsloth.git" --no-build-isolation')
|
|
148
|
+
```
|
|
@@ -0,0 +1,190 @@
|
|
|
1
|
+
# 3x Faster LLM Training with Unsloth Kernels + Packing
|
|
2
|
+
|
|
3
|
+
Unsloth now supports up to **5× faster** (typically 3x) training with our new custom **RoPE and MLP Triton kernels**, plus our new smart auto packing. Unsloth's new kernels + features not only increase training speed, but also further **reduces VRAM use (30% - 90%)** with no accuracy loss. [Unsloth GitHub](https://github.com/unslothai/unsloth)\
|
|
4
|
+
\
|
|
5
|
+
This means you can now train LLMs like [Qwen3](https://unsloth.ai/docs/models/qwen3-how-to-run-and-fine-tune)-4B not only on just **3GB VRAM**, but also 3x faster.
|
|
6
|
+
|
|
7
|
+
Our auto [**padding-free**](#padding-free-by-default) uncontaminated packing is smartly enabled for all training runs without any changes, and all fast attention backends (FlashAttention 3, xFormers, SDPA). [Benchmarks](#analysis-and-benchmarks) show training losses match non-packing runs **exactly**.
|
|
8
|
+
|
|
9
|
+
* **2.3x faster QK Rotary Embedding** fused Triton kernel with packing support
|
|
10
|
+
* Updated SwiGLU, GeGLU kernels with **int64 indexing for lon context**
|
|
11
|
+
* **2.5x to 5x faster uncontaminated packing** with xformers, SDPA, FA3 backends
|
|
12
|
+
* **2.1x faster padding free, 50% less VRAM**, 0% accuracy change
|
|
13
|
+
* Unsloth also now has improved SFT loss stability and more predictable GPU utilization.
|
|
14
|
+
* This new upgrade works **for all training methods** e.g. full fine-tuning, pretraining etc.
|
|
15
|
+
|
|
16
|
+
### :drum:Fused QK RoPE Triton Kernel with packing
|
|
17
|
+
|
|
18
|
+
Back in December 2023, we introduced a RoPE kernel coded up in Triton as part of our Unsloth launch. In March 2024, a community member made end to end training 1-2% faster by optimizing the RoPE kernel to allow launching a block for a group of heads. See [PR 238](https://github.com/unslothai/unsloth/pull/238).
|
|
19
|
+
|
|
20
|
+
<figure><img src="https://3215535692-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FxhOjnexMCB3dmuQFQ2Zq%2Fuploads%2FewadBu05vK7zAmJRJcj6%2Frope_varlen_qk_rope_kernel_benchmark_v5.png?alt=media&token=04d277d4-c289-4943-9312-e3d3e2d60bec" alt="" width="563"><figcaption></figcaption></figure>
|
|
21
|
+
|
|
22
|
+
One issue is for each Q and K, there are 2 Triton kernels. We merged them into 1 Triton kernel now, and enabled variable length RoPE, which was imperative for padding free and packing support. This makes the RoPE kernel in micro benchmarks **2.3x faster on longer context lengths**, and 1.9x faster on shorter context lengths.
|
|
23
|
+
|
|
24
|
+
We also eliminated all clones and contiguous transpose operations, and so **RoPE is now fully inplace**, reducing further GPU memory. Note for the backward pass, we see that `sin1 = -sin1` since:
|
|
25
|
+
|
|
26
|
+
```
|
|
27
|
+
Q * cos + rotate_half(Q) * sin
|
|
28
|
+
is equivalent to
|
|
29
|
+
Q * cos + Q @ R * sin
|
|
30
|
+
where R is a rotation matrix [ 0, I]
|
|
31
|
+
[-I, 0]
|
|
32
|
+
dC/dY = dY * cos + dY @ R.T * sin
|
|
33
|
+
where R.T is again the same [ 0, -I]
|
|
34
|
+
but the minus is transposed. [ I, 0]
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
### :railway\_car:Int64 Indexing for Triton Kernels
|
|
38
|
+
|
|
39
|
+
During 500K long context training which we introduced in [500k-context-length-fine-tuning](https://unsloth.ai/docs/blog/500k-context-length-fine-tuning "mention"), we would get CUDA out of bounds errors. This was because MLP kernels for SwiGLU, GeGLU had int32 indexing which is by default in Triton and CUDA.
|
|
40
|
+
|
|
41
|
+
We can't just do `tl.program_id(0).to(tl.int64)` since training will be slightly slower due to int64 indexing. We instead make this a `LONG_INDEXING: tl.constexpr` variable so the Triton compiler can specialize this. This allows shorter and longer context runs to both run great!
|
|
42
|
+
|
|
43
|
+
{% code overflow="wrap" %}
|
|
44
|
+
|
|
45
|
+
```python
|
|
46
|
+
block_idx = tl.program_id(0)
|
|
47
|
+
if LONG_INDEXING:
|
|
48
|
+
offsets = block_idx.to(tl.int64) * BLOCK_SIZE + tl.arange(0, BLOCK_SIZE).to(tl.int64)
|
|
49
|
+
n_elements = tl.cast(n_elements, tl.int64)
|
|
50
|
+
else:
|
|
51
|
+
offsets = block_idx * BLOCK_SIZE + tl.arange(0, BLOCK_SIZE)
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
{% endcode %}
|
|
55
|
+
|
|
56
|
+
### :abacus:Why is padding needed & mathematical speedup
|
|
57
|
+
|
|
58
|
+
Computers and GPUs cannot process different length datasets, so we have to pad them with 0s. This causes wastage. Assume we have a dataset of 50% short sequences S, and 50% long sequences L, then in the worst case, padding will cause token usage to be $\text{batchsize} \times L$ since the longest sequence length dominates.
|
|
59
|
+
|
|
60
|
+
By packing multiple examples into a single, long one-dimensional tensor, we can eliminate a significant amount of padding. In fact we get the below token usage:
|
|
61
|
+
|
|
62
|
+
$
|
|
63
|
+
\text{Token Usage} = \frac{\text{batchsize}}{2}L+\frac{\text{batchsize}}{2}S
|
|
64
|
+
$
|
|
65
|
+
|
|
66
|
+
By some math and algebra, we can work out the speedup via:
|
|
67
|
+
|
|
68
|
+
$
|
|
69
|
+
\text{Speedup} = \frac{\text{batchsize} \times L}{\frac{\text{batchsize}}{2}L+\frac{\text{batchsize}}{2}S} = 2 \frac{L}{L + S}
|
|
70
|
+
$
|
|
71
|
+
|
|
72
|
+
By assuming $S\rightarrow0$ then we get a 2x theoretical speedup since $2 \frac{L}{L + 0} = 2$
|
|
73
|
+
|
|
74
|
+
By changing the ratio of 50% short sequences, and assuming we have MORE short sequences, for eg 20% long sequences and 80% short sequences, we get $\frac{L}{0.2L + 0.8S}\rightarrow\frac{L}{0.2L}=5$ so 5x faster training! This means packing's speedup depends on how short rows your dataset has (the more shorter, the faster).
|
|
75
|
+
|
|
76
|
+
### :clapper:Padding-Free by Default
|
|
77
|
+
|
|
78
|
+
In addition to large throughput gains available when setting `packing = True` in your `SFTConfig` , we will **automatically use padding-free batching** in order to reduce padding waste improve throughput and increases tokens/s throughput, while resulting in the ***exact same loss*** as seen in the previous version of Unsloth.
|
|
79
|
+
|
|
80
|
+
For example for Qwen3-8B and Qwen3-32B, we see memory usage decrease by 60%, be 2x faster, and have the same exact loss and grad norm curves!
|
|
81
|
+
|
|
82
|
+
<div><figure><img src="https://3215535692-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FxhOjnexMCB3dmuQFQ2Zq%2Fuploads%2FPATEJoJwIotXNPsYT1hu%2FW%26B%20Chart%2010_12_2025%2C%203_57_51%20am.png?alt=media&token=e31ee2cd-cd6e-4fd2-9c59-7f2148179815" alt=""><figcaption></figcaption></figure> <figure><img src="https://3215535692-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FxhOjnexMCB3dmuQFQ2Zq%2Fuploads%2FjjnXdgPSgUxL9WNzx9wc%2FW%26B%20Chart%2010_12_2025%2C%203_58_19%20am.png?alt=media&token=54368c73-2ce1-4faa-a1f4-c82341638be3" alt=""><figcaption></figcaption></figure></div>
|
|
83
|
+
|
|
84
|
+
<div><figure><img src="https://3215535692-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FxhOjnexMCB3dmuQFQ2Zq%2Fuploads%2FA61fgCtUj0K9dhrHCt0C%2FW%26B%20Chart%2010_12_2025%2C%203_54_40%20am.png?alt=media&token=b8472635-4b05-430e-9df1-3820ed381c3f" alt="" width="563"><figcaption></figcaption></figure> <figure><img src="https://3215535692-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FxhOjnexMCB3dmuQFQ2Zq%2Fuploads%2FPh0Xfaup0CTz8REL6P9F%2FW%26B%20Chart%2010_12_2025%2C%203_56_38%20am.png?alt=media&token=86ed33c3-e5ac-4b71-82c3-f8f86ca79862" alt="" width="563"><figcaption></figcaption></figure> <figure><img src="https://3215535692-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FxhOjnexMCB3dmuQFQ2Zq%2Fuploads%2F6FKM6pkRkQX3gzQLdcIP%2FW%26B%20Chart%2010_12_2025%2C%203_55_38%20am.png?alt=media&token=48d2c1d3-e6f2-420c-8209-70ef247ce63d" alt="" width="563"><figcaption></figcaption></figure> <figure><img src="https://3215535692-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FxhOjnexMCB3dmuQFQ2Zq%2Fuploads%2FxbhcPeELu78xh3M01xkf%2FW%26B%20Chart%2010_12_2025%2C%203_56_07%20am.png?alt=media&token=375c3f27-5af8-43e5-93eb-3818cb401f95" alt="" width="563"><figcaption></figcaption></figure></div>
|
|
85
|
+
|
|
86
|
+
### :spades:Uncontaminated Packing 2-5x faster training
|
|
87
|
+
|
|
88
|
+
Real datasets can contain different sequence lengths, so increasing the batch size to 32 for example will cause padding, making training slower and use more VRAM.
|
|
89
|
+
|
|
90
|
+
{% hint style="success" %}
|
|
91
|
+
In the past, increasing `batch_size` to large numbers (>32) will make training SLOWER, not faster. This was due to padding - we can now eliminate this issue via `packing = True`, and so training is FASTER!
|
|
92
|
+
{% endhint %}
|
|
93
|
+
|
|
94
|
+
When we pack multiple samples into a single one-dimensional tensor, we keep sequence length metadata around in order to properly mask samples, without leaking attention between samples. We also need the RoPE kernel described in [#fused-qk-rope-triton-kernel-with-packing](#fused-qk-rope-triton-kernel-with-packing "mention") to allow reset position ids.
|
|
95
|
+
|
|
96
|
+
{% columns %}
|
|
97
|
+
{% column width="41.66666666666667%" %}
|
|
98
|
+
|
|
99
|
+
<div align="center" data-full-width="false"><figure><img src="https://3215535692-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FxhOjnexMCB3dmuQFQ2Zq%2Fuploads%2F508zS4YN2sYnYjYkt8ej%2Fimage.png?alt=media&token=a05f917a-f593-4abd-a834-2f3f6652ca5a" alt="" width="563"><figcaption><p>4 examples without packing wastes space</p></figcaption></figure></div>
|
|
100
|
+
|
|
101
|
+
{% endcolumn %}
|
|
102
|
+
|
|
103
|
+
{% column width="58.33333333333333%" %}
|
|
104
|
+
|
|
105
|
+
<figure><img src="https://3215535692-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FxhOjnexMCB3dmuQFQ2Zq%2Fuploads%2F8azEy9wbeF2RWSWbNdma%2Fimage.png?alt=media&token=a4b96567-244a-45ed-8b18-b16074bac88c" alt=""><figcaption><p>Uncontaminated packing creates correct attention pattern</p></figcaption></figure>
|
|
106
|
+
{% endcolumn %}
|
|
107
|
+
{% endcolumns %}
|
|
108
|
+
|
|
109
|
+
By changing the ratio of 50% short sequences, and assuming we have MORE short sequences, for eg 20% long sequences and 80% long sequences, we get $\frac{L}{0.2L + 0.8S}\rightarrow\frac{L}{0.2L}=5$ so 5x faster training! This means packing's speedup depends on how short rows your dataset has (the more shorter, the faster).
|
|
110
|
+
|
|
111
|
+
### :beach:Analysis and Benchmarks
|
|
112
|
+
|
|
113
|
+
To demonstrate the various improvements when training with our new kernels and packed data, we ran fine-tuning runs with [Qwen3-32B](https://unsloth.ai/docs/models/qwen3-how-to-run-and-fine-tune), Qwen3-8B, Llama 3 8B on the `yahma/alpaca-cleaned` dataset and measured various [training loss](#padding-free-by-default) throughput and efficiency metrics. We compared our new runs vs. a standard optimized training run with our own kernels/optimizations turned on and kernels like Flash Attention 3 (FA3) enabled. We fixed `max_length = 1024` and varied the batch size in {1, 2, 4, 8, 16, 32}. This allows the maximum token count per batch to vary in {1024, 2048, 4096, 8192, 16K, 32K}.
|
|
114
|
+
|
|
115
|
+
<figure><img src="https://3215535692-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FxhOjnexMCB3dmuQFQ2Zq%2Fuploads%2FFfmdok7AmeretPSGlZjg%2Fnew%20rope%20kernel%20graph.png?alt=media&token=d890fd95-c8c0-4817-9ee3-18e3095cde5f" alt="" width="563"><figcaption></figcaption></figure>
|
|
116
|
+
|
|
117
|
+
The above shows how tokens per second (tokens/s) training throughput varies for new Unsloth with varying batch size. This translates into training your model on an epoch of your dataset **1.7-3x faster (sometimes even 5x or more)**! These gains will be more pronounced if there are many short sequences in your data and if you have longer training runs, as described in [#why-is-padding-needed-and-mathematical-speedup](#why-is-padding-needed-and-mathematical-speedup "mention")
|
|
118
|
+
|
|
119
|
+
<figure><img src="https://3215535692-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FxhOjnexMCB3dmuQFQ2Zq%2Fuploads%2FReViERxLWBHnT8GOv0ql%2Fpacking_efficiency_by_per_device_train_batch_size.png?alt=media&token=1c4a78c7-a611-4374-ac03-94aabb1d3184" alt="" width="563"><figcaption></figcaption></figure>
|
|
120
|
+
|
|
121
|
+
The above shows the average percentage of tokens per batch that are valid (i.e., non-padding). As the batch size length grows, many more padding tokens are seen in the unpacked case, while we achieve a high packing efficiency in the packed case regardless of max sequence length.
|
|
122
|
+
|
|
123
|
+
Note that, since the batching logic trims batches to the maximum sequence length seen in the batch, when the batch size is 1, the unpacked data is all valid tokens (i.e., no padding). However, as more examples are added into the batch, padding increases on average, hitting nearly 50% padding with batch size is 8! Our sample packing implementation eliminates that waste.
|
|
124
|
+
|
|
125
|
+
<div><figure><img src="https://3215535692-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FxhOjnexMCB3dmuQFQ2Zq%2Fuploads%2FRfzNZVz9uzDPhEe3frGe%2Funknown.png?alt=media&token=e9fe893e-6b94-4c0d-b144-ef8315067c1e" alt="" width="563"><figcaption></figcaption></figure> <figure><img src="https://3215535692-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FxhOjnexMCB3dmuQFQ2Zq%2Fuploads%2FTHtcpIdQ0z0mGRYYBfuF%2Funknown.png?alt=media&token=ec52b2c1-1e60-4ed2-969a-d760af26be2a" alt="" width="563"><figcaption></figcaption></figure></div>
|
|
126
|
+
|
|
127
|
+
The first graph (above) plots progress on `yahma/alpaca-cleaned` with `max_length = 2048`, Unsloth new with packing + kernels (maroon) vs. Unsloth old (gray). Both are trained with `max_steps = 500`, but we plot the x-axis in wall-clock time. Notice that we train on nearly 40% of an epoch in the packed case in the same amount of steps (and only a bit more wall-clock time) that it takes to train less than 5% of an epoch in the unpacked case.
|
|
128
|
+
|
|
129
|
+
Similarly, the 2nd graph (above) plots loss from the same runs, this time plotted with training steps on the x-axis. Notice that the losses match in scale and trend, but the loss in the packing case is less variable since the model is seeing more tokens per training step.
|
|
130
|
+
|
|
131
|
+
### :sparkles:How to enable packing?
|
|
132
|
+
|
|
133
|
+
**Update Unsloth first and padding free is done by default**! So all training is immediately 1.1 to 2x faster with 30% less memory usage at least and 0 change in loss curve metric!
|
|
134
|
+
|
|
135
|
+
{% code overflow="wrap" %}
|
|
136
|
+
|
|
137
|
+
```bash
|
|
138
|
+
pip install --upgrade --force-reinstall --no-cache-dir --no-deps unsloth
|
|
139
|
+
pip install --upgrade --force-reinstall --no-cache-dir --no-deps unsloth_zoo
|
|
140
|
+
```
|
|
141
|
+
|
|
142
|
+
{% endcode %}
|
|
143
|
+
|
|
144
|
+
We also support Flash Attention 3 via Xformers, SDPA support, Flash Attention 2, and this works on old GPUs (Tesla T4, RTX 2080) and new GPUs like H100s, B200s etc! Sample packing works *regardless of choice of attention backend or model family*, so enjoy the same speedups previously had with these fast attention implementations!
|
|
145
|
+
|
|
146
|
+
If you want to enable explicit packing, then add `packing = True` to enable up to 5x faster training!
|
|
147
|
+
|
|
148
|
+
{% hint style="warning" %}
|
|
149
|
+
Note `packing=True` will change the training loss and will make the dataset number of rows truncated, since multiple short sequences are packed into 1 sequence. You might see the number of examples in the dataset shrink.
|
|
150
|
+
|
|
151
|
+
To not get different training loss numbers, simply set `packing=False` and we will enable auto padding-free, which already makes training faster!
|
|
152
|
+
{% endhint %}
|
|
153
|
+
|
|
154
|
+
```python
|
|
155
|
+
from unsloth import FastLanguageModel
|
|
156
|
+
from trl import SFTTrainer, SFTConfig
|
|
157
|
+
|
|
158
|
+
model, tokenizer = FastLanguageModel.from_pretrained(
|
|
159
|
+
"unsloth/Qwen3-14B",
|
|
160
|
+
)
|
|
161
|
+
|
|
162
|
+
trainer = SFTTrainer(
|
|
163
|
+
model = model,
|
|
164
|
+
processing_class = tokenizer,
|
|
165
|
+
train_dataset = dataset,
|
|
166
|
+
args = SFTConfig(
|
|
167
|
+
per_device_train_batch_size = 1,
|
|
168
|
+
max_length = 4096,
|
|
169
|
+
…,
|
|
170
|
+
packing = True, # required to enable sample packing!
|
|
171
|
+
),
|
|
172
|
+
)
|
|
173
|
+
trainer.train()
|
|
174
|
+
```
|
|
175
|
+
|
|
176
|
+
All our notebooks are automatically faster (no need to do anything). See [unsloth-notebooks](https://unsloth.ai/docs/get-started/unsloth-notebooks "mention")
|
|
177
|
+
|
|
178
|
+
{% columns %}
|
|
179
|
+
{% column %}
|
|
180
|
+
Qwen3 14B faster:
|
|
181
|
+
|
|
182
|
+
{% embed url="<https://colab.research.google.com/github/unslothai/notebooks/blob/main/nb/Qwen3_(14B)-Reasoning-Conversational.ipynb>" %}
|
|
183
|
+
{% endcolumn %}
|
|
184
|
+
|
|
185
|
+
{% column %}
|
|
186
|
+
Llama 3.1 Conversational faster:
|
|
187
|
+
|
|
188
|
+
{% embed url="<https://colab.research.google.com/github/unslothai/notebooks/blob/main/nb/Llama3.2_(1B_and_3B)-Conversational.ipynb>" %}
|
|
189
|
+
{% endcolumn %}
|
|
190
|
+
{% endcolumns %}
|