<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Egor Kosaretskiy</title>
    <description>The latest articles on DEV Community by Egor Kosaretskiy (@thatbagu).</description>
    <link>https://dev.to/thatbagu</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F3582354%2Fbd3f66a2-dcf5-4265-8eb1-80acae36a2f5.jpeg</url>
      <title>DEV Community: Egor Kosaretskiy</title>
      <link>https://dev.to/thatbagu</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/thatbagu"/>
    <language>en</language>
    <item>
      <title>High velocity ML development with Nix and AWS</title>
      <dc:creator>Egor Kosaretskiy</dc:creator>
      <pubDate>Fri, 26 Jun 2026 20:02:20 +0000</pubDate>
      <link>https://dev.to/thatbagu/high-velocity-ml-development-with-nix-and-aws-4cd7</link>
      <guid>https://dev.to/thatbagu/high-velocity-ml-development-with-nix-and-aws-4cd7</guid>
      <description>&lt;p&gt;&lt;em&gt;&lt;a href="https://github.com/thatbagu/nix-ml-solo" rel="noopener noreferrer"&gt;GitHub&lt;/a&gt; | &lt;a href="https://mlship.dev/assets/blog/nix-ml-solo-talk.pdf" rel="noopener noreferrer"&gt;Download slides if you have been to my talk&lt;/a&gt;&lt;/em&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  The need for speed
&lt;/h2&gt;

&lt;p&gt;Over the past several years I have developed severe ADHD by consuming short-form content. Instead of fixing it by exercising proper habits, meditating, or whatever, I decided to lean into it. I read somewhere that ADHD also comes with superpowers: it is possible to catch a flow state (hyperfocus) where you can concentrate on something long enough to actually get things done. But this flow is fragile. It needs a constant feeling of speed and forward momentum.&lt;/p&gt;

&lt;p&gt;Preserving that state pushed me to eliminate every break and barrier between a thought and actual code running on a machine. A couple of years ago I kept catching myself distracted and unable to write code even when my head was already running, so I invested time, money, and skill into a split keyboard and blind typing on the Miryoku layout. Then it bothered me that navigating an IDE was slow and forced me to keep track of where everything lives and how to configure and run things, so I built my own editor with Neovim. Even then, developing on common Linux distros like Ubuntu felt inefficient: installed packages quickly polluted the system, projects conflicted over different dependency versions, and there was no guarantee you could reproduce your environment if you came back to a project months later. That is when I discovered Nix and rebuilt my system, declarative, reproducible, and easy to manage. Local development became nearly frictionless. The obvious next step was bringing that same fluidity to the cloud.&lt;/p&gt;

&lt;h2&gt;
  
  
  The idea: unified environments
&lt;/h2&gt;

&lt;p&gt;I finally decided it was time to make Nix work on the cloud for my ML applications. Nix is built around reproducibility and seamless environments that are quick to spin up, and that property should hold equally well on a remote instance as on a local machine. This is the central idea behind nix-ml-solo: a fully unified environment between any cloud resource and any local machine, so a data scientist never has to think about which machine they are developing on.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;devenv.nix&lt;/code&gt; is the single source of truth. Change values here and they flow everywhere: Terraform resource names, S3 buckets, ports.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight nix"&gt;&lt;code&gt;&lt;span class="kd"&gt;let&lt;/span&gt;
  &lt;span class="nv"&gt;project&lt;/span&gt;       &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"nix-ml-solo"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;   &lt;span class="c"&gt;# all AWS resource names derive from this&lt;/span&gt;
  &lt;span class="nv"&gt;environment&lt;/span&gt;   &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"dev"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nv"&gt;mlflowPort&lt;/span&gt;    &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;5000&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nv"&gt;jupyterPort&lt;/span&gt;   &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;8888&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nv"&gt;inferencePort&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;5001&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="kn"&gt;in&lt;/span&gt;
&lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="o"&gt;...&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Switching from local development to a full cloud setup is one line:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight nix"&gt;&lt;code&gt;&lt;span class="c"&gt;# env.INFRA_MODE = "cloud";  # uncomment this&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In local mode everything runs on your machine and AWS costs are essentially zero (S3 only). Flip to cloud and the same environment materializes on an EC2 NixOS VM and inside SageMaker containers, bit-for-bit identical, because they all share the same Nix closure. MLflow runs on EC2 and is accessed via SSH tunnel, so your tracking URI stays &lt;code&gt;localhost:5000&lt;/code&gt; regardless of where the training job actually runs. DVC handles data through an S3 remote that both your laptop and SageMaker pull from directly.&lt;/p&gt;

&lt;h2&gt;
  
  
  Architecture
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F8k91t6f0432ohyfa2ueb.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F8k91t6f0432ohyfa2ueb.png" alt="nix-ml-solo architecture" width="800" height="537"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  The stack
&lt;/h2&gt;

&lt;p&gt;The setup is intentionally minimal but fully viable: MLflow + DVC + SageMaker. Experiment, log, deploy. I think this is the core MVP for any ML workflow. Pipeline orchestration, feature engineering, and data ops are on the roadmap. The project is open source at &lt;a href="https://github.com/thatbagu/nix-ml-solo" rel="noopener noreferrer"&gt;github.com/thatbagu/nix-ml-solo&lt;/a&gt;.&lt;/p&gt;

</description>
    </item>
  </channel>
</rss>
