unslothai

Stars and mentions

Last 30 days, Oct 4 – Nov 2

GitHub stars1,442
mentions59
03876114152Oct 4Oct 18Nov 2
UTC days · repositories unslothai owns4 repositories

Package downloads

Cumulative recorded downloads · since 2025-10-25

npm39.3K
PyPI—
03.1M6.2M9.3M12.4MOct 4Oct 18Nov 2
Oct 29npm: 1/2 packages observed · PyPI: 0/1 packages observed

Across 3 known packages in repositories unslothai owns. Cumulative totals include recorded downloads before the selected range. Missing observations leave gaps; totals may be incomplete. PyPI excludes known mirrors.

Top repositories

unslothai’s repositories ranked by new stars, as on trending.

Loading

Contributes to

Repositories outside unslothai’s account where unslothai opened or reviewed pull requests in the past 365 days.

Who noticed unslothai

Everyone who starred or forked unslothai’s repositories since the archive began in 2011.

Notable accounts

Ordered by the stars their own repositories have received.

Biggest fans

Accounts that starred the most of these repositories.

Breakout weeks

Each repository’s best week of new stars, with the release published around it.

Mentions

61posts
Nov 32 posts
  1. 論文まとめと実装例:SafeGen-LLM: Enhancing Safety Generalization in Task Planning for Robotic Systems はじめに 2026年2月のarXivから以下の論文 [1] J. Fan, et. al. SafeGen-LLM: Enhancing Safety Generalization in Task Planning for Robotic Systems のまとめと、実装例を作成。 - 論文:arxiv.org - 作成したデモ・コード:webfarmer-ltd/safegen-LLM-demo 1. 概要 1. physical AI の task planningに関する論文 1. 用意した正解planningに対して SFT と GRPO を実施する 1. 安全面に配慮するためGRPO時の報酬で安全性を加味する 下図のように !スクリーンショット 2026-11-04 1.52.56.png 左の initial state から始めて、右の Goal state へ至るplanningをする。「eを掴んで机の上に置く」「eの上にbを置く」などのplanを正しい順序で生成するタスク。 その際に左の Safety constraint を守る必要があり、これをいかに学習に取り組むかが本論文の焦点。 1.1 全体的な流れ 下図のように !スクリーンショット 2026-11-04 1.25.55.png datasetを作成し(上図中の左)、教師あり学習させ(上図中の右上)、GRPOで強化学習する(上図中の右下)。 2. 背景 従来の記号的Plannerは、状態・行動・目標を明示して探索する。その一方で、問題規模が増すと探索が難しくなり、入力形式も厳密である。LLMは自然言語や構造化テキストから柔軟に計画を生成できるが、次の失敗を起こし得る。 - 形式エラー:実行器が解釈できないActionを出力する。 - 前提条件違反:持っていない部品を置こうとするなど、現在状態では実行できないActionを選ぶ。 - 安全制約違反:タスクを達成できても、途中に禁止状態を作る。 - 目標未達成:各Actionを実行できても、最終状態が目標を満たさない。 SafeGen-LLMは、正しい計画例によるSFTと、形式検証結果を報酬にしたGRPOを組み合わせ、LLMが安全なAction Sequenceを生成する確率を高める。 3. Task Planningの定式化とPDDL3 3.1 状態、Action、目標、安全制約 論文では、ロボットの計画問題を次の組で表す。 \mathcal{P}=(\mathcal{S},\mathcal{A},s_0,G,\mathcal{C}) - $\mathcal{S}$:状態空間 - $\mathcal{A}$:実行可能な行動の集合 - $s_0$:初期状態 - $G$:達成すべき目標条件 - $\mathcal{C}$:安全制約の集合 Action Sequenceを次のように表す。 \pi=[a_1,a_2,\ldots,a_n] これを実行すると、$s_0\rightarrow s_1\rightarrow\cdots\rightarrow s_n$ という状態遷移が生じる。安全な計画には、目標達成と安全制約の双方が必要である。 \text{find }\pi\quad\text{s.t.}\quad s_n\models G\ \land\ \pi\models\mathcal{C} $\models$ は「満たす」を意味する。 $s_n\models G$ は最終状態が目標を満たすこと、$\pi\models\mathcal{C}$ は行動列全体が安全制約を満たすことである。つまり、ゴールさえ達成すれば途中経過は問わない、という計画ではない。 3.2 PDDL3で安全制約を記述する PDDL(Planning Domain Definition Language)では、行動の前提条件(Precondition)と、その行動による状態変化(Effect)を記述する。PDDL3は、計画全体に対する時間的制約も表現できる。 例えば、壊れやすいブロックの上に他のブロックを置かないという制約は、概念的に次のようになる。 (:constraints (always (forall (?x - fragile-block ?y - block) (not (on ?y ?x))))) ここで always は全状態で条件を満たすことを意味する。Appendix Dには sometime-before、always、at-most-once などを用いた各ドメインの具体例が掲載されている。 4. 学習用データセットの生成 SafeGen-LLMは、実ロボットを繰り返し動かして教師データを集めるのではなく、記号的な計画問題を生成し、既存PlannerとValidatorで正解を作る。 論文のデータ作成手順は次の通りである。 1. PDDL2の問題生成器で計画問題を作成し、同型・重複に近い問題を除外する。 2. 問題にドメイン固有の安全制約を加え、PDDL3として表現する。 3. OPTICで制約付きの計画を探索する。 4. VALで前提条件・目標・安全制約を検証し、成功した計画だけを残す。 5. 入力(Domain/Problem/Constraints)と正解のAction Sequenceのペアに変換する。 !スクリーンショット 2026-11-04 1.33.37.png 対象は以下の4ドメインである。 | ドメイン | タスク | 代表的な安全制約 | |---|---|---| | Blocksworld | ブロックの積み替え | 安全な積み順序 | | Ferry | フェリーで車両を輸送 | 積載・輸送順序 | | Grippers | グリッパーによる物体搬送 | 特定グリッパーの利用禁止など | | Spanner | 工具を集めてナットを締結 | 締結順序、工具室への入室制限 | 学習時の出力は、推論文章ではなくAction Sequenceのみに限定される。例えば以下のような形式である。 (pickup b1) (stack b1 b2) (pickup b3) (stack b3 b0) 5. SFTによる計画形式・行動規則の学習 最初の学習段階は、検証済みの正解計画を模倣するSupervised Fine-Tuning(SFT)である。以下のように \mathcal{L}_{\mathrm{SFT}}(\theta) =-\mathbb{E}_{(x,y)\sim\mathcal{D}_{\mathrm{SFT}}} \left[\log\pi_\theta(y\mid x)\right] データの各問題・制約に対して作成した正解の対数尤度を最大化させる。 $x$ :問題・制約を含む入力 $y$ :正解Action Sequence $\pi_\theta$ :LLMの生成確率分布 実際にはLLMはそれまでの自信の出力トークン $y_{<t}$ を入力として次のトークン $y_t$ を出力しているので、 \mathcal{L}_{\mathrm{SFT}}(\theta) =-\mathbb{E}_{(x,y)\sim\mathcal{D}_{\mathrm{SFT}}} \left[\sum_{t=1}^{T}\log\pi_\theta(y_t\mid x,y_{<t})\right] となる。 SFTの役割は、Actionの書式、利用可能な物体・行動、前提条件、制約に沿う典型的な計画を学習させることである。ただし、SFTだけでは「教師例と異なるが正しい計画」を直接評価することが難しい。 6. GRPOによる安全性の強化学習 6.1 何を生成し、どこから報酬を得るのか SFT済みモデルに同じ問題 $x$ を与え、複数のAction Sequenceを確率的にサンプリングする。 y_1,\ldots,y_K\sim\pi_\theta(\cdot\mid x) これらの候補を VALによる形式検証 で採点する。VLAで行動を実行して報酬を得るわけではない。モデル自身の生成結果を評価するのでOn-policyだが、報酬計算には環境ロールアウトを必要としない。 論文Appendix Aでは、1入力あたり$K=8$候補、Sampling Temperatureは$0.6$としている。 6.2 5段階のReward 論文のRewardは、計画失敗の原因を5つに分類する。 | 分類 | 内容 | 報酬範囲 | |---|---|---:| | $c_1$ | 出力形式エラー | −1.0 | | $c_2$ | 安全制約違反 | −0.9〜−0.6 | | $c_3$ | 行動の前提条件違反 | −0.6〜−0.3 | | $c_4$ | 目標未達成 | −0.4〜−0.1 | | $c_5$ | 安全に目標達成 | +1.0 | 安全違反は、前提条件違反や目標未達成よりも低い報酬となる。単純な正誤判定ではなく、失敗の種類の優先順位を明示している点が重要である。 !スクリーンショット 2026-11-04 1.44.46.png !スクリーンショット 2026-11-04 1.42.44.png 成功と形式エラーは固定報酬であり、中間の3カテゴリでは進捗に応じて報酬を補間する(論文式(8))。 r(x,y)=r_k^-+(r_k^+-r_k^-)\,\rho_k(x,y) \qquad (k\in\{2,3,4\}) 進捗の定義は失敗カテゴリによって異なる(論文式(9))。 \rho_k(x,y)= \begin{cases} \dfrac{t_v}{L_{\mathrm{ref}}}, & k\in\{2,3\}\\[6pt] \dfrac{n_{\mathrm{sat}}}{n_{\mathrm{total}}}, & k=4 \end{cases} - $t_v$:初めて安全制約・前提条件に違反したステップ - $L_{\mathrm{ref}}$:正解計画の長さ - $n_{\mathrm{sat}}/n_{\mathrm{total}}$:達成したGoal述語の割合 例えば正解の長さが10で、4番目のActionで初めて安全制約違反が発生した場合、進捗は$4/10=0.4$である。安全違反の報酬区間を使うと次のようになる。 r=-0.9+\bigl(-0.6-(-0.9)\bigr)\times0.4 =-0.78 同じ種類の違反でも、より長く妥当な行動を続けた候補には相対的に高い報酬が与えられる。なお、基準に生成計画の長さではなく正解計画の長さを使うのは、短い計画を生成して進捗率だけを高める操作を抑えるためである。 6.3 GRPOのAdvantageとPolicy更新 GRPOでは、同じ問題から生成した$K$候補の報酬を比較する。論文式(5)のAdvantageは次の通りである。 A_i=r(x,y_i)-\frac{1}{K}\sum_{j=1}^{K}r(x,y_j) 報酬がグループ平均より高い候補は$A_i>0$、低い候補は$A_i<0$となる。論文式(6)の簡略化された目的関数は以下。 \mathcal{L}_{\mathrm{GRPO}}(\theta) =\mathbb{E}_{x,\,y_i\sim\pi_\theta} \left[A_i\log\pi_\theta(y_i\mid x)\right] つまり、このadvantageを加味した対数尤度を最大化させる。 7. Curriculum Learning:難しい問題を段階的に増やす 著者らはGRPOの学習を安定させるため、問題の構造的な難易度からEasy・Medium・Hardを作り、学習が進むにつれてHardの割合を増やしている。 Blocksworldでは、ブロック数$n$に対して難易度を$d=n^2$と定義する。他ドメインでも、車両数・部屋数・物体数などを用いる。 | GRPOの進行段階 | Easy | Medium | Hard | |---|---:|---:|---:| | 前半(0〜30%) | 70% | 25% | 5% | | 中盤(30〜70%) | 40% | 40% | 20% | | 後半(70〜100%) | 20% | 40% | 40% | また、4ドメインから均等に問題を取り出すDomain-balanced batchingを利用し、特定分野への偏りを抑える。 8. 実験結果 8.1 SFTとGRPOの効果 Qwen3-14Bの実験結果(論文Table II)は以下である。成功率は、目標達成と安全制約充足の両方を満たした割合である。 !スクリーンショット 2026-11-04 1.48.32.png SFTによって、まず形式と基本的な行動規則を学習し、GRPOによってさらに計画成功率が改善している。Llama-8Bでも、SFT後の50〜92%からGRPO後の78〜94%に改善している。Qwen3-14BのGRPO後の安全制約違反率は各ドメインで0〜2%と報告されている。 8.2 入力形式を変えた場合 Qwen3-14Bの学習後モデルに対し、入力をPDDL3、自然言語、JSONに変換したときの平均成功率は次の通りである。 !スクリーンショット 2026-11-04 1.50.13.png 学習時のPDDL3形式から別の表現へ一定程度汎化している。ただし、自然言語では11.5ポイント低下しており、表現形式の差は依然として課題である。 8.3 実機検証 著者らはBlocksworldを対象に、Elephant RoboticsのmyCobot 280を用いた実機デモも報告している。安全制約を考慮しない例では積み替え中に衝突が発生し、SafeGen-LLMの計画ではその衝突を回避できた。 !スクリーンショット 2026-11-04 1.52.10.png ただし、実機評価は限定された設定のデモであり、多様な産業設備・未知の幾何形状への一般化を示すものではない。 9. 論文の位置付けと限界 SafeGen-LLMの要点は、安全制約を文章でプロンプトに書くだけでなく、検証結果を報酬としてLLMの重みに反映することである。正解Action Sequenceとの文字列一致を評価する方式と違い、Expertと異なる行動順序でも、目標と安全条件を満たせば高い評価を与えられる。 一方、次の制限がある。 - 形式モデルへの依存:PDDL3の前提条件・Effect・制約が現実を十分に表していなければ、検証が通っても実環境で安全とは限らない。 - 知覚との分離:カメラ・LiDARから状態や制約を推定する部分は、本研究の主な対象ではない。 - 幾何的な実行可能性:衝突判定、到達可能性、把持力、制御誤差などの評価は別途必要である。 - 学習規模と再現性:論文は主に記号的ベンチマークで評価し、公式コード・データ一式の公開は少なくとも本稿作成時点で確認できない。また本文と付録には学習用データ分割の記述差がある。 Physical AIへ展開するなら、センサー情報→Scene Graph/状態表現→LLM Planner→PDDLやシミュレータによる検証、という構成が自然である。ただし、これらは本論文で実証された構成ではなく、今後の研究に向けた拡張案である。 10. Gemma 4 E2BでSFT→GRPOを試した実装 本論文の公式コードは公開されてないので、簡単な実装デモを作成した。今回のデモは、既存のGemma 4 E2Bの4bit量子化+LoRA学習環境に、Blocksworld用のデータ生成、Reward関数、GRPO学習を追加したものである。 10.1 論文と実装の違い | 項目 | 論文 | 今回のPoC | |---|---|---| | モデル | Mistral-7B、Llama-8B、Qwen3-14B | google/gemma-4-E2B-it | | 対象ドメイン | Blocksworld等の4領域 | Blocksworldのみ | | データ生成 | PDDL問題生成+OPTIC | Pythonで問題生成+BFS | | 検証・Reward | PDDL3+VAL | Python製の状態遷移検証器 | | SFT/GRPO | LoRA/QLoRA+GRPO | 4bit QLoRA+TRL GRPO | | データ数 | 論文Appendix C:学習2,000、テスト200 | 学習80、テスト16(既定) | | GRPO候補数 | 8 | 4(初期設定) | | GPU | H100 80GB | RTX 3090 24GBを想定 | したがって、これは論文の完全再現ではなく、SFT→Reward→GRPOの仕組みを検証するミニ実装である。 10.2 追加した主要ファイル src/ make_safegen_dataset.py # JSONLデータ生成 safegen_blocks.py # Blocksworld状態遷移・BFS・計画採点 safegen_reward.py # GRPOに渡すReward関数 train_sft_safegen.py # SFT train_grpo_safegen.py # GRPO evaluate_safegen.py # SFT/GRPOモデルの評価 Dockerfile.safegen # 学習用Docker環境 tests/test_reward.py # 報酬のユニットテスト make_safegen_dataset.py は同じ問題について2つの形式を作成する。SFT用は入力と正解計画を含む prompt / completion、GRPO用は prompt / problem_json である。後者の problem_json はモデルへの入力ではなく、Reward計算用の状態・目標・制約情報である。 SFTでは、completion_only_loss=True を指定して正解Action Sequenceに対するクロスエントロピーを最小化する。モデル本体は4bit量子化し、言語モデル側のLoRAアダプタを更新する。Gemma 4の言語モデルへのLoRA適用は、PEFTのtarget_modulesを明示する必要がある場合がある。 10.3 Reward関数 src/safegen_reward.py では、TRLの GRPOTrainer が生成した応答を取り出し、Blocksworldの検証器へ渡す。 import json from safegen_blocks import grade_plan from safegen_reward import completion_to_text # 学習時のReward関数の主要部分を抜粋。 def safegen_reward(completions, problem_json, **kwargs): rewards = [] for output, problem in zip(completions, problem_json): spec = json.loads(problem) plan_text = completion_to_text(output) result = grade_plan(plan_text, spec) rewards.append(float(result.reward)) return rewards grade_plan() は、出力書式→前提条件→安全制約→目標達成の順でAction Sequenceを確認し、論文と同じ5種類の報酬区間を返す。ただし、検証器は一般のPDDL3/VALではなく、4ブロックを対象にした簡易な記号的シミュレータである。 GRPOで利用する主な設定は、num_generations=4、temperature=0.6、beta=0.01、scale_rewards=False などである。scale_rewards=False は、論文の式(5)のように平均を引く相対Advantageに近づけるための設定である。実際の損失計算や正規化の細部はTRLのバージョンに依存する。 10.4 実行コマンド リポジトリのルートを /workspace にマウントした学習用Dockerコンテナ内で実行する例を示す。 # データ生成と報酬の単体テスト python3 src/make_safegen_dataset.py --out-dir /workspace/data python3 -m unittest discover -s tests -v # Stage I:SFT python3 src/train_sft_safegen.py # Stage II:GRPO(まず少数ステップで動作確認) python3 src/train_grpo_safegen.py --steps 5 --generations 4 SFTとGRPOで保存されるLoRAアダプタはそれぞれ次のディレクトリである。 outputs/gemma4-e2b-safegen-sft/ outputs/gemma4-e2b-safegen-grpo/ 実装途中では、AutoProcessor がオフライン環境で前処理設定を読み込めない問題、PEFTがGemma 4のLoRA挿入先を自動認識できない問題、TRLが古いPyTorchのFSDP APIに依存して失敗する問題が発生した。今回のテキスト専用タスクでは AutoTokenizer を利用し、LoRAの target_modules を言語モデル側に限定し、PyTorchとTRLの互換バージョンを揃えることで学習を進めた。再現時は pip freeze で正常動作したバージョンを保存しておくことが重要である。 学習後は同じテスト問題を用いて、次のように比較する。 python3 src/evaluate_safegen.py \ --adapter /workspace/outputs/gemma4-e2b-safegen-sft python3 src/evaluate_safegen.py \ --adapter /workspace/outputs/gemma4-e2b-safegen-grpo 評価指標はタスク成功率だけでなく、安全制約違反、前提条件違反、目標未達成、形式エラーの比率を含めるべきである。今回は学習80問題、評価16問題という小規模なPoCであり、改善が観測されても、汎化性能については複数Seedや難易度を変えた評価が必要である。 10.5 今後の拡張 次の段階では、今回のPython検証器を論文と同じPDDL3+VALに置き換えることが考えられる。その後、Isaac Sim等で幾何的な実行可能性を評価することで、記号的な安全性と物理的な制約を組み合わせたTask Planningへ拡張できる。 11. まとめ - SafeGen-LLMは、LLMが生成したAction Sequenceを形式検証で採点し、その報酬をGRPOの学習信号として使う研究である。SFTは計画の書式と基本的な行動規則を学習し、GRPOは安全制約を重視するよう生成方策を改善する - ORBITなどと同様に、計画のRewardを計算するためにVLAや実機を毎回動かす必要がない 参考資料 - SafeGen-LLM: Enhancing Safety Generalization in Task Planning for Robotic Systems(原論文) - 原論文PDF - TRL:GRPOTrainer - Hugging Face PEFT - Unsloth公式GitHub

  2. New Unsloth Desktop update! Unsloth now has Glass themes and more customization options for backgrounds, greetings and chats. We also enabled full CPU training (optimized as well!) and make diffusion, inference, training all faster! github.com/unslothai/unsloth/releases/tag/v0.1.91… t.co

    75 likes · 13 reposts · 3,786 views
  3. Reddit · · r/LocalLLaMA · u/danielhanchen · unslothai/unsloth

    Introducing DeepSeek-V4.1-Flash-1017 Dynamic v3.1 Unsloth GGUFs Hey everyone! We’re releasing new DeepSeek-V4.1-1017 Dynamic V3.1 (preview) GGUFs which showcases how Unsloth’s GGUFs retain the most accuracy for its size across 7 different benchmarks. We benchmarked ISTA's GSQ-RCO GGUFs but could not reproduce their reported results, even when using the highest scores. The biggest discrepancy was on AIME25 where they claimed 100% accuracy recovery to baseline, but was only ~91.88% in benchmark tests. Across AIME25, LiveCodeBench, GPQA Diamond, Aider Polyglot, and more, Unsloth Dynamic V3.1 outperforms GSQ-RCO GGUFs on nearly all metrics. Even our old v3 does better on nearly all metrics than ISTA. We ran each benchmark at least 3 times (AIME25 was 16 times) and averaged the results to ensure a fair, reliable comparison. More results coming next week! All benchmark data, methodologies and results are in our blog. Separately, for KLD, there were queries whether it’s a reliable measure of accuracy. The primary goal of quantization is to minimize KLD but also minimize disk space. If you get a KLD of 0, this means your quantized model == 16bit model, as logits are perfectly modelled. Our benchmarks show on KLD and top-1% across multiple domains (coding, agentic coding, chat etc), UDv3.1 does much better than GSQ-RCO across every domain. We show that lower bit quants do think somewhat longer than the unquantized model - we plan to investigate and make quants even better. However, we're still much ahead vs GSQ-RCO on even reasoning length as well, and provide plots for truncated answers in our blog. The model will be able to run on 128GB RAM/unified memory devices or even on 64GB RAM with engram offloading. Blog with all details and more benchmarks:unsloth.aiunsloth.ai GGUF:huggingface.cohuggingface.co We also introduced lots of new things to Unsloth Desktop including Browser Use, auto compaction, a whole new TTS pipeline (with voice cloning, separation etc), sandboxing, and background customization and more:unslothai/unsloth Hope you all have a Happy Halloween! Also table of numbers below which is also described with more plots and data in our blog: |Quant|Size GB|AIME25|HMMT Feb26|GPQA-D|MMLU-Pro|IFEval|LCB v6 (32K)|Avg of 6|Aider pass@1| |:-|:-|:-|:-|:-|:-|:-|:-|:-|:-| |UD-Q8_K_XL|508.4|97.08|68.94|90.47|88.61|95.10|85.90|87.68|-| |UD-Q2_K_XL|334.8|97.50|69.89|89.58|88.28|94.92|84.76|87.49|-| |UD-IQ2_XXS|300.5|96.88|67.61|88.95|87.53|95.19|83.62|86.63|44.38| |UD-IQ1_M|250.4|95.00|62.88|88.38|87.53|95.10|84.38|85.55|42.13| |UD-IQ1_S|233.0|92.92|57.01|87.63|86.62|94.92|82.10|83.53|36.52| |GSQ-RCO IQ2_XS|265.8|95.00|64.39|88.64|86.62|94.27|84.95|85.64|41.57| |GSQ-RCO IQ2_XXS|248.8|95.21|57.95|85.80|86.53|93.72|82.86|83.68|36.52| |GSQ-RCO IQ1_M|231.3|91.88|53.60|85.10|85.49|91.77|82.86|81.78|29.78|

    370 points · 103 comments
  4. How do you fine-tune with Unsloth on a cloud GPU? Pick the smallest GPU that fits your model in Unsloth's VRAM table, save the trainer's checkpoints to a directory that survives a restart, and run your script as a batch job with a spending cap. Nodus runs that script on an RTX 4090 listed at $0.29/hr or an H100 at $2.60/hr, and restores the checkpoint directory on a new machine if the GPU is reclaimed. A preemption then costs you minutes of training, not the whole run. We build Nodus, so weigh that. Unsloth facts below link to Unsloth's own docs, other platforms' prices link to their pricing pages, and every cost figure shows its math. What does Unsloth change about fine-tuning? Unsloth makes the same fine-tune need a much smaller GPU. Its GitHub README says it trains LLMs 2x faster with 70% less VRAM and no accuracy loss. The core package is Apache 2.0, so commercial use is fine. The memory saving matters more than the speed for your bill. By Unsloth's own table, a 14B model needs 33 GB for 16-bit LoRA but 8.5 GB with 4-bit QLoRA. That moves it from a 48 GB L40S, listed at $0.793/hr on the Nodus pricing page, to a 24 GB RTX 4090 at $0.29/hr. Unsloth plugs into Hugging Face TRL's SFTTrainer. That detail is what makes cloud runs easy to recover, because the Trainer already knows how to save and resume. Which GPU do you need for your model size? Use Unsloth's own VRAM requirements table and add headroom. Unsloth calls these numbers "the absolute minimum", and longer sequences or bigger batches need more. | Model size | QLoRA (4-bit) minimum | LoRA (16-bit) minimum | A GPU that fits QLoRA with headroom | |---|---|---|---| | 3B | 3.5 GB | 8 GB | NVIDIA L4 or RTX 4090 (24 GB) | | 8B | 6 GB | 22 GB | RTX 4090 or L4 (24 GB) | | 14B | 8.5 GB | 33 GB | RTX 4090 or L4 (24 GB) | | 32B | 26 GB | 76 GB | L40S or RTX A6000 (48 GB) | | 70B | 41 GB | 164 GB | L40S (48 GB) for short sequences, A100 80 GB or H100 for room | !Unsloth minimum VRAM by model size: QLoRA needs 3.5 GB for 3B, 6 GB for 8B, 8.5 GB for 14B, 26 GB for 32B and 41 GB for 70B; 16-bit LoRA needs 8, 22, 33, 76 and 164 GB. QLoRA keeps every model up to 70B on a single GPU; 16-bit LoRA needs an 80 GB card at 32B and several cards at 70B. Our rule: start with QLoRA on a 24 GB card for anything up to 14B. Switch to 16-bit LoRA only when you have measured a quality gap that matters to you. On Nodus you can also skip naming a GPU and set resources.gpu.minMemory in the Job spec, and Nodus picks any accelerator with at least that much memory. Is a bigger GPU ever cheaper per finished run? Yes, but only if it finishes proportionally faster. Divide the bigger card's hourly price by the smaller card's to get the speedup it must deliver just to break even. Here is that ratio against an RTX 4090 at Nodus list prices: | GPU | Listed on the Nodus pricing page | Speedup needed vs RTX 4090 | |---|---|---| | RTX 4090 (24 GB) | $0.29/hr | 1.0x | | L4 (24 GB) | $0.43/hr | 1.5x | | L40S (48 GB) | $0.793/hr | 2.7x | | A100 80 GB | $1.09/hr | 3.8x | | H100 SXM 80 GB | $2.60/hr | 9.0x | Prices checked October 28, 2026 on the Nodus pricing page. !Speedup a GPU needs over an RTX 4090 to cost the same per finished run: L4 1.5x, L40S 2.7x, A100 80 GB 3.8x, H100 9.0x. An H100 has to train 9x faster than an RTX 4090 before it saves money on the same job. We have not benchmarked Unsloth across these cards, so measure it yourself. Run 50 steps on two GPUs, compare seconds per step, and multiply by the hourly price. Unless the H100 comes close to 9x faster on your job, the cheaper card finishes it for less. Pay for the H100 when you need the result sooner or the model does not fit anywhere smaller. How do you make an Unsloth script resume after a restart? Point the Trainer's output_dir at the Nodus state directory and resume from the newest checkpoint on start. The script below is Unsloth's Llama 3.1 8B Alpaca notebook with those two changes, plus a callback that saves when Nodus asks. from unsloth import FastLanguageModel # import first so its patches apply import os from datasets import load_dataset from transformers.trainer_utils import get_last_checkpoint from trl import SFTConfig, SFTTrainer import nodus STATE = os.environ.get("NODUS_STATE_DIR", "/nodus/state") OUTPUTS = os.environ.get("NODUS_OUTPUTS_DIR", "/nodus/outputs") model, tokenizer = FastLanguageModel.from_pretrained( model_name="unsloth/Llama-3.1-8B", max_seq_length=2048, load_in_4bit=True) model = FastLanguageModel.get_peft_model( model, r=16, lora_alpha=16, lora_dropout=0, bias="none", target_modules=["q_proj", "k_proj", "v_proj", "o_proj", "gate_proj", "up_proj", "down_proj"], use_gradient_checkpointing="unsloth", random_state=3407) prompt = "### Instruction:\n{}\n\n### Input:\n{}\n\n### Response:\n{}" def fmt(ex): return {"text": [prompt.format(i, x, o) + tokenizer.eos_token for i, x, o in zip(ex["instruction"], ex["input"], ex["output"])]} dataset = load_dataset("unsloth/alpaca-cleaned", split="train").map(fmt, batched=True) trainer = SFTTrainer( model=model, tokenizer=tokenizer, train_dataset=dataset, dataset_text_field="text", max_seq_length=2048, callbacks=[nodus.checkpoint.HFTrainerCallback()], args=SFTConfig( output_dir=STATE, save_steps=200, save_total_limit=2, per_device_train_batch_size=2, gradient_accumulation_steps=4, num_train_epochs=1, learning_rate=2e-4, warmup_steps=5, optim="adamw_8bit", logging_steps=10, seed=3407, report_to="none")) last = get_last_checkpoint(STATE) if os.path.isdir(STATE) else None trainer.train(resume_from_checkpoint=last) model.save_pretrained(f"{OUTPUTS}/lora-adapter") tokenizer.save_pretrained(f"{OUTPUTS}/lora-adapter") Three lines do the recovery work. output_dir=STATE puts Trainer's checkpoints where Nodus snapshots them. get_last_checkpoint finds the newest checkpoint-N folder after a restore, and stays None on a first start. HFTrainerCallback comes from the Nodus SDK and makes Trainer save at the end of the current step when Nodus asks, including when the capacity gives notice that it is about to be reclaimed. Outside Nodus the SDK calls do nothing, so the same file runs on your laptop or in Colab. save_total_limit=2 keeps the directory small. With QLoRA each checkpoint holds the adapter and optimizer state, not a copy of the 8B base model. How do you launch it as a Nodus Job? Install the CLI, sign in, and run from the folder that holds train.py. These flags come from the Nodus checkpoints guide and the nodus run reference: $ pip install nodus-compute $ nodus login $ nodus run --name unsloth-llama8b --gpu L4 --image nodus/pytorch \ --checkpoint /nodus/state --interruptible \ --max-cost 10 --timeout 24h -d \ -- sh -c "pip install unsloth nodus-compute && python train.py" $ nodus logs -f job/unsloth-llama8b $ nodus cp job/unsloth-llama8b:outputs/lora-adapter/adapter_model.safetensors . An L4 fits this 8B QLoRA run with room to spare; nodus get gpus lists the other types and their current rates, including the RTX 4090. --interruptible lets Nodus use interruptible capacity, which is exactly the case the checkpoint setup covers. Add --dry-run first to see the cost estimate without starting anything. --max-cost 10 is a cap, not a quote: at the cap the Job saves its state and suspends until you raise it. Everything under /nodus/outputs is collected when the Job succeeds, so copy adapter_config.json the same way. Installing Unsloth at start adds install time to every attempt, including restored ones. For repeat runs, pin the versions, push your own image to a registry and pass it to --image. What does a preemption cost with and without checkpoints? Say a 10-hour QLoRA run on one H100 is reclaimed at hour 6. At $2.60/hr the whole run costs $26.00. Without checkpoints you start over and pay the first 6 hours twice, an extra $15.60. With save_steps set so Trainer saves about every 30 minutes, the most you redo is 30 minutes, or $1.30. The Nodus callback usually shrinks that further, because Nodus asks for a save when the capacity gives notice. The checkpointing comparison covers which other platforms restore a run like this for you. What does the same run cost on other platforms? At list prices, 10 hours on one H100 SXM is cheapest on Nodus, with RunPod's Community Cloud close behind: | Platform | H100 SXM hourly rate | 10 hours | |---|---|---| | Nodus | $2.60/hr | $26.00 | | RunPod Community Cloud | $2.69/hr | $26.90 | | Modal | $3.949/hr | $39.49 | | RunPod Secure Cloud | $3.99/hr | $39.90 | Prices checked October 28, 2026: Nodus pricing page, RunPod pricing, Modal pricing. !Cost of 10 hours on one H100 SXM: Nodus $26.00, RunPod Community Cloud $26.90, Modal $39.49, RunPod Secure Cloud $39.90. The rate gap is small next to the GPU choice: the same 10 hours on an RTX 4090 at $0.29/hr is $2.90. The hourly rate is only part of it. A RunPod Pod gives you a machine where you run and restart the script yourself. Modal restarts a preempted function on the same input and asks you to add your own checkpoints. If you already work in either, Unsloth runs there too, and the script above works there apart from the state path and the Nodus callback. When is Colab or your own GPU enough? For learning Unsloth and short experiments, start in Google Colab. Unsloth's README links a free Colab notebook for each of its featured models. The catch is that Colab's FAQ says free resources are not guaranteed, idle VMs are deleted, and lifetimes and GPU types vary over time. A 24 GB card you already own is enough for QLoRA up to 14B by Unsloth's table. It costs nothing per hour and your data never leaves the machine. Move to a cloud job when the run has to finish overnight without you watching it, when the model outgrows your card, or when you want several runs at once. If you would rather not maintain a training script, the managed nodus/sft runtime in Nodus Training (Beta) does full, LoRA or QLoRA fine-tuning from a JSONL file. It is not Unsloth, so you give up Unsloth's kernels for less code. FAQ Does Unsloth work on multiple GPUs? Unsloth's README says it supports multi-GPU setups. For most QLoRA jobs up to 70B, one GPU is enough by its own VRAM table, and a single card avoids the communication overhead entirely. Do I need a Hugging Face token? Only for gated models. Unsloth publishes copies of many open models under its Hugging Face organization. For a gated one, store your token as a Nodus Secret and pass it with --secret. Can I use Unsloth's Docker image instead of pip? Unsloth publishes an official Docker image, unsloth/unsloth, built mainly for running Jupyter and Unsloth Studio locally. Nodus runs prebuilt public registry images, but test the image's startup command before a long run. How do I keep a large dataset from uploading on every run? Put it in a Nodus Volume once with nodus volume put, then mount it with --volume NAME:/data:ro. Only the code folder uploads with each run. What do I do with the adapter afterwards? Load it back with FastLanguageModel.from_pretrained pointed at the adapter folder, or merge it into 16-bit weights with Unsloth's save_pretrained_merged. The VRAM guide covers what serving the merged model needs. Originally published on the Nodus blog.

  5. Your local LLM can now take control of a browser and complete tasks autonomously via Unsloth! Qwen3.8-27B successfully controlled the browser to complete tasks like chess, painting, with no human intervention. GitHub: unslothai/unsloth Guide: unsloth.ai

    38 likes · 1 repost
  6. Reddit · · r/unsloth · u/yoracale · unslothai/unsloth

    Local models can now perform Browser Use in Unsloth! Hey guys, your local LLM can now take control of a browser & complete tasks autonomously via Unsloth. Yes, its full browser use so your model can control your browser to search, click things and do stuff. Qwen3.8-27B successfully completed a wide range of tasks, including chess, painting, pool and more with no human intervention. We improved the usability and workflow of the browser use since a week ago. Try Browser Use now via Unsloth Desktop on Windows, Mac and Linux! Also new Halloween release today so be sure to update Unsloth! Btw for those unaware, yes browser use for local LLMs was always possible, however what makes Unsloth's extra special is that it particularly works well for small or medium sized local models like Qwen3.8-27B or even smaller like Gemma 4 E4B where otherwise, using something else would cause it to loop, cancel abruptly etc. This implementation is integrated with all of Unsloth's self healing toolcalls, looping prevention etc GitHub: unslothai/unsloth Guide: unsloth.ai

    248 points · 24 comments
  7. Your local LLM can now take control of a browser and complete tasks autonomously via Unsloth! Qwen3.8-27B successfully controlled the browser to complete tasks like chess, painting, with no human intervention. GitHub: unslothai/unsloth Guide: unsloth.ai t.co

    475 likes · 45 reposts · 17,688 views
  8. YouTube · · YouTube description · Chloe Starr · unslothai/unsloth

    Who gets to build the next internet? | Open Source AI Awards Who gets to build the next internet? A field film from the Open Source AI Awards at Founders Inc., Fort Mason, October 23, 2026. Article, photographs and links to the projects: chloestarr.me A room full of builders, a flying shirt, and a question that lasts beyond the prizes: who gets to participate when agents start choosing what people see? Featuring the work discussed by Matt White, Ian Ballantyne, the Google AI Edge team, Daniel Han, Alex Newman, Peter Walker and Irene Solaiman. Alex's advice about editing with sound waveforms travelled from an earlier event at Pebblebed into making this film. PROJECTS TO TRY Alex Newman / Claude-Mem: thedotmack/claude-mem Matt White / Model Openness Framework: isitopen.ai Gemma: deepmind.google Google AI Edge: ai.google.dev Daniel Han / Unsloth: unslothai/unsloth Peter Walker / OpenRouter: openrouter.ai Irene Solaiman: irenesolaiman.com Hugging Face investigation: huggingface.co CREDITS AND SOURCE CONTEXT A film by Chloe Starr. Direction, narration and edit decisions: Chloe Starr. Original event recordings supplied by Chloe Starr, with Chris Starr AI: x.com Local assembly: Codex, Python and FFmpeg. Waveform-editing advice: Alex Newman, conversation at Pebblebed's October 17 gathering. The flashback is from that earlier visit, not footage of the advice exchange. Alex and Claude-Mem did not generate or render this film. Music: Sweet You by Loyalty Freak Music, from MELODIES WITH A BEAT. CC0. Excerpt edited with scene shaping and dialogue ducking. Published work appears separately from original event footage: Claude-Mem repository animation: thedotmack/claude-mem Google Developers application demo: developers.googleblog.com OpenRouter chart and analysis: openrouter.ai The agentic token-use comparison is specifically on OpenRouter, not a measurement of all internet traffic. Hugging Face security team's published investigation and replay: huggingface.co The wider campaign lasted 4.5 days; the replay is a published reconstruction, not live awards-night footage. The investigation was team work. Personalities and attendee photographs, editorial excerpts: Ian Ballantyne's October 6 cat-meow search post: x.com Daniel Han's October 21 sloth-game post: x.com Irene Solaiman's March 17 community post and illustration: x.com Jason / @jasonjias, event photograph: x.com Jason's gift-card photograph and prize post: x.com Organizer's Best OSAI Week Post contest: x.com Jason reports winning a $100 Apple gift card; the exact contest-winning photo and prize category are not confirmed. Official program, hosts and supporters: opensourceaiweek.com The Google AI Edge guest is credited by team because the individual identity has not been confirmed. Alex's award is based on Chloe's account; its category is not asserted. More films and writing: chloestarr.me #OpenSourceAIWeek #OpenIntelligence

    36 views
  9. Unsloth + Ollama: Fine-Tune and Run Local LLMs Unsloth + Ollama: Fine-Tune Open-Source LLMs 2x Faster and Run Them Locally Stop burning thousands of dollars on cloud LLM API tokens. Fine-tuning an 8B parameter model no longer requires a cluster of enterprise A100 GPUs or endless cloud compute budgets. By pairing Unsloth with Ollama, you can perform QLoRA local fine tuning on a consumer GPU using under 8GB of VRAM, convert the model directly to GGUF format, and serve it on your local machine with a single CLI command. Here is how to set up the entire end-to-end pipeline in under 30 minutes. --- Why Unsloth + Ollama? Standard Hugging Face pipelines often encounter CUDA Out-Of-Memory (OOM) crashes on 16GB or 24GB GPUs when training 8B parameter models. Unsloth rewrites PyTorch attention layers and cross-entropy loss functions into hand-crafted OpenAI Triton kernels. This optimization yields concrete advantages: - 2x Faster Training: Bypasses PyTorch autograd overhead. - 70% to 80% Less VRAM: Train Llama 3 8B or Mistral 7B in 6.6GB to 8GB VRAM with QLoRA. - Zero Conversion Overhead: Exports directly to quantized GGUF format and auto-generates the Ollama Modelfile. - Zero API Bills: Serve your proprietary tuned model locally on macOS, Linux, or Windows via Ollama. --- Where to Get It (Official Links, GitHub & Hugging Face) Before starting, bookmark and pull resources from the official repositories: - Unsloth GitHub Repository: unslothai/unsloth — Core training framework and Triton kernels. - Unsloth Official Documentation: unsloth.ai — Setup guides, memory benchmarks, and architecture details. - Unsloth Hugging Face Hub: huggingface.co — Official 4-bit pre-quantized base models (Llama 3, Mistral, Qwen, Gemma). - Ollama Download: ollama.com — Standalone installers for macOS, Linux, and Windows. - Ollama GitHub Repository: ollama/ollama — Open-source local runtime repository. --- Quick Install & Setup Set up Ollama and an isolated Python virtual environment on your Linux/WSL2 system with CUDA installed. 1. Install Ollama Runtime curl -fsSL https://ollama.com/install.sh | sh 2. Configure Python Virtual Environment Create a dedicated environment and install Unsloth alongside PyTorch dependencies: python3 -m venv finetune-env source finetune-env/bin/activate pip install --upgrade pip pip install 'unsloth[colab-new] @ git+https://github.com/unslothai/unsloth.git' pip install --no-deps trl peft accelerate bitsandbytes datasets --- How to Use It in Real Life (Step-by-Step Walkthrough) In this walkthrough, we will fine-tune Llama 3 8B Instruct on a customer support dataset, export it to GGUF, and query it locally via Ollama. Step 1: Initialize Model and Adapters Create a training script named train.py. Load the pre-quantized 4-bit model directly from Hugging Face and inject LoRA parameters: import torch from unsloth import FastLanguageModel from datasets import load_dataset from trl import SFTTrainer from transformers import TrainingArguments max_seq_length = 2048 dtype = None # Auto-detect Float16 / Bfloat16 load_in_4bit = True # 1. Load 4-bit base model model, tokenizer = FastLanguageModel.from_pretrained( model_name = 'unsloth/llama-3-8b-Instruct-bnb-4bit', max_seq_length = max_seq_length, dtype = dtype, load_in_4bit = load_in_4bit, ) # 2. Attach LoRA adapters model = FastLanguageModel.get_peft_model( model, r = 16, target_modules = ['q_proj', 'k_proj', 'v_proj', 'o_proj', 'gate_proj', 'up_proj', 'down_proj'], lora_alpha = 16, lora_dropout = 0, bias = 'none', use_gradient_checkpointing = 'unsloth', random_state = 3407, ) Step 2: Format Data and Train Train on instruction-response pairs using SFTTrainer for 60 steps: # 3. Format dataset using Llama 3 template prompt_template = '''<|start_header_id|>system<|end_header_id|> You are a specialized internal support bot.<|eot_id|><|start_header_id|>user<|end_header_id|> {}<|eot_id|><|start_header_id|>assistant<|end_header_id|> {}<|eot_id|>''' def formatting_prompts_func(examples): texts = [] for instruction, output in zip(examples['instruction'], examples['output']): text = prompt_template.format(instruction, output) texts.append(text) return {'text': texts} dataset = load_dataset('philschmid/dolly-15k-oai-style', split='train[:1000]') dataset = dataset.map(formatting_prompts_func, batched=True) trainer = SFTTrainer( model = model, tokenizer = tokenizer, train_dataset = dataset, dataset_text_field = 'text', max_seq_length = max_seq_length, dataset_num_proc = 2, packing = False, args = TrainingArguments( per_device_train_batch_size = 2, gradient_accumulation_steps = 4, warmup_steps = 5, max_steps = 60, learning_rate = 2e-4, fp16 = not torch.cuda.is_bf16_supported(), bf16 = torch.cuda.is_bf16_supported(), logging_steps = 10, optim = 'adamw_8bit', weight_decay = 0.01, lr_scheduler_type = 'linear', seed = 3407, output_dir = 'outputs', ), ) trainer.train() Step 3: Export to GGUF and Ollama Unsloth eliminates manual llama.cpp compilation. Export directly to 4-bit Medium Quantization (q4_k_m) at the end of train.py: # 4. Export directly to GGUF model.save_pretrained_gguf('custom_model', tokenizer, quantization_method = 'q4_k_m') Run the training file: python train.py This writes the quantized GGUF weights and an automatically configured Modelfile into the ./custom_model directory. Step 4: Register and Run in Ollama Point Ollama to the generated folder and launch the model: # 5. Build and serve inside Ollama ollama create my-assistant -f ./custom_model/Modelfile ollama run my-assistant Example Interaction: >>> How do I reset my company VPN token? To reset your company VPN token: 1. Open the Okta Verify dashboard on your mobile device. 2. Navigate to Settings > Enrolled Factors > VPN Gateway. 3. Click 'Regenerate Token' and confirm your biometric prompt. Your new session token will be active within 60 seconds. --- Key Takeaways Combining Unsloth and Ollama creates a self-contained local fine-tuning workflow: train locally in 15–30 minutes, eliminate external API dependencies, and keep all proprietary data within your own infrastructure.

  10. 8. Unsloth + Ollama = fine-tune + self-host open LLMs on consumer GPUs. Cut VRAM 70-80%. Train 2x faster. Kill cloud API costs. Start: unslothai/unsloth | ollama.com #AI #LLMs #OpenSource #LocalAI

Trending awards, every completed day and week
Gold
01st place finishes
Silver
02nd place finishes
Bronze
13rd place finishes
Awarded repositories
1Owned by unslothai now

Repositories

Ordered by gold, then silver, then bronze.

  1. unslothBest: 3rd by stars, 1,250 stars001

Every award

Top-three finishes of these repositories in completed trending days and weeks, newest first.

  1. #3 by starsDaily trending
    1,250 stars
    unsloth

A repository earns an award for finishing first, second or third in a completed trending day or week, ranked by new stars, new forks or pull request authors. Awards follow a repository through renames and transfers and count toward its current owner. Weeks run Monday to Sunday, UTC.