{"id":1779,"date":"2026-08-19T13:07:43","date_gmt":"2026-08-19T13:07:43","guid":{"rendered":"https:\/\/blog.openzeka.com\/en\/?p=1779"},"modified":"2026-08-19T13:07:43","modified_gmt":"2026-08-19T13:07:43","slug":"local-model-fine-tuning-with-unsloth-on-dgx-spark","status":"publish","type":"post","link":"https:\/\/blog.openzeka.com\/en\/local-model-fine-tuning-with-unsloth-on-dgx-spark\/","title":{"rendered":"Local Model Fine-Tuning with Unsloth on DGX Spark"},"content":{"rendered":"<p><div class=\"fusion-fullwidth fullwidth-box fusion-builder-row-1 fusion-flex-container has-pattern-background has-mask-background nonhundred-percent-fullwidth non-hundred-percent-height-scrolling\" style=\"--awb-border-radius-top-left:0px;--awb-border-radius-top-right:0px;--awb-border-radius-bottom-right:0px;--awb-border-radius-bottom-left:0px;--awb-flex-wrap:wrap;\" ><div class=\"fusion-builder-row fusion-row fusion-flex-align-items-flex-start fusion-flex-content-wrap\" style=\"max-width:1331.2px;margin-left: calc(-4% \/ 2 );margin-right: calc(-4% \/ 2 );\"><div class=\"fusion-layout-column fusion_builder_column fusion-builder-column-0 fusion_builder_column_1_1 1_1 fusion-flex-column\" style=\"--awb-bg-size:cover;--awb-width-large:100%;--awb-margin-top-large:0px;--awb-spacing-right-large:1.92%;--awb-margin-bottom-large:20px;--awb-spacing-left-large:1.92%;--awb-width-medium:100%;--awb-order-medium:0;--awb-spacing-right-medium:1.92%;--awb-spacing-left-medium:1.92%;--awb-width-small:100%;--awb-order-small:0;--awb-spacing-right-small:1.92%;--awb-spacing-left-small:1.92%;\"><div class=\"fusion-column-wrapper fusion-column-has-shadow fusion-flex-justify-content-flex-start fusion-content-layout-column\"><div class=\"fusion-text fusion-text-1\"><p>In this tutorial, you will fine-tune a large language model on a single DGX Spark using Unsloth.<\/p>\n<p>The Spark can be used as a standalone computer by connecting a monitor and keyboard, or as a server accessed remotely from another computer. In this tutorial, we will connect to the Spark remotely, install the necessary software, and fine-tune the model.<\/p>\n<p>We will use GPT-OSS 20B (a 21-billion parameter Mixture-of-Experts model) as the model, Unsloth as the fine-tuning framework, and Reinforcement Learning (RL) as the training method. Unsloth will load the model with 4-bit quantization (QLoRA) and train only small LoRA adapters, achieving up to 70% memory savings. The training will teach the language model to play the game &#8220;2048&#8221;.<\/p>\n<p>This tutorial consists of three parts:<\/p>\n<ul>\n<li><strong>Setup:<\/strong> Building the Docker image and starting the container<\/li>\n<li><strong>Training:<\/strong> Running the notebook, loading the model, and GRPO training<\/li>\n<li><strong>Results:<\/strong> Testing the fine-tuned model and shutdown<\/li>\n<\/ul>\n<p>This tutorial is for a single Spark; fine-tuning does not require multiple Sparks.<\/p>\n<hr \/>\n<h2>Setup<\/h2>\n<h3>1. Connecting to the Spark<\/h3>\n<p>If you are connecting to the Spark remotely for the first time, you need to find its IP address. Connect a monitor and keyboard to the Spark, log in, and run the following command in the terminal:<\/p>\n<div class=\"fusion-text fusion-text-1\"><\/div>\n<\/div><style type=\"text\/css\" scopped=\"scopped\">.fusion-syntax-highlighter-1 > .CodeMirror, .fusion-syntax-highlighter-1 > .CodeMirror .CodeMirror-gutters {background-color:#000000;}<\/style><div class=\"fusion-syntax-highlighter-container fusion-syntax-highlighter-1 fusion-syntax-highlighter-theme-dark\" style=\"opacity:0;margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0px;font-size:14px;border-width:1px;border-style:solid;border-color:rgba(242,243,245,0);\"><div class=\"syntax-highlighter-copy-code\"><span class=\"syntax-highlighter-copy-code-title\" data-id=\"fusion_syntax_highlighter_1\" style=\"font-size:14px;\">Copy to Clipboard<\/span><\/div><label for=\"fusion_syntax_highlighter_1\" class=\"screen-reader-text\">Syntax Highlighter<\/label><textarea class=\"fusion-syntax-highlighter-textarea\" id=\"fusion_syntax_highlighter_1\" data-readOnly=\"nocursor\" data-lineNumbers=\"\" data-lineWrapping=\"\" data-theme=\"oceanic-next\" data-mode=\"text\/x-sh\">ip route get 1.1.1.1 | grep -oP 'src KS+'<\/textarea><\/div><div class=\"fusion-text fusion-text-3\"><p>&nbsp;<\/p>\n<p>The command returns the IP address of the Spark&#8217;s default network interface:<\/p>\n<\/div><style type=\"text\/css\" scopped=\"scopped\">.fusion-syntax-highlighter-2 > .CodeMirror, .fusion-syntax-highlighter-2 > .CodeMirror .CodeMirror-gutters {background-color:#000000;}<\/style><div class=\"fusion-syntax-highlighter-container fusion-syntax-highlighter-2 fusion-syntax-highlighter-theme-dark\" style=\"opacity:0;margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0px;font-size:14px;border-width:1px;border-style:solid;border-color:rgba(242,243,245,0);\"><div class=\"syntax-highlighter-copy-code\"><span class=\"syntax-highlighter-copy-code-title\" data-id=\"fusion_syntax_highlighter_2\" style=\"font-size:14px;\">Copy to Clipboard<\/span><\/div><label for=\"fusion_syntax_highlighter_2\" class=\"screen-reader-text\">Syntax Highlighter<\/label><textarea class=\"fusion-syntax-highlighter-textarea\" id=\"fusion_syntax_highlighter_2\" data-readOnly=\"nocursor\" data-lineNumbers=\"\" data-lineWrapping=\"\" data-theme=\"oceanic-next\" data-mode=\"text\/txt\">192.168.1.162<\/textarea><\/div><div class=\"fusion-text fusion-text-4\"><p>&nbsp;<\/p>\n<p>Note this address; you will use it in place of <code><\/code> throughout the tutorial. Alternatively, you can find the IP address by checking the NVIDIA Sync application.<\/p>\n<p>Make sure your computer is connected to the same network as the Spark. Then, open a terminal on your computer and connect to the Spark via SSH:<\/p>\n<\/div><style type=\"text\/css\" scopped=\"scopped\">.fusion-syntax-highlighter-3 > .CodeMirror, .fusion-syntax-highlighter-3 > .CodeMirror .CodeMirror-gutters {background-color:#000000;}<\/style><div class=\"fusion-syntax-highlighter-container fusion-syntax-highlighter-3 fusion-syntax-highlighter-theme-dark\" style=\"opacity:0;margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0px;font-size:14px;border-width:1px;border-style:solid;border-color:rgba(242,243,245,0);\"><div class=\"syntax-highlighter-copy-code\"><span class=\"syntax-highlighter-copy-code-title\" data-id=\"fusion_syntax_highlighter_3\" style=\"font-size:14px;\">Copy to Clipboard<\/span><\/div><label for=\"fusion_syntax_highlighter_3\" class=\"screen-reader-text\">Syntax Highlighter<\/label><textarea class=\"fusion-syntax-highlighter-textarea\" id=\"fusion_syntax_highlighter_3\" data-readOnly=\"nocursor\" data-lineNumbers=\"\" data-lineWrapping=\"\" data-theme=\"oceanic-next\" data-mode=\"text\/x-sh\">ssh nvidia@<\/textarea><\/div><div class=\"fusion-text fusion-text-5\"><p>&nbsp;<\/p>\n<p>On the first connection, you will see a fingerprint warning. Type <code>yes<\/code> and press Enter. When prompted for a password, enter the Spark&#8217;s password:<\/p>\n<\/div><style type=\"text\/css\" scopped=\"scopped\">.fusion-syntax-highlighter-4 > .CodeMirror, .fusion-syntax-highlighter-4 > .CodeMirror .CodeMirror-gutters {background-color:#000000;}<\/style><div class=\"fusion-syntax-highlighter-container fusion-syntax-highlighter-4 fusion-syntax-highlighter-theme-dark\" style=\"opacity:0;margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0px;font-size:14px;border-width:1px;border-style:solid;border-color:rgba(242,243,245,0);\"><div class=\"syntax-highlighter-copy-code\"><span class=\"syntax-highlighter-copy-code-title\" data-id=\"fusion_syntax_highlighter_4\" style=\"font-size:14px;\">Copy to Clipboard<\/span><\/div><label for=\"fusion_syntax_highlighter_4\" class=\"screen-reader-text\">Syntax Highlighter<\/label><textarea class=\"fusion-syntax-highlighter-textarea\" id=\"fusion_syntax_highlighter_4\" data-readOnly=\"nocursor\" data-lineNumbers=\"\" data-lineWrapping=\"\" data-theme=\"oceanic-next\" data-mode=\"text\/txt\">The authenticity of host &#8216;192.168.1.162 (192.168.1.162)&#8217; can&#8217;t be established.\nED25519 key fingerprint is SHA256:S6EECYc6Pw2aLoLmhblFZ0QEoeVtJP41jJ5IYsdOmMM.\nThis key is not known by any other names\nAre you sure you want to continue connecting (yes\/no\/[fingerprint])? yes\nWarning: Permanently added &#8216;192.168.1.162&#8217; (ED25519) to the list of known hosts.\nnvidia@192.168.1.162&#8217;s password:\nWelcome to NVIDIA DGX Spark Version 7.5.0 (GNU\/Linux 6.17.0-1026-nvidia aarch64)<\/p>\n<p>System information as of Fri Jul 29 12:00:00 PM UTC 2026<\/p>\n<p>System load: 1.68 Temperature: 50.0 C\nUsage of \/: 25% of 3.67TB Processes: 575\nMemory usage: 3% Users logged in: 1\nSwap usage: 7% IPv4 address for enP7s7: 192.168.1.162<\/p>\n<p>2 devices have a firmware upgrade available.\nRun `fwupdmgr get-upgrades` for more information.<\/p>\n<p>Last login: Fri Jul 29 12:00:00 2026 from 192.168.1.77<\/textarea><\/div><div class=\"fusion-text fusion-text-6\"><p>&nbsp;<\/p>\n<p>Once connected, the Spark will start accepting commands sent from this terminal. Throughout the tutorial, you will enter all commands you encounter into this terminal on your computer.<\/p>\n<hr \/>\n<h3>2. Building the Docker Image<\/h3>\n<p>Unsloth requires triton and xformers kernels specifically compiled for the GB10 Grace Blackwell Superchip. These kernels are not available in standard Docker images; therefore, we will build our own Docker image using the Dockerfile provided by Unsloth for DGX Spark.<\/p>\n<p>First, download the Dockerfile:<\/p>\n<\/div><style type=\"text\/css\" scopped=\"scopped\">.fusion-syntax-highlighter-5 > .CodeMirror, .fusion-syntax-highlighter-5 > .CodeMirror .CodeMirror-gutters {background-color:#000000;}<\/style><div class=\"fusion-syntax-highlighter-container fusion-syntax-highlighter-5 fusion-syntax-highlighter-theme-dark\" style=\"opacity:0;margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0px;font-size:14px;border-width:1px;border-style:solid;border-color:rgba(242,243,245,0);\"><div class=\"syntax-highlighter-copy-code\"><span class=\"syntax-highlighter-copy-code-title\" data-id=\"fusion_syntax_highlighter_5\" style=\"font-size:14px;\">Copy to Clipboard<\/span><\/div><label for=\"fusion_syntax_highlighter_5\" class=\"screen-reader-text\">Syntax Highlighter<\/label><textarea class=\"fusion-syntax-highlighter-textarea\" id=\"fusion_syntax_highlighter_5\" data-readOnly=\"nocursor\" data-lineNumbers=\"\" data-lineWrapping=\"\" data-theme=\"oceanic-next\" data-mode=\"text\/x-sh\">cd ~\nwget -O Dockerfile &#8220;https:\/\/raw.githubusercontent.com\/unslothai\/notebooks\/main\/Dockerfile_DGX_Spark&#8221;<\/textarea><\/div><style type=\"text\/css\" scopped=\"scopped\">.fusion-syntax-highlighter-6 > .CodeMirror, .fusion-syntax-highlighter-6 > .CodeMirror .CodeMirror-gutters {background-color:#000000;}<\/style><div class=\"fusion-syntax-highlighter-container fusion-syntax-highlighter-6 fusion-syntax-highlighter-theme-dark\" style=\"opacity:0;margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0px;font-size:14px;border-width:1px;border-style:solid;border-color:rgba(242,243,245,0);\"><div class=\"syntax-highlighter-copy-code\"><span class=\"syntax-highlighter-copy-code-title\" data-id=\"fusion_syntax_highlighter_6\" style=\"font-size:14px;\">Copy to Clipboard<\/span><\/div><label for=\"fusion_syntax_highlighter_6\" class=\"screen-reader-text\">Syntax Highlighter<\/label><textarea class=\"fusion-syntax-highlighter-textarea\" id=\"fusion_syntax_highlighter_6\" data-readOnly=\"nocursor\" data-lineNumbers=\"\" data-lineWrapping=\"\" data-theme=\"oceanic-next\" data-mode=\"text\/txt\">&#8211;2026-07-29 12:09:38&#8211; https:\/\/raw.githubusercontent.com\/unslothai\/notebooks\/main\/Dockerfile_DGX_Spark\nResolving raw.githubusercontent.com (raw.githubusercontent.com)&#8230; 185.199.109.133, 185.199.108.133, 185.199.110.133, &#8230;\nConnecting to raw.githubusercontent.com (raw.githubusercontent.com)|185.199.109.133|:443&#8230; connected.\nHTTP request sent, awaiting response&#8230; 200 OK\nLength: 1070 (1.0K) [text\/plain]\nSaving to: &#8216;Dockerfile&#8217;<\/p>\n<p>0K . 100% 249M=0s<\/p>\n<p>2026-07-29 12:09:38 (249 MB\/s) &#8211; &#8216;Dockerfile&#8217; saved [1070\/1070]<\/textarea><\/div><div class=\"fusion-text fusion-text-7\"><p>&nbsp;<\/p>\n<p>This Dockerfile includes the following:<\/p>\n<ul>\n<li><strong><code>nvcr.io\/nvidia\/pytorch:25.11-py3<\/code><\/strong>\n<ul>\n<li><strong>Version:<\/strong> NGC PyTorch 25.11<\/li>\n<li><strong>Purpose:<\/strong> Base image (PyTorch 2.10, CUDA 13.0)<\/li>\n<\/ul>\n<\/li>\n<li><strong>triton (compiled from source)<\/strong>\n<ul>\n<li><strong>Version:<\/strong> 3.4.0<\/li>\n<li><strong>Purpose:<\/strong> Attention kernels for Blackwell (SM 12.1) support<\/li>\n<\/ul>\n<\/li>\n<li><strong>xformers (compiled from source)<\/strong>\n<ul>\n<li><strong>Version:<\/strong> 0.0.33<\/li>\n<li><strong>Purpose:<\/strong> Memory-efficient attention for Blackwell (SM 12.1) support<\/li>\n<\/ul>\n<\/li>\n<li><strong>unsloth<\/strong>\n<ul>\n<li><strong>Version:<\/strong> 2026.7.5<\/li>\n<li><strong>Purpose:<\/strong> Fine-tuning optimization (2x speed, 70% less VRAM)<\/li>\n<\/ul>\n<\/li>\n<li><strong>unsloth_zoo<\/strong>\n<ul>\n<li><strong>Version:<\/strong> 2026.7.6<\/li>\n<li><strong>Purpose:<\/strong> Unsloth utilities<\/li>\n<\/ul>\n<\/li>\n<li><strong>bitsandbytes<\/strong>\n<ul>\n<li><strong>Version:<\/strong> 0.50.0<\/li>\n<li><strong>Purpose:<\/strong> 4-bit quantization (NF4)<\/li>\n<\/ul>\n<\/li>\n<li><strong>transformers<\/strong>\n<ul>\n<li><strong>Version:<\/strong> 4.56.2<\/li>\n<li><strong>Purpose:<\/strong> Model loading and tokenization<\/li>\n<\/ul>\n<\/li>\n<li><strong>trl<\/strong>\n<ul>\n<li><strong>Version:<\/strong> 0.22.2<\/li>\n<li><strong>Purpose:<\/strong> GRPO training loop<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<p><strong>Now build the image.<\/strong><br \/>\nThis process will take approximately 25\u201330 minutes:<\/p>\n<\/div><style type=\"text\/css\" scopped=\"scopped\">.fusion-syntax-highlighter-7 > .CodeMirror, .fusion-syntax-highlighter-7 > .CodeMirror .CodeMirror-gutters {background-color:#000000;}<\/style><div class=\"fusion-syntax-highlighter-container fusion-syntax-highlighter-7 fusion-syntax-highlighter-theme-dark\" style=\"opacity:0;margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0px;font-size:14px;border-width:1px;border-style:solid;border-color:rgba(242,243,245,0);\"><div class=\"syntax-highlighter-copy-code\"><span class=\"syntax-highlighter-copy-code-title\" data-id=\"fusion_syntax_highlighter_7\" style=\"font-size:14px;\">Copy to Clipboard<\/span><\/div><label for=\"fusion_syntax_highlighter_7\" class=\"screen-reader-text\">Syntax Highlighter<\/label><textarea class=\"fusion-syntax-highlighter-textarea\" id=\"fusion_syntax_highlighter_7\" data-readOnly=\"nocursor\" data-lineNumbers=\"\" data-lineWrapping=\"\" data-theme=\"oceanic-next\" data-mode=\"text\/x-sh\">docker build -f Dockerfile -t unsloth-dgx-spark .<\/textarea><\/div><div class=\"fusion-text fusion-text-8\"><p>&nbsp;<\/p>\n<p>During the build, you will see the following stages:<\/p>\n<\/div><style type=\"text\/css\" scopped=\"scopped\">.fusion-syntax-highlighter-8 > .CodeMirror, .fusion-syntax-highlighter-8 > .CodeMirror .CodeMirror-gutters {background-color:#000000;}<\/style><div class=\"fusion-syntax-highlighter-container fusion-syntax-highlighter-8 fusion-syntax-highlighter-theme-dark\" style=\"opacity:0;margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0px;font-size:14px;border-width:1px;border-style:solid;border-color:rgba(242,243,245,0);\"><div class=\"syntax-highlighter-copy-code\"><span class=\"syntax-highlighter-copy-code-title\" data-id=\"fusion_syntax_highlighter_8\" style=\"font-size:14px;\">Copy to Clipboard<\/span><\/div><label for=\"fusion_syntax_highlighter_8\" class=\"screen-reader-text\">Syntax Highlighter<\/label><textarea class=\"fusion-syntax-highlighter-textarea\" id=\"fusion_syntax_highlighter_8\" data-readOnly=\"nocursor\" data-lineNumbers=\"\" data-lineWrapping=\"\" data-theme=\"oceanic-next\" data-mode=\"text\/txt\">#4 [1\/5] FROM nvcr.io\/nvidia\/pytorch:25.11-py3 \u2190 Base image downloading (~160s)\n#5 [2\/5] RUN git clone &#8230; triton &#8230; \u2190 Triton compiling (~880s \/ ~15min)\n#6 [3\/5] RUN git clone &#8230; xformers &#8230; \u2190 xformers compiling (~68s)\n#7 [4\/5] RUN pip install &#8211;no-deps bitsandbytes \u2190 Packages installing (~10s)\n#8 [5\/5] RUN pip install unsloth unsloth_zoo \u2190 Unsloth installing (~10s)\n#9 exporting to image \u2190 Image writing (~450s \/ ~7.5min)<\/textarea><\/div><div class=\"fusion-text fusion-text-9\"><p>&nbsp;<\/p>\n<p>When the build is complete, you will see the following output:<\/p>\n<\/div><style type=\"text\/css\" scopped=\"scopped\">.fusion-syntax-highlighter-9 > .CodeMirror, .fusion-syntax-highlighter-9 > .CodeMirror .CodeMirror-gutters {background-color:#000000;}<\/style><div class=\"fusion-syntax-highlighter-container fusion-syntax-highlighter-9 fusion-syntax-highlighter-theme-dark\" style=\"opacity:0;margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0px;font-size:14px;border-width:1px;border-style:solid;border-color:rgba(242,243,245,0);\"><div class=\"syntax-highlighter-copy-code\"><span class=\"syntax-highlighter-copy-code-title\" data-id=\"fusion_syntax_highlighter_9\" style=\"font-size:14px;\">Copy to Clipboard<\/span><\/div><label for=\"fusion_syntax_highlighter_9\" class=\"screen-reader-text\">Syntax Highlighter<\/label><textarea class=\"fusion-syntax-highlighter-textarea\" id=\"fusion_syntax_highlighter_9\" data-readOnly=\"nocursor\" data-lineNumbers=\"\" data-lineWrapping=\"\" data-theme=\"oceanic-next\" data-mode=\"text\/txt\">#9 naming to docker.io\/library\/unsloth-dgx-spark:latest done\n#9 unpacking to docker.io\/library\/unsloth-dgx-spark:latest 68.6s done\n#9 DONE 448.5s<\/p>\n<p>2 warnings found (use docker &#8211;debug to expand):\n&#8211; UndefinedVar: Usage of undefined variable &#8216;$C_INCLUDE_PATH&#8217; (line 8)\n&#8211; UndefinedVar: Usage of undefined variable &#8216;$CPLUS_INCLUDE_PATH&#8217; (line 9)<\/textarea><\/div><div class=\"fusion-text fusion-text-10\"><blockquote>\n<p><strong>Important:<\/strong> The <code>UndefinedVar<\/code> warnings are harmless and can be ignored.<\/p>\n<\/blockquote>\n<p>Let&#8217;s verify the image:<\/p>\n<\/div><style type=\"text\/css\" scopped=\"scopped\">.fusion-syntax-highlighter-10 > .CodeMirror, .fusion-syntax-highlighter-10 > .CodeMirror .CodeMirror-gutters {background-color:#000000;}<\/style><div class=\"fusion-syntax-highlighter-container fusion-syntax-highlighter-10 fusion-syntax-highlighter-theme-dark\" style=\"opacity:0;margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0px;font-size:14px;border-width:1px;border-style:solid;border-color:rgba(242,243,245,0);\"><div class=\"syntax-highlighter-copy-code\"><span class=\"syntax-highlighter-copy-code-title\" data-id=\"fusion_syntax_highlighter_10\" style=\"font-size:14px;\">Copy to Clipboard<\/span><\/div><label for=\"fusion_syntax_highlighter_10\" class=\"screen-reader-text\">Syntax Highlighter<\/label><textarea class=\"fusion-syntax-highlighter-textarea\" id=\"fusion_syntax_highlighter_10\" data-readOnly=\"nocursor\" data-lineNumbers=\"\" data-lineWrapping=\"\" data-theme=\"oceanic-next\" data-mode=\"text\/x-sh\">docker images unsloth-dgx-spark<\/textarea><\/div><style type=\"text\/css\" scopped=\"scopped\">.fusion-syntax-highlighter-11 > .CodeMirror, .fusion-syntax-highlighter-11 > .CodeMirror .CodeMirror-gutters {background-color:#000000;}<\/style><div class=\"fusion-syntax-highlighter-container fusion-syntax-highlighter-11 fusion-syntax-highlighter-theme-dark\" style=\"opacity:0;margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0px;font-size:14px;border-width:1px;border-style:solid;border-color:rgba(242,243,245,0);\"><div class=\"syntax-highlighter-copy-code\"><span class=\"syntax-highlighter-copy-code-title\" data-id=\"fusion_syntax_highlighter_11\" style=\"font-size:14px;\">Copy to Clipboard<\/span><\/div><label for=\"fusion_syntax_highlighter_11\" class=\"screen-reader-text\">Syntax Highlighter<\/label><textarea class=\"fusion-syntax-highlighter-textarea\" id=\"fusion_syntax_highlighter_11\" data-readOnly=\"nocursor\" data-lineNumbers=\"\" data-lineWrapping=\"\" data-theme=\"oceanic-next\" data-mode=\"text\/txt\">IMAGE ID DISK USAGE CONTENT SIZE EXTRA\nunsloth-dgx-spark:latest ab8ba088e6cf 54.5GB 15.9GB U<\/textarea><\/div><div class=\"fusion-text fusion-text-11\"><hr \/>\n<h3>3. Starting the Container<\/h3>\n<p>Start the Docker container that will be used for training, with GPU access and volume mount parameters:<\/p>\n<\/div><style type=\"text\/css\" scopped=\"scopped\">.fusion-syntax-highlighter-12 > .CodeMirror, .fusion-syntax-highlighter-12 > .CodeMirror .CodeMirror-gutters {background-color:#000000;}<\/style><div class=\"fusion-syntax-highlighter-container fusion-syntax-highlighter-12 fusion-syntax-highlighter-theme-dark\" style=\"opacity:0;margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0px;font-size:14px;border-width:1px;border-style:solid;border-color:rgba(242,243,245,0);\"><div class=\"syntax-highlighter-copy-code\"><span class=\"syntax-highlighter-copy-code-title\" data-id=\"fusion_syntax_highlighter_12\" style=\"font-size:14px;\">Copy to Clipboard<\/span><\/div><label for=\"fusion_syntax_highlighter_12\" class=\"screen-reader-text\">Syntax Highlighter<\/label><textarea class=\"fusion-syntax-highlighter-textarea\" id=\"fusion_syntax_highlighter_12\" data-readOnly=\"nocursor\" data-lineNumbers=\"\" data-lineWrapping=\"\" data-theme=\"oceanic-next\" data-mode=\"text\/x-sh\">docker run -it\n&#8211;gpus=all\n&#8211;net=host\n&#8211;ipc=host\n&#8211;ulimit memlock=-1\n&#8211;ulimit stack=67108864\n-v $(pwd):$(pwd)\n-v $HOME\/.cache\/huggingface:\/root\/.cache\/huggingface\n-w $(pwd)\nunsloth-dgx-spark<\/textarea><\/div><style type=\"text\/css\" scopped=\"scopped\">.fusion-syntax-highlighter-13 > .CodeMirror, .fusion-syntax-highlighter-13 > .CodeMirror .CodeMirror-gutters {background-color:#000000;}<\/style><div class=\"fusion-syntax-highlighter-container fusion-syntax-highlighter-13 fusion-syntax-highlighter-theme-dark\" style=\"opacity:0;margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0px;font-size:14px;border-width:1px;border-style:solid;border-color:rgba(242,243,245,0);\"><div class=\"syntax-highlighter-copy-code\"><span class=\"syntax-highlighter-copy-code-title\" data-id=\"fusion_syntax_highlighter_13\" style=\"font-size:14px;\">Copy to Clipboard<\/span><\/div><label for=\"fusion_syntax_highlighter_13\" class=\"screen-reader-text\">Syntax Highlighter<\/label><textarea class=\"fusion-syntax-highlighter-textarea\" id=\"fusion_syntax_highlighter_13\" data-readOnly=\"nocursor\" data-lineNumbers=\"\" data-lineWrapping=\"\" data-theme=\"oceanic-next\" data-mode=\"text\/txt\">=============\n== PyTorch ==\n=============<\/p>\n<p>NVIDIA Release 25.11 (build 210907838)\nPyTorch Version 2.10.0a0+b558c986e8.nv25.11\nContainer image Copyright (c) 2025, NVIDIA CORPORATION &amp; AFFILIATES. All rights reserved.\nCopyright (c) 2014-2024 Facebook Inc.\nCopyright (c) 2011-2014 Idiap Research Institute (Ronan Collobert)\nCopyright (c) 2012-2014 Deepmind Technologies (Koray Kavukcuoglu)\nCopyright (c) 2011-2012 NEC Laboratories America (Koray Kavukcuoglu)\nCopyright (c) 2011-2013 NYU (Clement Farabet)\nCopyright (c) 2006-2010 NEC Laboratories America (Ronan Collobert, Leon Bottou, Iain Melvin, Jason Weston)\nCopyright (c) 2006 Idiap Research Institute (Samy Bengio)\nCopyright (c) 2001-2004 Idiap Research Institute (Ronan Collobert, Samy Bengio, Johnny Mariethoz)\nCopyright (c) 2015 Google Inc.\nCopyright (c) 2015 Yangqing Jia\nCopyright (c) 2013-2016 The Caffe contributors\nAll rights reserved.<\/p>\n<p>Various files include modifications (c) NVIDIA CORPORATION &amp; AFFILIATES. All rights reserved.<\/p>\n<p>GOVERNING TERMS: The software and materials are governed by the NVIDIA Software License Agreement\n(found at https:\/\/www.nvidia.com\/en-us\/agreements\/enterprise-software\/nvidia-software-license-agreement\/)\nand the Product-Specific Terms for NVIDIA AI Products\n(found at https:\/\/www.nvidia.com\/en-us\/agreements\/enterprise-software\/product-specific-terms-for-ai-products\/).<\/textarea><\/div><div class=\"fusion-text fusion-text-12\"><hr \/>\n<h2>Training<\/h2>\n<h3>4. Downloading the Notebook<\/h3>\n<p>Download Unsloth&#8217;s RL notebook that teaches the GPT-OSS 20B model to play 2048:<\/p>\n<\/div><style type=\"text\/css\" scopped=\"scopped\">.fusion-syntax-highlighter-14 > .CodeMirror, .fusion-syntax-highlighter-14 > .CodeMirror .CodeMirror-gutters {background-color:#000000;}<\/style><div class=\"fusion-syntax-highlighter-container fusion-syntax-highlighter-14 fusion-syntax-highlighter-theme-dark\" style=\"opacity:0;margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0px;font-size:14px;border-width:1px;border-style:solid;border-color:rgba(242,243,245,0);\"><div class=\"syntax-highlighter-copy-code\"><span class=\"syntax-highlighter-copy-code-title\" data-id=\"fusion_syntax_highlighter_14\" style=\"font-size:14px;\">Copy to Clipboard<\/span><\/div><label for=\"fusion_syntax_highlighter_14\" class=\"screen-reader-text\">Syntax Highlighter<\/label><textarea class=\"fusion-syntax-highlighter-textarea\" id=\"fusion_syntax_highlighter_14\" data-readOnly=\"nocursor\" data-lineNumbers=\"\" data-lineWrapping=\"\" data-theme=\"oceanic-next\" data-mode=\"text\/x-sh\">NOTEBOOK_URL=&#8221;https:\/\/raw.githubusercontent.com\/unslothai\/notebooks\/refs\/heads\/main\/nb\/gpt_oss_(20B)_Reinforcement_Learning_2048_Game_DGX_Spark.ipynb&#8221;\nwget -O &#8220;gpt_oss_20B_RL_2048_Game.ipynb&#8221; &#8220;$NOTEBOOK_URL&#8221;<\/textarea><\/div><style type=\"text\/css\" scopped=\"scopped\">.fusion-syntax-highlighter-15 > .CodeMirror, .fusion-syntax-highlighter-15 > .CodeMirror .CodeMirror-gutters {background-color:#000000;}<\/style><div class=\"fusion-syntax-highlighter-container fusion-syntax-highlighter-15 fusion-syntax-highlighter-theme-dark\" style=\"opacity:0;margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0px;font-size:14px;border-width:1px;border-style:solid;border-color:rgba(242,243,245,0);\"><div class=\"syntax-highlighter-copy-code\"><span class=\"syntax-highlighter-copy-code-title\" data-id=\"fusion_syntax_highlighter_15\" style=\"font-size:14px;\">Copy to Clipboard<\/span><\/div><label for=\"fusion_syntax_highlighter_15\" class=\"screen-reader-text\">Syntax Highlighter<\/label><textarea class=\"fusion-syntax-highlighter-textarea\" id=\"fusion_syntax_highlighter_15\" data-readOnly=\"nocursor\" data-lineNumbers=\"\" data-lineWrapping=\"\" data-theme=\"oceanic-next\" data-mode=\"text\/txt\">Resolving raw.githubusercontent.com (raw.githubusercontent.com)&#8230; 185.199.110.133\nConnecting to raw.githubusercontent.com|185.199.110.133|:443&#8230; connected.\nHTTP request sent, awaiting response&#8230; 200 OK\nLength: 480510 (469K) [text\/plain]\nSaving to: &#8216;gpt_oss_20B_RL_2048_Game.ipynb&#8217;<\/p>\n<p>gpt_oss_20B_RL_2048_Game.ipynb 100%[=============================================&gt;] 469.25K &#8211;.-KB\/s in 0.05s<\/p>\n<p>2026-07-29 12:44:12 (9.39 MB\/s) &#8211; &#8216;gpt_oss_20B_RL_2048_Game.ipynb&#8217; saved [480510\/480510]<\/textarea><\/div><div class=\"fusion-text fusion-text-13\"><p>&nbsp;<\/p>\n<p>This Jupyter notebook consists of 60 cells and includes the following steps:<\/p>\n<p><em><strong>1. Loading the model with 4-bit QLoRA<\/strong><\/em><br \/>\n<em><strong>2. Adding LoRA adapters<\/strong><\/em><br \/>\n<em><strong>3. Setting up the game environment<\/strong><\/em><br \/>\n<em><strong>4. Defining reward functions<\/strong><\/em><br \/>\n<em><strong>5. Training for 1000 steps with GRPO (Group Relative Policy Optimization)<\/strong><\/em><br \/>\n<em><strong>6. Saving the fine-tuned model<\/strong><\/em><\/p>\n<h3>5. Launching Jupyter and Running the Notebook<\/h3>\n<p>Start the Jupyter notebook server inside the container:<\/p>\n<\/div><style type=\"text\/css\" scopped=\"scopped\">.fusion-syntax-highlighter-16 > .CodeMirror, .fusion-syntax-highlighter-16 > .CodeMirror .CodeMirror-gutters {background-color:#000000;}<\/style><div class=\"fusion-syntax-highlighter-container fusion-syntax-highlighter-16 fusion-syntax-highlighter-theme-dark\" style=\"opacity:0;margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0px;font-size:14px;border-width:1px;border-style:solid;border-color:rgba(242,243,245,0);\"><div class=\"syntax-highlighter-copy-code\"><span class=\"syntax-highlighter-copy-code-title\" data-id=\"fusion_syntax_highlighter_16\" style=\"font-size:14px;\">Copy to Clipboard<\/span><\/div><label for=\"fusion_syntax_highlighter_16\" class=\"screen-reader-text\">Syntax Highlighter<\/label><textarea class=\"fusion-syntax-highlighter-textarea\" id=\"fusion_syntax_highlighter_16\" data-readOnly=\"nocursor\" data-lineNumbers=\"\" data-lineWrapping=\"\" data-theme=\"oceanic-next\" data-mode=\"text\/x-sh\">jupyter notebook &#8211;ip=0.0.0.0 &#8211;port=8888 &#8211;no-browser &#8211;allow-root<\/textarea><\/div><style type=\"text\/css\" scopped=\"scopped\">.fusion-syntax-highlighter-17 > .CodeMirror, .fusion-syntax-highlighter-17 > .CodeMirror .CodeMirror-gutters {background-color:#000000;}<\/style><div class=\"fusion-syntax-highlighter-container fusion-syntax-highlighter-17 fusion-syntax-highlighter-theme-dark\" style=\"opacity:0;margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0px;font-size:14px;border-width:1px;border-style:solid;border-color:rgba(242,243,245,0);\"><div class=\"syntax-highlighter-copy-code\"><span class=\"syntax-highlighter-copy-code-title\" data-id=\"fusion_syntax_highlighter_17\" style=\"font-size:14px;\">Copy to Clipboard<\/span><\/div><label for=\"fusion_syntax_highlighter_17\" class=\"screen-reader-text\">Syntax Highlighter<\/label><textarea class=\"fusion-syntax-highlighter-textarea\" id=\"fusion_syntax_highlighter_17\" data-readOnly=\"nocursor\" data-lineNumbers=\"\" data-lineWrapping=\"\" data-theme=\"oceanic-next\" data-mode=\"text\/txt\">[I 2026-07-29 12:44:36.779 ServerApp] Serving notebooks from local directory: \/home\/nvidia[I 2026-07-29 12:44:36.779 ServerApp] Jupyter Server 2.17.0 is running at:[I 2026-07-29 12:44:36.779 ServerApp] http:\/\/hostname:8888\/tree?token=0388154bcd8cca584336b88ea9b84d09dbc302068f1e9a49[I 2026-07-29 12:44:36.779 ServerApp] http:\/\/127.0.0.1:8888\/tree?token=0388154bcd8cca584336b88ea9b84d09dbc302068f1e9a49[I 2026-07-29 12:44:36.779 ServerApp] Use Control-C to stop this server and shut down all kernels<\/textarea><\/div><div class=\"fusion-text fusion-text-14\"><p>This server provides a web interface that allows you to edit and run <code>.ipynb<\/code> files on the Spark. To access the interface, go to the following address from your computer&#8217;s browser:<\/p>\n<\/div><div class=\"fusion-text fusion-text-15\"><p>http:\/\/&lt;spark-ip&gt;:8888\/tree?token=&lt;token&gt;<\/p>\n<\/div><div class=\"fusion-text fusion-text-16\"><p>&nbsp;<\/p>\n<p>Replace the with the token you see in the terminal <strong>(e.g., 0388154bcd8cca584336b88ea9b84d09dbc302068f1e9a49)<\/strong>. Open the notebook by clicking on gpt_oss_20B_RL_2048_Game.ipynb from the file browser.<\/p>\n<p>Saving the Model: During training, a checkpoint is automatically saved to the outputs\/ directory every 100 steps along with the LoRA adapter weights. However, the option to save the merged version of these adapter weights with the original model is disabled. If you want to save the model for inference with vLLM after training, you must enable this option before running the notebook. To do this, go to the last cell of the notebook (Cell 58) and change the if False: lines in that cell to if True:. You can choose either MXFP4 (OpenAI&#8217;s 4-bit format) or 16-bit format:<\/p>\n<\/div><style type=\"text\/css\" scopped=\"scopped\">.fusion-syntax-highlighter-18 > .CodeMirror, .fusion-syntax-highlighter-18 > .CodeMirror .CodeMirror-gutters {background-color:#000000;}<\/style><div class=\"fusion-syntax-highlighter-container fusion-syntax-highlighter-18 fusion-syntax-highlighter-theme-dark\" style=\"opacity:0;margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0px;font-size:14px;border-width:1px;border-style:solid;border-color:rgba(242,243,245,0);\"><div class=\"syntax-highlighter-copy-code\"><span class=\"syntax-highlighter-copy-code-title\" data-id=\"fusion_syntax_highlighter_18\" style=\"font-size:14px;\">Copy to Clipboard<\/span><\/div><label for=\"fusion_syntax_highlighter_18\" class=\"screen-reader-text\">Syntax Highlighter<\/label><textarea class=\"fusion-syntax-highlighter-textarea\" id=\"fusion_syntax_highlighter_18\" data-readOnly=\"nocursor\" data-lineNumbers=\"\" data-lineWrapping=\"\" data-theme=\"oceanic-next\" data-mode=\"text\/x-sh\">model.save_pretrained_merged(&#8220;finetuned_model&#8221;, tokenizer, save_method = &#8220;mxfp4&#8221;)<\/textarea><\/div><div class=\"fusion-text fusion-text-17\"><p>&nbsp;<\/p>\n<p>Select <code>Cell \u2192 Run All<\/code> from the menu bar to run all cells sequentially at once. As each cell runs, you will see <code>In [*]:<\/code> on its left side; when completed, they will be numbered as <code>In [1]:<\/code>, <code>In [2]:<\/code>, and so on. Jupyter will handle the rest of the training process. You can monitor the notebook&#8217;s progress from the web interface if you wish.<\/p>\n<p>Below are some screenshots from the notebook&#8217;s web interface after training. Here you can see various code cells and explanations:<\/p>\n<\/div><div class=\"fusion-image-element \" style=\"--awb-caption-title-font-family:var(--h2_typography-font-family);--awb-caption-title-font-weight:var(--h2_typography-font-weight);--awb-caption-title-font-style:var(--h2_typography-font-style);--awb-caption-title-size:var(--h2_typography-font-size);--awb-caption-title-transform:var(--h2_typography-text-transform);--awb-caption-title-line-height:var(--h2_typography-line-height);--awb-caption-title-letter-spacing:var(--h2_typography-letter-spacing);\"><span class=\" fusion-imageframe imageframe-none imageframe-1 hover-type-none\"><img decoding=\"async\" width=\"1024\" height=\"579\" title=\"unsloth_notebook_1\" src=\"https:\/\/blog.openzeka.com\/en\/wp-content\/uploads\/2026\/08\/unsloth_notebook_1-1024x579.webp\" alt class=\"img-responsive wp-image-1856\" srcset=\"https:\/\/blog.openzeka.com\/en\/wp-content\/uploads\/2026\/08\/unsloth_notebook_1-200x113.webp 200w, https:\/\/blog.openzeka.com\/en\/wp-content\/uploads\/2026\/08\/unsloth_notebook_1-300x170.webp 300w, https:\/\/blog.openzeka.com\/en\/wp-content\/uploads\/2026\/08\/unsloth_notebook_1-400x226.webp 400w, https:\/\/blog.openzeka.com\/en\/wp-content\/uploads\/2026\/08\/unsloth_notebook_1-600x339.webp 600w, https:\/\/blog.openzeka.com\/en\/wp-content\/uploads\/2026\/08\/unsloth_notebook_1-768x434.webp 768w, https:\/\/blog.openzeka.com\/en\/wp-content\/uploads\/2026\/08\/unsloth_notebook_1-800x452.webp 800w, https:\/\/blog.openzeka.com\/en\/wp-content\/uploads\/2026\/08\/unsloth_notebook_1-1024x579.webp 1024w, https:\/\/blog.openzeka.com\/en\/wp-content\/uploads\/2026\/08\/unsloth_notebook_1-1200x678.webp 1200w, https:\/\/blog.openzeka.com\/en\/wp-content\/uploads\/2026\/08\/unsloth_notebook_1-1536x868.webp 1536w, https:\/\/blog.openzeka.com\/en\/wp-content\/uploads\/2026\/08\/unsloth_notebook_1.webp 1850w\" sizes=\"(max-width: 640px) 100vw, 1024px\" \/><\/span><\/div><div class=\"fusion-image-element \" style=\"--awb-caption-title-font-family:var(--h2_typography-font-family);--awb-caption-title-font-weight:var(--h2_typography-font-weight);--awb-caption-title-font-style:var(--h2_typography-font-style);--awb-caption-title-size:var(--h2_typography-font-size);--awb-caption-title-transform:var(--h2_typography-text-transform);--awb-caption-title-line-height:var(--h2_typography-line-height);--awb-caption-title-letter-spacing:var(--h2_typography-letter-spacing);\"><span class=\" fusion-imageframe imageframe-none imageframe-2 hover-type-none\"><img decoding=\"async\" width=\"1024\" height=\"579\" title=\"unsloth_notebook_2\" src=\"https:\/\/blog.openzeka.com\/en\/wp-content\/uploads\/2026\/08\/unsloth_notebook_2-1024x579.webp\" alt class=\"img-responsive wp-image-1857\" srcset=\"https:\/\/blog.openzeka.com\/en\/wp-content\/uploads\/2026\/08\/unsloth_notebook_2-200x113.webp 200w, https:\/\/blog.openzeka.com\/en\/wp-content\/uploads\/2026\/08\/unsloth_notebook_2-300x170.webp 300w, https:\/\/blog.openzeka.com\/en\/wp-content\/uploads\/2026\/08\/unsloth_notebook_2-400x226.webp 400w, https:\/\/blog.openzeka.com\/en\/wp-content\/uploads\/2026\/08\/unsloth_notebook_2-600x339.webp 600w, https:\/\/blog.openzeka.com\/en\/wp-content\/uploads\/2026\/08\/unsloth_notebook_2-768x434.webp 768w, https:\/\/blog.openzeka.com\/en\/wp-content\/uploads\/2026\/08\/unsloth_notebook_2-800x452.webp 800w, https:\/\/blog.openzeka.com\/en\/wp-content\/uploads\/2026\/08\/unsloth_notebook_2-1024x579.webp 1024w, https:\/\/blog.openzeka.com\/en\/wp-content\/uploads\/2026\/08\/unsloth_notebook_2-1200x678.webp 1200w, https:\/\/blog.openzeka.com\/en\/wp-content\/uploads\/2026\/08\/unsloth_notebook_2-1536x868.webp 1536w, https:\/\/blog.openzeka.com\/en\/wp-content\/uploads\/2026\/08\/unsloth_notebook_2.webp 1850w\" sizes=\"(max-width: 640px) 100vw, 1024px\" \/><\/span><\/div><div class=\"fusion-image-element \" style=\"--awb-caption-title-font-family:var(--h2_typography-font-family);--awb-caption-title-font-weight:var(--h2_typography-font-weight);--awb-caption-title-font-style:var(--h2_typography-font-style);--awb-caption-title-size:var(--h2_typography-font-size);--awb-caption-title-transform:var(--h2_typography-text-transform);--awb-caption-title-line-height:var(--h2_typography-line-height);--awb-caption-title-letter-spacing:var(--h2_typography-letter-spacing);\"><span class=\" fusion-imageframe imageframe-none imageframe-3 hover-type-none\"><img decoding=\"async\" width=\"1024\" height=\"579\" title=\"unsloth_notebook_3\" src=\"https:\/\/blog.openzeka.com\/en\/wp-content\/uploads\/2026\/08\/unsloth_notebook_3-1024x579.webp\" alt class=\"img-responsive wp-image-1858\" srcset=\"https:\/\/blog.openzeka.com\/en\/wp-content\/uploads\/2026\/08\/unsloth_notebook_3-200x113.webp 200w, https:\/\/blog.openzeka.com\/en\/wp-content\/uploads\/2026\/08\/unsloth_notebook_3-300x170.webp 300w, https:\/\/blog.openzeka.com\/en\/wp-content\/uploads\/2026\/08\/unsloth_notebook_3-400x226.webp 400w, https:\/\/blog.openzeka.com\/en\/wp-content\/uploads\/2026\/08\/unsloth_notebook_3-600x339.webp 600w, https:\/\/blog.openzeka.com\/en\/wp-content\/uploads\/2026\/08\/unsloth_notebook_3-768x434.webp 768w, https:\/\/blog.openzeka.com\/en\/wp-content\/uploads\/2026\/08\/unsloth_notebook_3-800x452.webp 800w, https:\/\/blog.openzeka.com\/en\/wp-content\/uploads\/2026\/08\/unsloth_notebook_3-1024x579.webp 1024w, https:\/\/blog.openzeka.com\/en\/wp-content\/uploads\/2026\/08\/unsloth_notebook_3-1200x678.webp 1200w, https:\/\/blog.openzeka.com\/en\/wp-content\/uploads\/2026\/08\/unsloth_notebook_3-1536x868.webp 1536w, https:\/\/blog.openzeka.com\/en\/wp-content\/uploads\/2026\/08\/unsloth_notebook_3.webp 1850w\" sizes=\"(max-width: 640px) 100vw, 1024px\" \/><\/span><\/div><div class=\"fusion-image-element \" style=\"--awb-caption-title-font-family:var(--h2_typography-font-family);--awb-caption-title-font-weight:var(--h2_typography-font-weight);--awb-caption-title-font-style:var(--h2_typography-font-style);--awb-caption-title-size:var(--h2_typography-font-size);--awb-caption-title-transform:var(--h2_typography-text-transform);--awb-caption-title-line-height:var(--h2_typography-line-height);--awb-caption-title-letter-spacing:var(--h2_typography-letter-spacing);\"><span class=\" fusion-imageframe imageframe-none imageframe-4 hover-type-none\"><img decoding=\"async\" width=\"1024\" height=\"579\" title=\"unsloth_notebook_4\" src=\"https:\/\/blog.openzeka.com\/en\/wp-content\/uploads\/2026\/08\/unsloth_notebook_4-1024x579.webp\" alt class=\"img-responsive wp-image-1859\" srcset=\"https:\/\/blog.openzeka.com\/en\/wp-content\/uploads\/2026\/08\/unsloth_notebook_4-200x113.webp 200w, https:\/\/blog.openzeka.com\/en\/wp-content\/uploads\/2026\/08\/unsloth_notebook_4-300x170.webp 300w, https:\/\/blog.openzeka.com\/en\/wp-content\/uploads\/2026\/08\/unsloth_notebook_4-400x226.webp 400w, https:\/\/blog.openzeka.com\/en\/wp-content\/uploads\/2026\/08\/unsloth_notebook_4-600x339.webp 600w, https:\/\/blog.openzeka.com\/en\/wp-content\/uploads\/2026\/08\/unsloth_notebook_4-768x434.webp 768w, https:\/\/blog.openzeka.com\/en\/wp-content\/uploads\/2026\/08\/unsloth_notebook_4-800x452.webp 800w, https:\/\/blog.openzeka.com\/en\/wp-content\/uploads\/2026\/08\/unsloth_notebook_4-1024x579.webp 1024w, https:\/\/blog.openzeka.com\/en\/wp-content\/uploads\/2026\/08\/unsloth_notebook_4-1200x678.webp 1200w, https:\/\/blog.openzeka.com\/en\/wp-content\/uploads\/2026\/08\/unsloth_notebook_4-1536x868.webp 1536w, https:\/\/blog.openzeka.com\/en\/wp-content\/uploads\/2026\/08\/unsloth_notebook_4.webp 1850w\" sizes=\"(max-width: 640px) 100vw, 1024px\" \/><\/span><\/div><div class=\"fusion-image-element \" style=\"--awb-caption-title-font-family:var(--h2_typography-font-family);--awb-caption-title-font-weight:var(--h2_typography-font-weight);--awb-caption-title-font-style:var(--h2_typography-font-style);--awb-caption-title-size:var(--h2_typography-font-size);--awb-caption-title-transform:var(--h2_typography-text-transform);--awb-caption-title-line-height:var(--h2_typography-line-height);--awb-caption-title-letter-spacing:var(--h2_typography-letter-spacing);\"><span class=\" fusion-imageframe imageframe-none imageframe-5 hover-type-none\"><img decoding=\"async\" width=\"1024\" height=\"579\" title=\"unsloth_notebook_5\" src=\"https:\/\/blog.openzeka.com\/en\/wp-content\/uploads\/2026\/08\/unsloth_notebook_5-1024x579.webp\" alt class=\"img-responsive wp-image-1860\" srcset=\"https:\/\/blog.openzeka.com\/en\/wp-content\/uploads\/2026\/08\/unsloth_notebook_5-200x113.webp 200w, https:\/\/blog.openzeka.com\/en\/wp-content\/uploads\/2026\/08\/unsloth_notebook_5-300x170.webp 300w, https:\/\/blog.openzeka.com\/en\/wp-content\/uploads\/2026\/08\/unsloth_notebook_5-400x226.webp 400w, https:\/\/blog.openzeka.com\/en\/wp-content\/uploads\/2026\/08\/unsloth_notebook_5-600x339.webp 600w, https:\/\/blog.openzeka.com\/en\/wp-content\/uploads\/2026\/08\/unsloth_notebook_5-768x434.webp 768w, https:\/\/blog.openzeka.com\/en\/wp-content\/uploads\/2026\/08\/unsloth_notebook_5-800x452.webp 800w, https:\/\/blog.openzeka.com\/en\/wp-content\/uploads\/2026\/08\/unsloth_notebook_5-1024x579.webp 1024w, https:\/\/blog.openzeka.com\/en\/wp-content\/uploads\/2026\/08\/unsloth_notebook_5-1200x678.webp 1200w, https:\/\/blog.openzeka.com\/en\/wp-content\/uploads\/2026\/08\/unsloth_notebook_5-1536x868.webp 1536w, https:\/\/blog.openzeka.com\/en\/wp-content\/uploads\/2026\/08\/unsloth_notebook_5.webp 1850w\" sizes=\"(max-width: 640px) 100vw, 1024px\" \/><\/span><\/div><div class=\"fusion-text fusion-text-18\"><p>&nbsp;<\/p>\n<p>As the notebook cells run, the following steps will occur in sequence.<\/p>\n<h3>Loading the Model<\/h3>\n<p>The first code cell (Cell 5) loads the model with 4-bit quantization. This step downloads the model from HuggingFace (~12 GB) and loads it into GPU memory:<\/p>\n<\/div><style type=\"text\/css\" scopped=\"scopped\">.fusion-syntax-highlighter-19 > .CodeMirror, .fusion-syntax-highlighter-19 > .CodeMirror .CodeMirror-gutters {background-color:#000000;}<\/style><div class=\"fusion-syntax-highlighter-container fusion-syntax-highlighter-19 fusion-syntax-highlighter-theme-dark\" style=\"opacity:0;margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0px;font-size:14px;border-width:1px;border-style:solid;border-color:rgba(242,243,245,0);\"><div class=\"syntax-highlighter-copy-code\"><span class=\"syntax-highlighter-copy-code-title\" data-id=\"fusion_syntax_highlighter_19\" style=\"font-size:14px;\">Copy to Clipboard<\/span><\/div><label for=\"fusion_syntax_highlighter_19\" class=\"screen-reader-text\">Syntax Highlighter<\/label><textarea class=\"fusion-syntax-highlighter-textarea\" id=\"fusion_syntax_highlighter_19\" data-readOnly=\"nocursor\" data-lineNumbers=\"\" data-lineWrapping=\"\" data-theme=\"oceanic-next\" data-mode=\"text\/txt\">\ud83e\udda5 Unsloth: Will patch your computer to enable 2x faster free finetuning.\n\ud83e\udda5 Unsloth Zoo will now patch everything to make training faster!\n==((====))== Unsloth 2026.7.5: Fast Gpt_Oss patching. Transformers: 4.56.2.\n\/| NVIDIA GB10. Num GPUs = 1. Max memory: 121.69 GB. Platform: Linux.\nO^O\/ _\/ Torch: 2.10.0a0+b558c986e8.nv25.11. CUDA: 12.1. CUDA Toolkit: 13.0. Triton: 3.4.0\n\/ Bfloat16 = TRUE. FA [Xformers = 0.0.33+aa7bc36.d20260729. FA2 = True]\n&#8220;-____-&#8221; Free license: http:\/\/github.com\/unslothai\/unsloth\nUnsloth: Fast downloading is enabled &#8211; ignore downloading bars which are red colored!<\/p>\n<p>Loading checkpoint shards: 0%| | 0\/4 [00:00<!--?, ?it\/s&#093;&lt;br ?--> Loading checkpoint shards: 25%|\u2588\u2588\u258c | 1\/4 [00:29&lt;01:28, 29.61s\/it]\nLoading checkpoint shards: 50%|\u2588\u2588\u2588\u2588\u2588 | 2\/4 [00:56&lt;00:56, 28.05s\/it]\nLoading checkpoint shards: 75%|\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u258c | 3\/4 [01:15&lt;00:23, 23.85s\/it]\nLoading checkpoint shards: 100%|\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588| 4\/4 [01:22&lt;00:00, 17.16s\/it]\nLoading checkpoint shards: 100%|\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588| 4\/4 [01:22&lt;00:00, 20.58s\/it]\nUnsloth: Offloading embeddings to RAM to save 1.08 GB.<\/textarea><\/div><div class=\"fusion-text fusion-text-19\"><p>&nbsp;<\/p>\n<p>Then LoRA adapters are added (Cell 7):<\/p>\n<\/div><style type=\"text\/css\" scopped=\"scopped\">.fusion-syntax-highlighter-20 > .CodeMirror, .fusion-syntax-highlighter-20 > .CodeMirror .CodeMirror-gutters {background-color:#000000;}<\/style><div class=\"fusion-syntax-highlighter-container fusion-syntax-highlighter-20 fusion-syntax-highlighter-theme-dark\" style=\"opacity:0;margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0px;font-size:14px;border-width:1px;border-style:solid;border-color:rgba(242,243,245,0);\"><div class=\"syntax-highlighter-copy-code\"><span class=\"syntax-highlighter-copy-code-title\" data-id=\"fusion_syntax_highlighter_20\" style=\"font-size:14px;\">Copy to Clipboard<\/span><\/div><label for=\"fusion_syntax_highlighter_20\" class=\"screen-reader-text\">Syntax Highlighter<\/label><textarea class=\"fusion-syntax-highlighter-textarea\" id=\"fusion_syntax_highlighter_20\" data-readOnly=\"nocursor\" data-lineNumbers=\"\" data-lineWrapping=\"\" data-theme=\"oceanic-next\" data-mode=\"text\/txt\">Unsloth: Explicit target_modules are constrained by the finetune_(vision|language|attention|mlp) filters; adapters attach only where both select.\nUnsloth: Detected MoE model with per-expert Linear experts. Enabling LoRA on 64 expert projection modules.<\/textarea><\/div><div class=\"fusion-text fusion-text-20\"><p>&nbsp;<\/p>\n<p>At this point, the model is ready.<\/p>\n<hr \/>\n<h3>7. GRPO Training<\/h3>\n<p>Training begins when the <code>trainer.train()<\/code> cell runs. The GRPO (Group Relative Policy Optimization) algorithm repeats the following loop 1000 times:<\/p>\n<p>1. The model is sent the prompt &#8220;write a strategy function for 2048&#8221;.<\/p>\n<p>2. The model generates 2 candidate functions.<\/p>\n<p>3. Each function is executed:<\/p>\n<ul>\n<li>Is it valid Python? (<code>function_works<\/code> reward)<\/li>\n<li>Is it cheating? (<code>no_cheating<\/code> reward)<\/li>\n<li>Does it win the 2048 game? (<code>strategy_succeeds<\/code> reward)<\/li>\n<\/ul>\n<p>4. Rewards are calculated and LoRA weights are updated<\/p>\n<p>When training starts, you will see the following output:<\/p>\n<\/div><style type=\"text\/css\" scopped=\"scopped\">.fusion-syntax-highlighter-21 > .CodeMirror, .fusion-syntax-highlighter-21 > .CodeMirror .CodeMirror-gutters {background-color:#000000;}<\/style><div class=\"fusion-syntax-highlighter-container fusion-syntax-highlighter-21 fusion-syntax-highlighter-theme-dark\" style=\"opacity:0;margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0px;font-size:14px;border-width:1px;border-style:solid;border-color:rgba(242,243,245,0);\"><div class=\"syntax-highlighter-copy-code\"><span class=\"syntax-highlighter-copy-code-title\" data-id=\"fusion_syntax_highlighter_21\" style=\"font-size:14px;\">Copy to Clipboard<\/span><\/div><label for=\"fusion_syntax_highlighter_21\" class=\"screen-reader-text\">Syntax Highlighter<\/label><textarea class=\"fusion-syntax-highlighter-textarea\" id=\"fusion_syntax_highlighter_21\" data-readOnly=\"nocursor\" data-lineNumbers=\"\" data-lineWrapping=\"\" data-theme=\"oceanic-next\" data-mode=\"text\/txt\">==((====))== Unsloth &#8211; 2x faster free finetuning | Num GPUs used = 1\n\/| Num examples = 1,000 | Num Epochs = 1 | Total steps = 1000\nO^O\/ _\/ Batch size per device = 2 | Gradient accumulation steps = 1\n\/ Data Parallel GPUs = 1 | Total batch size (2 x 1 x 1) = 2\n&#8220;-____-&#8221; Trainable parameters = 46,227,456 of 20,960,984,640 (0.22% trained)\n`generation_config` default values have been modified to match model-specific defaults: {&#8216;max_length&#8217;: 131072}.\nUnsloth: Will smartly offload gradients to save VRAM!<\/textarea><\/div><div class=\"fusion-text fusion-text-21\"><p>&nbsp;<\/p>\n<p>In the initial steps, the model mostly produces strategies that time out or throw errors. After approximately 150-200 steps, the model starts producing valid strategies and begins winning games. After 1000 steps and approximately 4 hours of training, the model plays 2048 much better than the original.<\/p>\n<p>During training, you will see the reward values for each step:<\/p>\n<\/div><style type=\"text\/css\" scopped=\"scopped\">.fusion-syntax-highlighter-22 > .CodeMirror, .fusion-syntax-highlighter-22 > .CodeMirror .CodeMirror-gutters {background-color:#000000;}<\/style><div class=\"fusion-syntax-highlighter-container fusion-syntax-highlighter-22 fusion-syntax-highlighter-theme-dark\" style=\"opacity:0;margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0px;font-size:14px;border-width:1px;border-style:solid;border-color:rgba(242,243,245,0);\"><div class=\"syntax-highlighter-copy-code\"><span class=\"syntax-highlighter-copy-code-title\" data-id=\"fusion_syntax_highlighter_22\" style=\"font-size:14px;\">Copy to Clipboard<\/span><\/div><label for=\"fusion_syntax_highlighter_22\" class=\"screen-reader-text\">Syntax Highlighter<\/label><textarea class=\"fusion-syntax-highlighter-textarea\" id=\"fusion_syntax_highlighter_22\" data-readOnly=\"nocursor\" data-lineNumbers=\"\" data-lineWrapping=\"\" data-theme=\"oceanic-next\" data-mode=\"text\/txt\">def strategy(board):\nimport random\nmoves = &#8220;WASD&#8221;\n&#8230;\nSteps = 1236 State = success<\/textarea><\/div><div class=\"fusion-text fusion-text-22\"><p>&nbsp;<\/p>\n<p>When you see <code>State = success<\/code>, the model has produced a strategy and reached 2048. When training is complete, you will see the following output:<\/p>\n<\/div><style type=\"text\/css\" scopped=\"scopped\">.fusion-syntax-highlighter-23 > .CodeMirror, .fusion-syntax-highlighter-23 > .CodeMirror .CodeMirror-gutters {background-color:#000000;}<\/style><div class=\"fusion-syntax-highlighter-container fusion-syntax-highlighter-23 fusion-syntax-highlighter-theme-dark\" style=\"opacity:0;margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0px;font-size:14px;border-width:1px;border-style:solid;border-color:rgba(242,243,245,0);\"><div class=\"syntax-highlighter-copy-code\"><span class=\"syntax-highlighter-copy-code-title\" data-id=\"fusion_syntax_highlighter_23\" style=\"font-size:14px;\">Copy to Clipboard<\/span><\/div><label for=\"fusion_syntax_highlighter_23\" class=\"screen-reader-text\">Syntax Highlighter<\/label><textarea class=\"fusion-syntax-highlighter-textarea\" id=\"fusion_syntax_highlighter_23\" data-readOnly=\"nocursor\" data-lineNumbers=\"\" data-lineWrapping=\"\" data-theme=\"oceanic-next\" data-mode=\"text\/txt\">TrainOutput(global_step=1000, training_loss=&#8230;, metrics={&#8216;train_runtime&#8217;: &#8230;, &#8216;train_steps_per_second&#8217;: &#8230;, &#8216;total_flos&#8217;: 0.0, &#8216;train_loss&#8217;: &#8230;})<\/textarea><\/div><div class=\"fusion-text fusion-text-23\"><hr \/>\n<h2>Results<\/h2>\n<h3>8. Evaluating the Fine-Tuned Model<\/h3>\n<p>After training, the notebook tests the model&#8217;s ability to generate a new strategy (as a Python function). The fine-tuned model produces sophisticated strategies that analyze the game board, count empty cells, and identify possible merges:<\/p>\n<\/div><style type=\"text\/css\" scopped=\"scopped\">.fusion-syntax-highlighter-24 > .CodeMirror, .fusion-syntax-highlighter-24 > .CodeMirror .CodeMirror-gutters {background-color:#000000;}<\/style><div class=\"fusion-syntax-highlighter-container fusion-syntax-highlighter-24 fusion-syntax-highlighter-theme-dark\" style=\"opacity:0;margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0px;font-size:14px;border-width:1px;border-style:solid;border-color:rgba(242,243,245,0);\"><div class=\"syntax-highlighter-copy-code\"><span class=\"syntax-highlighter-copy-code-title\" data-id=\"fusion_syntax_highlighter_24\" style=\"font-size:14px;\">Copy to Clipboard<\/span><\/div><label for=\"fusion_syntax_highlighter_24\" class=\"screen-reader-text\">Syntax Highlighter<\/label><textarea class=\"fusion-syntax-highlighter-textarea\" id=\"fusion_syntax_highlighter_24\" data-readOnly=\"nocursor\" data-lineNumbers=\"\" data-lineWrapping=\"\" data-theme=\"oceanic-next\" data-mode=\"text\/x-sh\">def strategy(board):\n    def move(b, dir):\n        n = len(b)\n        new = [[0] * n for _ in range(n)]\n\n        for i in range(n):\n            if dir in (\"W\", \"S\"):\n                line = [b[j][i] for j in range(n) if b[j][i] != 0]\n\n                if dir == \"S\":\n                    line.reverse()\n            else:\n                line = [b[i][j] for j in range(n) if b[i][j] != 0]\n\n                if dir == \"D\":\n                    line.reverse()\n\n            merged = []\n            skip = False\n\n            for k in range(len(line)):\n                if skip:\n                    skip = False\n                    continue\n\n                if k + 1 < len(line) and line[k] == line[k + 1]:\n                    merged.append(line[k] * 2)\n                    skip = True\n                else:\n                    merged.append(line[k])\n\n            merged += [0] * (n - len(merged))\n\n            if dir in (\"W\", \"S\"):\n                for j in range(n):\n                    new[j][i] = merged[j] if dir == \"W\" else merged[n - 1 - j]\n            else:\n                for j in range(n):\n                    new[i][j] = merged[j] if dir == \"A\" else merged[n - 1 - j]\n\n        return new\n\n    def score(b):\n        n = len(b)\n\n        empties = sum(\n            1\n            for i in range(n)\n            for j in range(n)\n            if b[i][j] == 0\n        )\n\n        merges = 0\n\n        for i in range(n):\n            for j in range(n):\n                if b[i][j] != 0:\n                    if i + 1 if j + 1 > best_score:\n                        best_score = s\n                        best = d\n\n        return best if best else \"W\"<\/textarea><\/div><div class=\"fusion-text fusion-text-24\"><p>This strategy scores the number of empty cells and possible merge opportunities for each move and selects the highest-scoring move.<br \/>\nThis is a commonly used heuristic approach in the game 2048.<\/p>\n<hr \/>\n<h3>9. Shutdown<\/h3>\n<p>When you are done, exit the container with <code>exit<\/code>. First stop the Jupyter server with <code>Ctrl+C<\/code>.<br \/>\nThe container stops but the Docker image, model cache, and training outputs remain on disk.<br \/>\nTo resume training, simply run the <code>docker run<\/code> command from step 3 again.<\/p>\n<p>The unified memory usage during training is as follows:<\/p>\n<ul>\n<li><strong>Idle Spark<\/strong>\n<ul>\n<li><strong>Memory Usage:<\/strong> ~4 GB<\/li>\n<\/ul>\n<\/li>\n<li><strong>Model loaded (4-bit QLoRA)<\/strong>\n<ul>\n<li><strong>Memory Usage:<\/strong> ~17 GB GPU + ~1 GB embedding offload<\/li>\n<\/ul>\n<\/li>\n<li><strong>Training active<\/strong>\n<ul>\n<li><strong>Memory Usage:<\/strong> ~30 GB system total<\/li>\n<\/ul>\n<\/li>\n<li><strong>Free memory<\/strong>\n<ul>\n<li><strong>Memory Usage:<\/strong> ~90 GB<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<p>If the same training steps are applied to the <strong>GPT-OSS 120B<\/strong> model,<br \/>\napproximately <strong>68 GB of unified memory<\/strong> is used \u2014 which fits comfortably<br \/>\nwithin the DGX Spark&#8217;s <strong>128 GB unified memory<\/strong>.<\/p>\n<\/div><\/div><\/div><\/div><\/div><div class=\"fusion-fullwidth fullwidth-box fusion-builder-row-2 fusion-flex-container nonhundred-percent-fullwidth non-hundred-percent-height-scrolling\" style=\"--awb-border-radius-top-left:0px;--awb-border-radius-top-right:0px;--awb-border-radius-bottom-right:0px;--awb-border-radius-bottom-left:0px;--awb-flex-wrap:wrap;\" ><div class=\"fusion-builder-row fusion-row fusion-flex-align-items-flex-start fusion-flex-content-wrap\" style=\"max-width:1331.2px;margin-left: calc(-4% \/ 2 );margin-right: calc(-4% \/ 2 );\"><div class=\"fusion-layout-column fusion_builder_column fusion-builder-column-1 fusion_builder_column_1_1 1_1 fusion-flex-column\" style=\"--awb-bg-blend:overlay;--awb-bg-size:cover;--awb-width-large:100%;--awb-margin-top-large:0px;--awb-spacing-right-large:1.92%;--awb-margin-bottom-large:0px;--awb-spacing-left-large:1.92%;--awb-width-medium:100%;--awb-spacing-right-medium:1.92%;--awb-spacing-left-medium:1.92%;--awb-width-small:100%;--awb-spacing-right-small:1.92%;--awb-spacing-left-small:1.92%;\"><div class=\"fusion-column-wrapper fusion-flex-justify-content-flex-start fusion-content-layout-column\"><\/div><\/div><\/div><\/div><\/p>\n","protected":false},"excerpt":{"rendered":"","protected":false},"author":3,"featured_media":1931,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[17],"tags":[],"class_list":["post-1779","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-generative-ai"],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v25.3.1 (Yoast SEO v28.3) - https:\/\/yoast.com\/product\/yoast-seo-premium-wordpress\/ -->\n<title>Local Model Fine-Tuning with Unsloth on DGX Spark - OpenZeka EN Blog<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/blog.openzeka.com\/en\/local-model-fine-tuning-with-unsloth-on-dgx-spark\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Local Model Fine-Tuning with Unsloth on DGX Spark\" \/>\n<meta property=\"og:url\" content=\"https:\/\/blog.openzeka.com\/en\/local-model-fine-tuning-with-unsloth-on-dgx-spark\/\" \/>\n<meta property=\"og:site_name\" content=\"OpenZeka EN Blog\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/profile.php?id=61576911356211\" \/>\n<meta property=\"article:published_time\" content=\"2026-08-19T13:07:43+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/blog.openzeka.com\/en\/wp-content\/uploads\/2026\/08\/Local-Model-Fine-Tuning-with-Unsloth-on-DGX-Spark.webp\" \/>\n\t<meta property=\"og:image:width\" content=\"1920\" \/>\n\t<meta property=\"og:image:height\" content=\"1080\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/webp\" \/>\n<meta name=\"author\" content=\"Enhar\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@Aetherixnl\" \/>\n<meta name=\"twitter:site\" content=\"@Aetherixnl\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Enhar\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"7 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/blog.openzeka.com\\\/en\\\/local-model-fine-tuning-with-unsloth-on-dgx-spark\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/blog.openzeka.com\\\/en\\\/local-model-fine-tuning-with-unsloth-on-dgx-spark\\\/\"},\"author\":{\"name\":\"Enhar\",\"@id\":\"https:\\\/\\\/blog.openzeka.com\\\/en\\\/#\\\/schema\\\/person\\\/62c964376839cf2c4b2eb682bf14d3cb\"},\"headline\":\"Local Model Fine-Tuning with Unsloth on DGX Spark\",\"datePublished\":\"2026-08-19T13:07:43+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/blog.openzeka.com\\\/en\\\/local-model-fine-tuning-with-unsloth-on-dgx-spark\\\/\"},\"wordCount\":3543,\"publisher\":{\"@id\":\"https:\\\/\\\/blog.openzeka.com\\\/en\\\/#organization\"},\"image\":{\"@id\":\"https:\\\/\\\/blog.openzeka.com\\\/en\\\/local-model-fine-tuning-with-unsloth-on-dgx-spark\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/blog.openzeka.com\\\/en\\\/wp-content\\\/uploads\\\/2026\\\/08\\\/Local-Model-Fine-Tuning-with-Unsloth-on-DGX-Spark.webp\",\"articleSection\":[\"Generative AI\"],\"inLanguage\":\"en-US\"},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/blog.openzeka.com\\\/en\\\/local-model-fine-tuning-with-unsloth-on-dgx-spark\\\/\",\"url\":\"https:\\\/\\\/blog.openzeka.com\\\/en\\\/local-model-fine-tuning-with-unsloth-on-dgx-spark\\\/\",\"name\":\"Local Model Fine-Tuning with Unsloth on DGX Spark - OpenZeka EN Blog\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/blog.openzeka.com\\\/en\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/blog.openzeka.com\\\/en\\\/local-model-fine-tuning-with-unsloth-on-dgx-spark\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/blog.openzeka.com\\\/en\\\/local-model-fine-tuning-with-unsloth-on-dgx-spark\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/blog.openzeka.com\\\/en\\\/wp-content\\\/uploads\\\/2026\\\/08\\\/Local-Model-Fine-Tuning-with-Unsloth-on-DGX-Spark.webp\",\"datePublished\":\"2026-08-19T13:07:43+00:00\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/blog.openzeka.com\\\/en\\\/local-model-fine-tuning-with-unsloth-on-dgx-spark\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/blog.openzeka.com\\\/en\\\/local-model-fine-tuning-with-unsloth-on-dgx-spark\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/blog.openzeka.com\\\/en\\\/local-model-fine-tuning-with-unsloth-on-dgx-spark\\\/#primaryimage\",\"url\":\"https:\\\/\\\/blog.openzeka.com\\\/en\\\/wp-content\\\/uploads\\\/2026\\\/08\\\/Local-Model-Fine-Tuning-with-Unsloth-on-DGX-Spark.webp\",\"contentUrl\":\"https:\\\/\\\/blog.openzeka.com\\\/en\\\/wp-content\\\/uploads\\\/2026\\\/08\\\/Local-Model-Fine-Tuning-with-Unsloth-on-DGX-Spark.webp\",\"width\":1920,\"height\":1080},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/blog.openzeka.com\\\/en\\\/local-model-fine-tuning-with-unsloth-on-dgx-spark\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/blog.openzeka.com\\\/en\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Local Model Fine-Tuning with Unsloth on DGX Spark\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/blog.openzeka.com\\\/en\\\/#website\",\"url\":\"https:\\\/\\\/blog.openzeka.com\\\/en\\\/\",\"name\":\"Aetherix B.V.\",\"description\":\"NVIDIA Jetson Developer Kits &amp;Edge Devices\",\"publisher\":{\"@id\":\"https:\\\/\\\/blog.openzeka.com\\\/en\\\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/blog.openzeka.com\\\/en\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/blog.openzeka.com\\\/en\\\/#organization\",\"name\":\"Aetherix B.V.\",\"url\":\"https:\\\/\\\/blog.openzeka.com\\\/en\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/blog.openzeka.com\\\/en\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/blog.openzeka.com\\\/en\\\/wp-content\\\/uploads\\\/2025\\\/06\\\/aetherix-site-icon.webp\",\"contentUrl\":\"https:\\\/\\\/blog.openzeka.com\\\/en\\\/wp-content\\\/uploads\\\/2025\\\/06\\\/aetherix-site-icon.webp\",\"width\":421,\"height\":398,\"caption\":\"Aetherix B.V.\"},\"image\":{\"@id\":\"https:\\\/\\\/blog.openzeka.com\\\/en\\\/#\\\/schema\\\/logo\\\/image\\\/\"},\"sameAs\":[\"https:\\\/\\\/www.facebook.com\\\/profile.php?id=61576911356211\",\"https:\\\/\\\/x.com\\\/Aetherixnl\",\"https:\\\/\\\/www.instagram.com\\\/aetherixnl\\\/\",\"https:\\\/\\\/www.tiktok.com\\\/@aetherixnl\"],\"description\":\"Aetherix provides a full range of NVIDIA Jetson-based edge AI solutions\u2014including Developer Kits, AI Kits, industrial-grade Carrier Boards, and fully integrated Boxed AI Systems.\",\"email\":\"info@aetherix.com\",\"legalName\":\"Aetherix B.V.\",\"vatID\":\"NL867727688B01\"},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/blog.openzeka.com\\\/en\\\/#\\\/schema\\\/person\\\/62c964376839cf2c4b2eb682bf14d3cb\",\"name\":\"Enhar\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/189d567adce3bb0c8d438b4586bf861ec04980f2e451003975e3cf871781d0f4?s=96&d=mm&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/189d567adce3bb0c8d438b4586bf861ec04980f2e451003975e3cf871781d0f4?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/189d567adce3bb0c8d438b4586bf861ec04980f2e451003975e3cf871781d0f4?s=96&d=mm&r=g\",\"caption\":\"Enhar\"}}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"Local Model Fine-Tuning with Unsloth on DGX Spark - OpenZeka EN Blog","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/blog.openzeka.com\/en\/local-model-fine-tuning-with-unsloth-on-dgx-spark\/","og_locale":"en_US","og_type":"article","og_title":"Local Model Fine-Tuning with Unsloth on DGX Spark","og_url":"https:\/\/blog.openzeka.com\/en\/local-model-fine-tuning-with-unsloth-on-dgx-spark\/","og_site_name":"OpenZeka EN Blog","article_publisher":"https:\/\/www.facebook.com\/profile.php?id=61576911356211","article_published_time":"2026-08-19T13:07:43+00:00","og_image":[{"width":1920,"height":1080,"url":"https:\/\/blog.openzeka.com\/en\/wp-content\/uploads\/2026\/08\/Local-Model-Fine-Tuning-with-Unsloth-on-DGX-Spark.webp","type":"image\/webp"}],"author":"Enhar","twitter_card":"summary_large_image","twitter_creator":"@Aetherixnl","twitter_site":"@Aetherixnl","twitter_misc":{"Written by":"Enhar","Est. reading time":"7 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/blog.openzeka.com\/en\/local-model-fine-tuning-with-unsloth-on-dgx-spark\/#article","isPartOf":{"@id":"https:\/\/blog.openzeka.com\/en\/local-model-fine-tuning-with-unsloth-on-dgx-spark\/"},"author":{"name":"Enhar","@id":"https:\/\/blog.openzeka.com\/en\/#\/schema\/person\/62c964376839cf2c4b2eb682bf14d3cb"},"headline":"Local Model Fine-Tuning with Unsloth on DGX Spark","datePublished":"2026-08-19T13:07:43+00:00","mainEntityOfPage":{"@id":"https:\/\/blog.openzeka.com\/en\/local-model-fine-tuning-with-unsloth-on-dgx-spark\/"},"wordCount":3543,"publisher":{"@id":"https:\/\/blog.openzeka.com\/en\/#organization"},"image":{"@id":"https:\/\/blog.openzeka.com\/en\/local-model-fine-tuning-with-unsloth-on-dgx-spark\/#primaryimage"},"thumbnailUrl":"https:\/\/blog.openzeka.com\/en\/wp-content\/uploads\/2026\/08\/Local-Model-Fine-Tuning-with-Unsloth-on-DGX-Spark.webp","articleSection":["Generative AI"],"inLanguage":"en-US"},{"@type":"WebPage","@id":"https:\/\/blog.openzeka.com\/en\/local-model-fine-tuning-with-unsloth-on-dgx-spark\/","url":"https:\/\/blog.openzeka.com\/en\/local-model-fine-tuning-with-unsloth-on-dgx-spark\/","name":"Local Model Fine-Tuning with Unsloth on DGX Spark - OpenZeka EN Blog","isPartOf":{"@id":"https:\/\/blog.openzeka.com\/en\/#website"},"primaryImageOfPage":{"@id":"https:\/\/blog.openzeka.com\/en\/local-model-fine-tuning-with-unsloth-on-dgx-spark\/#primaryimage"},"image":{"@id":"https:\/\/blog.openzeka.com\/en\/local-model-fine-tuning-with-unsloth-on-dgx-spark\/#primaryimage"},"thumbnailUrl":"https:\/\/blog.openzeka.com\/en\/wp-content\/uploads\/2026\/08\/Local-Model-Fine-Tuning-with-Unsloth-on-DGX-Spark.webp","datePublished":"2026-08-19T13:07:43+00:00","breadcrumb":{"@id":"https:\/\/blog.openzeka.com\/en\/local-model-fine-tuning-with-unsloth-on-dgx-spark\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/blog.openzeka.com\/en\/local-model-fine-tuning-with-unsloth-on-dgx-spark\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/blog.openzeka.com\/en\/local-model-fine-tuning-with-unsloth-on-dgx-spark\/#primaryimage","url":"https:\/\/blog.openzeka.com\/en\/wp-content\/uploads\/2026\/08\/Local-Model-Fine-Tuning-with-Unsloth-on-DGX-Spark.webp","contentUrl":"https:\/\/blog.openzeka.com\/en\/wp-content\/uploads\/2026\/08\/Local-Model-Fine-Tuning-with-Unsloth-on-DGX-Spark.webp","width":1920,"height":1080},{"@type":"BreadcrumbList","@id":"https:\/\/blog.openzeka.com\/en\/local-model-fine-tuning-with-unsloth-on-dgx-spark\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/blog.openzeka.com\/en\/"},{"@type":"ListItem","position":2,"name":"Local Model Fine-Tuning with Unsloth on DGX Spark"}]},{"@type":"WebSite","@id":"https:\/\/blog.openzeka.com\/en\/#website","url":"https:\/\/blog.openzeka.com\/en\/","name":"Aetherix B.V.","description":"NVIDIA Jetson Developer Kits &amp;Edge Devices","publisher":{"@id":"https:\/\/blog.openzeka.com\/en\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/blog.openzeka.com\/en\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/blog.openzeka.com\/en\/#organization","name":"Aetherix B.V.","url":"https:\/\/blog.openzeka.com\/en\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/blog.openzeka.com\/en\/#\/schema\/logo\/image\/","url":"https:\/\/blog.openzeka.com\/en\/wp-content\/uploads\/2025\/06\/aetherix-site-icon.webp","contentUrl":"https:\/\/blog.openzeka.com\/en\/wp-content\/uploads\/2025\/06\/aetherix-site-icon.webp","width":421,"height":398,"caption":"Aetherix B.V."},"image":{"@id":"https:\/\/blog.openzeka.com\/en\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/profile.php?id=61576911356211","https:\/\/x.com\/Aetherixnl","https:\/\/www.instagram.com\/aetherixnl\/","https:\/\/www.tiktok.com\/@aetherixnl"],"description":"Aetherix provides a full range of NVIDIA Jetson-based edge AI solutions\u2014including Developer Kits, AI Kits, industrial-grade Carrier Boards, and fully integrated Boxed AI Systems.","email":"info@aetherix.com","legalName":"Aetherix B.V.","vatID":"NL867727688B01"},{"@type":"Person","@id":"https:\/\/blog.openzeka.com\/en\/#\/schema\/person\/62c964376839cf2c4b2eb682bf14d3cb","name":"Enhar","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/189d567adce3bb0c8d438b4586bf861ec04980f2e451003975e3cf871781d0f4?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/189d567adce3bb0c8d438b4586bf861ec04980f2e451003975e3cf871781d0f4?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/189d567adce3bb0c8d438b4586bf861ec04980f2e451003975e3cf871781d0f4?s=96&d=mm&r=g","caption":"Enhar"}}]}},"_links":{"self":[{"href":"https:\/\/blog.openzeka.com\/en\/wp-json\/wp\/v2\/posts\/1779","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.openzeka.com\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.openzeka.com\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.openzeka.com\/en\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.openzeka.com\/en\/wp-json\/wp\/v2\/comments?post=1779"}],"version-history":[{"count":21,"href":"https:\/\/blog.openzeka.com\/en\/wp-json\/wp\/v2\/posts\/1779\/revisions"}],"predecessor-version":[{"id":1919,"href":"https:\/\/blog.openzeka.com\/en\/wp-json\/wp\/v2\/posts\/1779\/revisions\/1919"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/blog.openzeka.com\/en\/wp-json\/wp\/v2\/media\/1931"}],"wp:attachment":[{"href":"https:\/\/blog.openzeka.com\/en\/wp-json\/wp\/v2\/media?parent=1779"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.openzeka.com\/en\/wp-json\/wp\/v2\/categories?post=1779"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.openzeka.com\/en\/wp-json\/wp\/v2\/tags?post=1779"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}