<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:itunes="http://www.itunes.com/dtds/podcast-1.0.dtd" xmlns:googleplay="http://www.google.com/schemas/play-podcasts/1.0"><channel><title><![CDATA[Prasad Z]]></title><description><![CDATA[Prasad Z]]></description><link>https://magazine.prasadzende.me</link><image><url>https://magazine.prasadzende.me/img/substack.png</url><title>Prasad Z</title><link>https://magazine.prasadzende.me</link></image><generator>Substack</generator><lastBuildDate>Sun, 14 Jun 2026 17:39:25 GMT</lastBuildDate><atom:link href="https://magazine.prasadzende.me/feed" rel="self" type="application/rss+xml"/><copyright><![CDATA[Prasad Z]]></copyright><language><![CDATA[en]]></language><webMaster><![CDATA[prasadz97@substack.com]]></webMaster><itunes:owner><itunes:email><![CDATA[prasadz97@substack.com]]></itunes:email><itunes:name><![CDATA[Prasad Z]]></itunes:name></itunes:owner><itunes:author><![CDATA[Prasad Z]]></itunes:author><googleplay:owner><![CDATA[prasadz97@substack.com]]></googleplay:owner><googleplay:email><![CDATA[prasadz97@substack.com]]></googleplay:email><googleplay:author><![CDATA[Prasad Z]]></googleplay:author><itunes:block><![CDATA[Yes]]></itunes:block><item><title><![CDATA[From Tokens to Tensors: An Engineer's Deep Dive into LLM Inference Performance]]></title><description><![CDATA[Moving beyond the API: How understanding the silicon-level processing can shave seconds off your inference latency]]></description><link>https://magazine.prasadzende.me/p/from-tokens-to-tensors-an-engineers</link><guid isPermaLink="false">https://magazine.prasadzende.me/p/from-tokens-to-tensors-an-engineers</guid><dc:creator><![CDATA[Prasad Z]]></dc:creator><pubDate>Sun, 26 Apr 2026 14:45:10 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!ftke!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9e997a28-282a-49ac-9da4-8b479228442a_1376x768.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!ftke!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9e997a28-282a-49ac-9da4-8b479228442a_1376x768.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!ftke!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9e997a28-282a-49ac-9da4-8b479228442a_1376x768.png 424w, https://substackcdn.com/image/fetch/$s_!ftke!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9e997a28-282a-49ac-9da4-8b479228442a_1376x768.png 848w, https://substackcdn.com/image/fetch/$s_!ftke!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9e997a28-282a-49ac-9da4-8b479228442a_1376x768.png 1272w, https://substackcdn.com/image/fetch/$s_!ftke!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9e997a28-282a-49ac-9da4-8b479228442a_1376x768.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!ftke!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9e997a28-282a-49ac-9da4-8b479228442a_1376x768.png" width="1376" height="768" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/9e997a28-282a-49ac-9da4-8b479228442a_1376x768.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:768,&quot;width&quot;:1376,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:877658,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:true,&quot;internalRedirect&quot;:&quot;https://magazine.prasadzende.me/i/195517970?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9e997a28-282a-49ac-9da4-8b479228442a_1376x768.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!ftke!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9e997a28-282a-49ac-9da4-8b479228442a_1376x768.png 424w, https://substackcdn.com/image/fetch/$s_!ftke!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9e997a28-282a-49ac-9da4-8b479228442a_1376x768.png 848w, https://substackcdn.com/image/fetch/$s_!ftke!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9e997a28-282a-49ac-9da4-8b479228442a_1376x768.png 1272w, https://substackcdn.com/image/fetch/$s_!ftke!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9e997a28-282a-49ac-9da4-8b479228442a_1376x768.png 1456w" sizes="100vw" fetchpriority="high"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>As engineers, we often interact with Large Language Models (LLMs) via a simple POST request to an API endpoint. We send a string, and a few hundred milliseconds later, we get a response. But for those building production-grade AI applications, the &#8220;black box&#8221; approach isn&#8217;t enough.</p><p>To optimize for latency (TTFT), throughput (TPS), and cost, we have to peel back the layers of the Transformer architecture. We need to understand why the decoding phase is a memory hog, how tokenization can break your logic, and why the KV cache is the most important piece of memory you&#8217;re currently managing.</p><div><hr></div><h3>The Architecture Debate: Why &#8220;Decoder-Only&#8221; Won</h3><p>When the Transformer was first introduced in the <a href="https://arxiv.org/pdf/1706.03762">Attention is All You Need</a> paper, it was a symmetrical beast: an Encoder to understand the input and a Decoder to generate the output.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!77JH!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff9a2caff-60e1-4858-9d45-4cca54268bc9_756x474.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!77JH!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff9a2caff-60e1-4858-9d45-4cca54268bc9_756x474.png 424w, https://substackcdn.com/image/fetch/$s_!77JH!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff9a2caff-60e1-4858-9d45-4cca54268bc9_756x474.png 848w, https://substackcdn.com/image/fetch/$s_!77JH!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff9a2caff-60e1-4858-9d45-4cca54268bc9_756x474.png 1272w, https://substackcdn.com/image/fetch/$s_!77JH!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff9a2caff-60e1-4858-9d45-4cca54268bc9_756x474.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!77JH!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff9a2caff-60e1-4858-9d45-4cca54268bc9_756x474.png" width="756" height="474" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/f9a2caff-60e1-4858-9d45-4cca54268bc9_756x474.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:474,&quot;width&quot;:756,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!77JH!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff9a2caff-60e1-4858-9d45-4cca54268bc9_756x474.png 424w, https://substackcdn.com/image/fetch/$s_!77JH!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff9a2caff-60e1-4858-9d45-4cca54268bc9_756x474.png 848w, https://substackcdn.com/image/fetch/$s_!77JH!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff9a2caff-60e1-4858-9d45-4cca54268bc9_756x474.png 1272w, https://substackcdn.com/image/fetch/$s_!77JH!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ff9a2caff-60e1-4858-9d45-4cca54268bc9_756x474.png 1456w" sizes="100vw"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a><figcaption class="image-caption">Source: <a href="https://jalammar.github.io/illustrated-transformer/">The Illustrated Transformers</a></figcaption></figure></div><p>However, the industry has largely converged on the Decoder-only architecture (think GPT-4, Llama 3, and Mistral). Why?</p><ul><li><p><strong>Encoders (e.g., BERT, RoBERTa):</strong> These use &#8220;bi-directional&#8221; attention. They look at every word in a sentence simultaneously to create a dense representation (embedding). They are king for classification and NER but lack the fluid generative capabilities of their counterparts.</p></li><li><p><strong>Encoder-Decoders (e.g., T5, BART):</strong> These were the standard for translation. The encoder processes the source language, and the decoder generates the target.</p></li><li><p><strong>Decoder-Only:</strong> These use &#8220;causal&#8221; or &#8220;masked&#8221; attention. They only look at previous tokens in a sequence. Through massive scaling, we&#8217;ve discovered that these models don&#8217;t actually need a separate encoder. They can derive the context of a prompt and generate a response within the same mathematical framework. This simplifies the inference pipeline, making it easier to scale on modern GPU clusters.</p></li></ul><div><hr></div><h3>Tokenization: The &#8220;Lossy&#8221; Bridge to Math</h3><p>LLMs do not process strings; they process tensors of floating-point numbers. The first engineering hurdle is Tokenization.</p><h4>Subword Tokenization vs. Character Level</h4><p>A naive approach would be to assign an integer to every word. But dictionaries are infinite, and typos are common. If your model encounters a word it hasn&#8217;t seen (an &#8220;Out of Vocabulary&#8221; or OOV error), the system fails.</p><p>Modern LLMs use Subword Tokenization (like Byte-Pair Encoding or WordPiece). This breaks text into the smallest meaningful chunks.</p><blockquote><p><strong>Example:</strong> The word <em><strong>regularization</strong></em> might be tokenized as <code>[</code><em><strong>regular</strong></em><code>, </code><em><strong>ization</strong></em><code>]</code>.</p><p><strong>Example:</strong> The suffix <strong>er</strong> is a common token. This allows the model to <code>h</code>a<code>nd</code>l<code>e </code><em><strong>tall</strong>, <strong>taller</strong></em> <code>a</code>n<code>d</code> <em><strong>tallest</strong></em> b<code>y</code> r<code>eusin</code>g <code>t</code>h<code>e</code> <em><strong>e</strong></em> <code>a</code>n<code>d</code> <em><strong>est</strong></em> tokens, keeping the vocabulary size manageable (usually between 32k and 128k tokens).</p></blockquote><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!E6YN!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F86e1ebfd-7714-45a3-a270-6b93c354698d_2208x790.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!E6YN!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F86e1ebfd-7714-45a3-a270-6b93c354698d_2208x790.png 424w, https://substackcdn.com/image/fetch/$s_!E6YN!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F86e1ebfd-7714-45a3-a270-6b93c354698d_2208x790.png 848w, https://substackcdn.com/image/fetch/$s_!E6YN!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F86e1ebfd-7714-45a3-a270-6b93c354698d_2208x790.png 1272w, https://substackcdn.com/image/fetch/$s_!E6YN!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F86e1ebfd-7714-45a3-a270-6b93c354698d_2208x790.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!E6YN!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F86e1ebfd-7714-45a3-a270-6b93c354698d_2208x790.png" width="1456" height="521" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/86e1ebfd-7714-45a3-a270-6b93c354698d_2208x790.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:521,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:2274994,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://magazine.prasadzende.me/i/195517970?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F86e1ebfd-7714-45a3-a270-6b93c354698d_2208x790.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!E6YN!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F86e1ebfd-7714-45a3-a270-6b93c354698d_2208x790.png 424w, https://substackcdn.com/image/fetch/$s_!E6YN!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F86e1ebfd-7714-45a3-a270-6b93c354698d_2208x790.png 848w, https://substackcdn.com/image/fetch/$s_!E6YN!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F86e1ebfd-7714-45a3-a270-6b93c354698d_2208x790.png 1272w, https://substackcdn.com/image/fetch/$s_!E6YN!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F86e1ebfd-7714-45a3-a270-6b93c354698d_2208x790.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><blockquote><div><hr></div></blockquote><h3>The Engineer&#8217;s Token Tax</h3><p>As an engineer, you must remember that 1 token ~= 0.75 words (or roughly 4 characters in English). However, tokenizers are model-specific. If you use a Llama-3 tokenizer to estimate the cost for a GPT-4o request, your math will be wrong. This is particularly critical when building &#8220;RAG&#8221; (Retrieval-Augmented Generation) systems where you are stuffing thousands of tokens of context into a prompt, every token counts toward your rate limits and your bill.</p><div><hr></div><h3>Embeddings and the High-Dimensional Galaxy</h3><p>Once we have our list of token IDs, we move to the Embedding Layer.</p><p>Imagine a map. On a 2D map, &#8220;Paris&#8221; and &#8220;London&#8221; are close together. In an LLM, we use a &#8220;map&#8221; with thousands of dimensions. Each token ID is mapped to a vector in this high-dimensional space.</p><p>Semantic Proximity is the goal here. The vector for <em>Queen</em> <code>should</code> <code>be</code> <code>clos</code><em>e</em><code>r</code> <code>to </code><em>King </em>than it is to <em>Toaster</em>. During the training phase, the model learns these relationships. In inference, these &#8220;static&#8221; embeddings are fed into the Transformer blocks where Self-Attention transforms them into Contextual Embeddings.</p><p>This is how the model knows that the word &#8220;Java&#8221; in a blog about programming is different from &#8220;Java&#8221; in a blog about coffee. The surrounding vectors pull the &#8220;Java&#8221; vector toward the &#8220;Programming&#8221; cluster in that high-dimensional space.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!05KT!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5903596f-0574-497a-adb3-e3701898333e_1084x1018.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!05KT!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5903596f-0574-497a-adb3-e3701898333e_1084x1018.png 424w, https://substackcdn.com/image/fetch/$s_!05KT!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5903596f-0574-497a-adb3-e3701898333e_1084x1018.png 848w, https://substackcdn.com/image/fetch/$s_!05KT!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5903596f-0574-497a-adb3-e3701898333e_1084x1018.png 1272w, https://substackcdn.com/image/fetch/$s_!05KT!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5903596f-0574-497a-adb3-e3701898333e_1084x1018.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!05KT!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5903596f-0574-497a-adb3-e3701898333e_1084x1018.png" width="1084" height="1018" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/5903596f-0574-497a-adb3-e3701898333e_1084x1018.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:1018,&quot;width&quot;:1084,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:1439769,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://magazine.prasadzende.me/i/195517970?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5903596f-0574-497a-adb3-e3701898333e_1084x1018.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!05KT!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5903596f-0574-497a-adb3-e3701898333e_1084x1018.png 424w, https://substackcdn.com/image/fetch/$s_!05KT!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5903596f-0574-497a-adb3-e3701898333e_1084x1018.png 848w, https://substackcdn.com/image/fetch/$s_!05KT!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5903596f-0574-497a-adb3-e3701898333e_1084x1018.png 1272w, https://substackcdn.com/image/fetch/$s_!05KT!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5903596f-0574-497a-adb3-e3701898333e_1084x1018.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><div><hr></div><h3>Positional Embeddings: Teaching the Model to Read</h3><p>A massive quirk of the Transformer architecture is that it is &#8220;permutation invariant.&#8221; Because the attention mechanism calculates the relationship between all tokens in a set simultaneously, the model has no innate way of knowing if &#8220;Dog bites Man&#8221; or &#8220;Man bites Dog.&#8221;</p><p>To solve this, we use Positional Embeddings. This involves injecting information about the specific position of each token in the sequence into the vector.</p><ul><li><p><strong>Sinusoidal Embeddings:</strong> The original method used sine and cosine functions of different frequencies.</p></li><li><p><strong>RoPE (Rotary Positional Embeddings):</strong> Used by modern models like Llama. Instead of adding a vector, it rotates the embedding in the high-dimensional space. This allows for better &#8220;extrapolation,&#8221; meaning the model can sometimes handle sequences longer than those it was trained on.</p></li></ul><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!GgHK!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5c21514a-e957-4e3a-8e8c-3da7e033caad_2286x756.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!GgHK!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5c21514a-e957-4e3a-8e8c-3da7e033caad_2286x756.png 424w, https://substackcdn.com/image/fetch/$s_!GgHK!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5c21514a-e957-4e3a-8e8c-3da7e033caad_2286x756.png 848w, https://substackcdn.com/image/fetch/$s_!GgHK!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5c21514a-e957-4e3a-8e8c-3da7e033caad_2286x756.png 1272w, https://substackcdn.com/image/fetch/$s_!GgHK!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5c21514a-e957-4e3a-8e8c-3da7e033caad_2286x756.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!GgHK!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5c21514a-e957-4e3a-8e8c-3da7e033caad_2286x756.png" width="1456" height="482" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/5c21514a-e957-4e3a-8e8c-3da7e033caad_2286x756.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:482,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:1581557,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://magazine.prasadzende.me/i/195517970?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5c21514a-e957-4e3a-8e8c-3da7e033caad_2286x756.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!GgHK!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5c21514a-e957-4e3a-8e8c-3da7e033caad_2286x756.png 424w, https://substackcdn.com/image/fetch/$s_!GgHK!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5c21514a-e957-4e3a-8e8c-3da7e033caad_2286x756.png 848w, https://substackcdn.com/image/fetch/$s_!GgHK!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5c21514a-e957-4e3a-8e8c-3da7e033caad_2286x756.png 1272w, https://substackcdn.com/image/fetch/$s_!GgHK!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5c21514a-e957-4e3a-8e8c-3da7e033caad_2286x756.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><div><hr></div><h3>The Two Phases of Inference: Prefill and Decode</h3><p>This is where the engineering complexity peaks. LLM inference is not a single, monolithic task; it is a tale of two phases with completely different hardware requirements.</p><h4>Phase 1: The Prefill (Compute-Bound)</h4><p>When you send a prompt, the model first processes the entire input. This is the Prefill Phase.</p><ul><li><p><strong>What happens:</strong> The model takes all &#8220;N&#8221; tokens of your prompt and calculates their hidden states in parallel.</p></li><li><p><strong>The Bottleneck:</strong> This is compute-bound. It depends on how many TeraFLOPS your GPU can push.</p></li><li><p><strong>The Metric:</strong> This phase determines your Time to First Token (TTFT). If you have a massive prompt, the prefill takes longer, but modern GPUs are highly optimized for this parallel matrix multiplication.</p></li></ul><h4>Phase 2: The Decode (Memory-Bound)</h4><p>Once the first token is generated, the model enters the Decoding Phase. Because LLMs are autoregressive, they generate one token at a time. To generate token #51, the model must look at tokens #1 through #50.</p><ul><li><p><strong>What happens:</strong> The model does a single forward pass for one single token.</p></li><li><p><strong>The Bottleneck:</strong> This is memory-bound. You aren&#8217;t limited by how fast the GPU can calculate; you are limited by how fast the GPU can move the model weights and the &#8220;KV Cache&#8221; from VRAM to the processing cores.</p></li><li><p><strong>The Metric:</strong> This determines your Tokens Per Second (TPS).</p></li></ul><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!nD99!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5587042e-690f-4533-8fa4-a53cfdcc5425_1228x440.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!nD99!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5587042e-690f-4533-8fa4-a53cfdcc5425_1228x440.png 424w, https://substackcdn.com/image/fetch/$s_!nD99!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5587042e-690f-4533-8fa4-a53cfdcc5425_1228x440.png 848w, https://substackcdn.com/image/fetch/$s_!nD99!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5587042e-690f-4533-8fa4-a53cfdcc5425_1228x440.png 1272w, https://substackcdn.com/image/fetch/$s_!nD99!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5587042e-690f-4533-8fa4-a53cfdcc5425_1228x440.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!nD99!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5587042e-690f-4533-8fa4-a53cfdcc5425_1228x440.png" width="1228" height="440" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/5587042e-690f-4533-8fa4-a53cfdcc5425_1228x440.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:440,&quot;width&quot;:1228,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:223652,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://magazine.prasadzende.me/i/195517970?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5587042e-690f-4533-8fa4-a53cfdcc5425_1228x440.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!nD99!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5587042e-690f-4533-8fa4-a53cfdcc5425_1228x440.png 424w, https://substackcdn.com/image/fetch/$s_!nD99!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5587042e-690f-4533-8fa4-a53cfdcc5425_1228x440.png 848w, https://substackcdn.com/image/fetch/$s_!nD99!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5587042e-690f-4533-8fa4-a53cfdcc5425_1228x440.png 1272w, https://substackcdn.com/image/fetch/$s_!nD99!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5587042e-690f-4533-8fa4-a53cfdcc5425_1228x440.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><div><hr></div><h3>The KV Cache: Solving the Quadratic Problem</h3><p>The &#8220;Self-Attention&#8221; mechanism in Transformers has a major flaw: its computational cost grows quadratically O(n^2) with the sequence length. If you don&#8217;t optimize this, generating the 2,000th token would require re-calculating the attention for all 1,999 previous tokens.</p><p>To solve this, we use the KV (Key-Value) Cache.</p><p>We store the previously calculated &#8220;Key&#8221; and &#8220;Value&#8221; vectors in the GPU&#8217;s VRAM. When it&#8217;s time to generate the next token, the model simply fetches these from the cache instead of recomputing them.</p><div><hr></div><h3>PagedAttention and vLLM</h3><p>Storing this cache is expensive. For a large model with a long context, the KV cache can consume tens of gigabytes of VRAM. Historically, this required contiguous memory, which led to massive fragmentation (the &#8220;OOM&#8221; or Out of Memory error we all dread).</p><p>The breakthrough came with PagedAttention (implemented in frameworks like <code>vLLM</code>). It borrows a concept from Operating Systems: virtual memory paging. It breaks the KV cache into small, non-contiguous blocks. This allows for:</p><ol><li><p><strong>Near-zero memory waste.</strong></p></li><li><p><strong>Continuous Batching:</strong> Processing multiple requests at once even if they finish at different times.</p></li><li><p><strong>Prefix Sharing:</strong> If ten users are asking questions about the same long document, the model only stores the KV cache for that document <em>once</em>, saving massive amounts of VRAM.</p></li></ol><div><hr></div><h3>The &#8220;Hidden&#8221; Logic: Sampling and Temperature</h3><p>After the model does its math, it doesn&#8217;t actually output a word. It outputs a Logits vector, a list of probabilities for every single token in its vocabulary.</p><p>If the vocabulary is 50,000 words, the model says: &#8220;There is a 40% chance the next word is &#8216;Apple&#8217;, a 20% chance it&#8217;s &#8216;Banana&#8217;, and a 0.001% chance it&#8217;s &#8216;Nuclear&#8217;.&#8221;</p><p>Engineers guide this selection using Sampling Parameters:</p><ul><li><p><strong>Temperature:</strong> High temperature flattens the probability distribution (making the &#8220;Nuclear&#8221; option more likely), leading to more creative or &#8220;hallucinatory&#8221; text. Low temperature (approaching 0) makes the model &#8220;greedy,&#8221; always picking the #1 choice.</p></li><li><p><strong>Top-P (Nucleus Sampling):</strong> The model only considers the smallest set of tokens whose cumulative probability exceeds &#8216;P&#8217;.</p></li><li><p><strong>Top-K:</strong> The model only considers the top 'K&#8217; most likely tokens.</p></li></ul><div><hr></div><h3>The Multimodal Future</h3><p>The text you provided mentions that modern LLMs are becoming multimodal. For an AI engineer, this means the inference pipeline is getting more complex. We aren&#8217;t just tokenizing text anymore; we are using Vision Encoders (like CLIP) to turn images into patches. These patches are then mapped into the same embedding space as our text tokens.</p><p>Whether the input is a JPEG or a string of Python code, it eventually becomes a sequence of vectors that the Transformer processes using the same attention mechanism. This is why &#8220;Large Language Models&#8221; is becoming a bit of a misnomer, they are increasingly &#8220;Large Multimodal Action Models.&#8221;</p><div><hr></div><h3>Final Thoughts for the engineers</h3><p>Understanding the inference pipeline is the difference between a prototype that works on your local machine and a production system that scales to thousands of users.</p><p><strong>Key Takeaways:</strong></p><ol><li><p><strong>Optimize your Prefill:</strong> Use shorter prompts or KV-cache sharing to reduce TTFT.</p></li><li><p><strong>Watch your VRAM:</strong> The KV cache is your biggest bottleneck for high-concurrency systems.</p></li><li><p><strong>Choose the right runtime:</strong> Don&#8217;t just run raw PyTorch in production. Use specialized inference engines like <code>vLLM</code>, <code>TGI</code> (Text Generation Inference), or <code>TensorRT-LLM</code>.</p></li></ol><p><strong>What&#8217;s your current stack for LLM inference? Are you hitting memory limits or compute limits? Let&#8217;s troubleshoot in the comments below.</strong></p><div><hr></div><h3>References</h3><p><strong>PagedAttention &amp; vLLM:</strong> <em>Kwon, W., et al. (2023). &#8220;Efficient Memory Management for Large Language Model Serving with PagedAttention.&#8221;</em> The foundational paper for the vLLM project that revolutionized KV cache management.</p><p><strong>Disaggregated Inference:</strong> <em>Microsoft Research (2024). &#8220;Splitwise: Efficient Generative LLM Inference Using Phase Splitting.&#8221;</em> A key paper discussing the physical separation of Prefill and Decode phases.</p><p><strong>Jay Alammar&#8217;s &#8220;The Illustrated Word2vec&#8221;:</strong> <a href="https://jalammar.github.io/illustrated-word2vec/">jalammar.github.io</a>. One of the best visual explanations of how high-dimensional word embeddings work.</p><p><strong>The Illustrated Transformer:</strong> <a href="https://jalammar.github.io/illustrated-transformer/">jalammar.github.io</a>. A visual breakdown of the encoder-decoder mechanics that paved the way for modern LLMs.</p><div class="subscription-widget-wrap-editor" data-attrs="{&quot;url&quot;:&quot;https://magazine.prasadzende.me/subscribe?&quot;,&quot;text&quot;:&quot;Subscribe&quot;,&quot;language&quot;:&quot;en&quot;}" data-component-name="SubscribeWidgetToDOM"><div class="subscription-widget show-subscribe"><div class="preamble"><p class="cta-caption">This Substack is reader-supported. To receive new posts and support my work, consider becoming a free or paid subscriber.</p></div><form class="subscription-widget-subscribe"><input type="email" class="email-input" name="email" placeholder="Type your email&#8230;" tabindex="-1"><input type="submit" class="button primary" value="Subscribe"><div class="fake-input-wrapper"><div class="fake-input"></div><div class="fake-button"></div></div></form></div></div>]]></content:encoded></item><item><title><![CDATA[How to deploy Kubeflow on AWS EKS]]></title><description><![CDATA[This article is aimed at anyone who is trying to install Kubeflow on AWS.]]></description><link>https://magazine.prasadzende.me/p/how-to-deploy-kubeflow-on-aws-eks</link><guid isPermaLink="false">https://magazine.prasadzende.me/p/how-to-deploy-kubeflow-on-aws-eks</guid><dc:creator><![CDATA[Prasad Z]]></dc:creator><pubDate>Fri, 04 Feb 2022 15:59:00 GMT</pubDate><enclosure url="https://substack-post-media.s3.amazonaws.com/public/images/283bf948-4449-4d20-bc8e-e60b2c1bcf97_1600x771.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!WyFI!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdff68fe9-f8a8-48e4-b2fc-75106a69d907_1600x771.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!WyFI!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdff68fe9-f8a8-48e4-b2fc-75106a69d907_1600x771.png 424w, https://substackcdn.com/image/fetch/$s_!WyFI!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdff68fe9-f8a8-48e4-b2fc-75106a69d907_1600x771.png 848w, https://substackcdn.com/image/fetch/$s_!WyFI!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdff68fe9-f8a8-48e4-b2fc-75106a69d907_1600x771.png 1272w, https://substackcdn.com/image/fetch/$s_!WyFI!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdff68fe9-f8a8-48e4-b2fc-75106a69d907_1600x771.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!WyFI!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdff68fe9-f8a8-48e4-b2fc-75106a69d907_1600x771.png" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/dff68fe9-f8a8-48e4-b2fc-75106a69d907_1600x771.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:null,&quot;width&quot;:null,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;&quot;,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:true,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" title="" srcset="https://substackcdn.com/image/fetch/$s_!WyFI!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdff68fe9-f8a8-48e4-b2fc-75106a69d907_1600x771.png 424w, https://substackcdn.com/image/fetch/$s_!WyFI!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdff68fe9-f8a8-48e4-b2fc-75106a69d907_1600x771.png 848w, https://substackcdn.com/image/fetch/$s_!WyFI!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdff68fe9-f8a8-48e4-b2fc-75106a69d907_1600x771.png 1272w, https://substackcdn.com/image/fetch/$s_!WyFI!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdff68fe9-f8a8-48e4-b2fc-75106a69d907_1600x771.png 1456w" sizes="100vw" fetchpriority="high"></picture><div></div></div></a></figure></div><p>This article is aimed at anyone who is trying to install Kubeflow on AWS. If you have tried installing Kubeflow, then you might have come across several errors, and to finally get Kubeflow working on AWS cloud, it took me a couple of attempts.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!UMEN!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd7ed4b95-7938-4c10-bcf9-6a0442be75b3_272x341.jpeg" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!UMEN!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd7ed4b95-7938-4c10-bcf9-6a0442be75b3_272x341.jpeg 424w, https://substackcdn.com/image/fetch/$s_!UMEN!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd7ed4b95-7938-4c10-bcf9-6a0442be75b3_272x341.jpeg 848w, https://substackcdn.com/image/fetch/$s_!UMEN!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd7ed4b95-7938-4c10-bcf9-6a0442be75b3_272x341.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!UMEN!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd7ed4b95-7938-4c10-bcf9-6a0442be75b3_272x341.jpeg 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!UMEN!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd7ed4b95-7938-4c10-bcf9-6a0442be75b3_272x341.jpeg" width="273" height="341" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/d7ed4b95-7938-4c10-bcf9-6a0442be75b3_272x341.jpeg&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:341,&quot;width&quot;:273,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;&quot;,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" title="" srcset="https://substackcdn.com/image/fetch/$s_!UMEN!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd7ed4b95-7938-4c10-bcf9-6a0442be75b3_272x341.jpeg 424w, https://substackcdn.com/image/fetch/$s_!UMEN!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd7ed4b95-7938-4c10-bcf9-6a0442be75b3_272x341.jpeg 848w, https://substackcdn.com/image/fetch/$s_!UMEN!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd7ed4b95-7938-4c10-bcf9-6a0442be75b3_272x341.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!UMEN!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd7ed4b95-7938-4c10-bcf9-6a0442be75b3_272x341.jpeg 1456w" sizes="100vw"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p style="text-align: center;">Image by <a href="https://twitter.com/clearmlapp">@clearmlapp</a></p><p>This article is being written mainly as a way to put together the tips and tricks that I learned during my first setups of Kubeflow so that I may go back and redo it if needed in the future.</p><h3><strong>Prerequisites</strong></h3><p>We will install Kubeflow v1.2 on AWS, and to configure it, the following services will be used.</p><ul><li><p><a href="https://aws.amazon.com/eks/">EKS</a></p></li></ul><p>We are going to deploy Kubeflow on AWS EKS, which is a managed Kubernetes service. We are using an EKS cluster v1.19 with 6 nodes. Every node is an EC2 instance of type t2.large.</p><ul><li><p>IAM service roles</p></li></ul><p>Create service role <strong>eks-cluster-role</strong> with policy <strong>AmazonEKSClusterPolicy</strong> and service role <strong>eks-node-role</strong> with policy <strong>AmazonEKSWorkerNodePolicy</strong>, <strong>AmazonEC2ContainerRegistryReadOnly </strong>and <strong>AmazonEKS_CNI_Policy.</strong></p><p>Attach these roles to the EKS cluster, which will, in turn, assume the role to access other AWS services.</p><ul><li><p><a href="https://aws.amazon.com/cloud9/">AWS Cloud9</a></p></li></ul><p>Cloud9 is a cloud-native IDE which runs on top of an EC2 instance and lets you write, run, and debug your code with just a browser. We will use Cloud9 to connect to the EKS cluster and to run commands for Kubeflow to install on EKS.</p><h3><strong>Deploy kubeflow</strong></h3><h4>Step 1:&nbsp;Install eksctl</h4><p>eksctl is a simple CLI tool for creating and managing clusters on EKS - Amazon's managed Kubernetes service for EC2.</p><p>Let&#8217;s install eksctl with below commands.</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!ldTT!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa96dd225-a2d2-4472-b287-dc2e427b371b_2048x266.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!ldTT!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa96dd225-a2d2-4472-b287-dc2e427b371b_2048x266.png 424w, https://substackcdn.com/image/fetch/$s_!ldTT!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa96dd225-a2d2-4472-b287-dc2e427b371b_2048x266.png 848w, https://substackcdn.com/image/fetch/$s_!ldTT!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa96dd225-a2d2-4472-b287-dc2e427b371b_2048x266.png 1272w, https://substackcdn.com/image/fetch/$s_!ldTT!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa96dd225-a2d2-4472-b287-dc2e427b371b_2048x266.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!ldTT!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa96dd225-a2d2-4472-b287-dc2e427b371b_2048x266.png" width="1456" height="189" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/a96dd225-a2d2-4472-b287-dc2e427b371b_2048x266.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:189,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:51193,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://magazine.prasadzende.me/i/194549827?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa96dd225-a2d2-4472-b287-dc2e427b371b_2048x266.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!ldTT!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa96dd225-a2d2-4472-b287-dc2e427b371b_2048x266.png 424w, https://substackcdn.com/image/fetch/$s_!ldTT!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa96dd225-a2d2-4472-b287-dc2e427b371b_2048x266.png 848w, https://substackcdn.com/image/fetch/$s_!ldTT!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa96dd225-a2d2-4472-b287-dc2e427b371b_2048x266.png 1272w, https://substackcdn.com/image/fetch/$s_!ldTT!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa96dd225-a2d2-4472-b287-dc2e427b371b_2048x266.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><h4>Step 2:&nbsp;Configure aws-iam-authenticator</h4><p>aws-iam-authenticator is a tool to use AWS IAM credentials to authenticate to a Kubernetes cluster.</p><p>If you are building a Kubernetes installer on AWS, AWS IAM Authenticator for Kubernetes can simplify your bootstrap process. You won't need to somehow smuggle your initial admin credentials securely out of your newly installed cluster. Instead, you can create a dedicated KubernetesAdmin role at cluster provisioning time and set up Authenticator to allow cluster administrator logins.</p><p>To avoid having to manage a separate credential for Kubernetes access, we will use aws-iam-authenticator.</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!VERn!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe11b99a7-171a-4c30-ac99-d243088f407e_2048x416.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!VERn!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe11b99a7-171a-4c30-ac99-d243088f407e_2048x416.png 424w, https://substackcdn.com/image/fetch/$s_!VERn!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe11b99a7-171a-4c30-ac99-d243088f407e_2048x416.png 848w, https://substackcdn.com/image/fetch/$s_!VERn!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe11b99a7-171a-4c30-ac99-d243088f407e_2048x416.png 1272w, https://substackcdn.com/image/fetch/$s_!VERn!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe11b99a7-171a-4c30-ac99-d243088f407e_2048x416.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!VERn!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe11b99a7-171a-4c30-ac99-d243088f407e_2048x416.png" width="1456" height="296" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/e11b99a7-171a-4c30-ac99-d243088f407e_2048x416.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:296,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:87559,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://magazine.prasadzende.me/i/194549827?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe11b99a7-171a-4c30-ac99-d243088f407e_2048x416.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!VERn!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe11b99a7-171a-4c30-ac99-d243088f407e_2048x416.png 424w, https://substackcdn.com/image/fetch/$s_!VERn!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe11b99a7-171a-4c30-ac99-d243088f407e_2048x416.png 848w, https://substackcdn.com/image/fetch/$s_!VERn!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe11b99a7-171a-4c30-ac99-d243088f407e_2048x416.png 1272w, https://substackcdn.com/image/fetch/$s_!VERn!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe11b99a7-171a-4c30-ac99-d243088f407e_2048x416.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><h4>Step 3:&nbsp;Install kfctl</h4><p>kfctl is the control plane for deploying and managing Kubeflow.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!fEI8!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F76992915-d40a-46b2-8c19-db6d88718633_1934x528.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!fEI8!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F76992915-d40a-46b2-8c19-db6d88718633_1934x528.png 424w, https://substackcdn.com/image/fetch/$s_!fEI8!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F76992915-d40a-46b2-8c19-db6d88718633_1934x528.png 848w, https://substackcdn.com/image/fetch/$s_!fEI8!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F76992915-d40a-46b2-8c19-db6d88718633_1934x528.png 1272w, https://substackcdn.com/image/fetch/$s_!fEI8!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F76992915-d40a-46b2-8c19-db6d88718633_1934x528.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!fEI8!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F76992915-d40a-46b2-8c19-db6d88718633_1934x528.png" width="1456" height="398" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/76992915-d40a-46b2-8c19-db6d88718633_1934x528.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:398,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:124503,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://magazine.prasadzende.me/i/194549827?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F76992915-d40a-46b2-8c19-db6d88718633_1934x528.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!fEI8!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F76992915-d40a-46b2-8c19-db6d88718633_1934x528.png 424w, https://substackcdn.com/image/fetch/$s_!fEI8!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F76992915-d40a-46b2-8c19-db6d88718633_1934x528.png 848w, https://substackcdn.com/image/fetch/$s_!fEI8!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F76992915-d40a-46b2-8c19-db6d88718633_1934x528.png 1272w, https://substackcdn.com/image/fetch/$s_!fEI8!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F76992915-d40a-46b2-8c19-db6d88718633_1934x528.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>Now, let&#8217;s update the role we have created in the kfctl configuration.</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!qvXc!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa4fa06bb-0b31-454f-8c1b-0289a268fcc1_1580x358.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!qvXc!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa4fa06bb-0b31-454f-8c1b-0289a268fcc1_1580x358.png 424w, https://substackcdn.com/image/fetch/$s_!qvXc!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa4fa06bb-0b31-454f-8c1b-0289a268fcc1_1580x358.png 848w, https://substackcdn.com/image/fetch/$s_!qvXc!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa4fa06bb-0b31-454f-8c1b-0289a268fcc1_1580x358.png 1272w, https://substackcdn.com/image/fetch/$s_!qvXc!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa4fa06bb-0b31-454f-8c1b-0289a268fcc1_1580x358.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!qvXc!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa4fa06bb-0b31-454f-8c1b-0289a268fcc1_1580x358.png" width="1456" height="330" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/a4fa06bb-0b31-454f-8c1b-0289a268fcc1_1580x358.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:330,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;&quot;,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" title="" srcset="https://substackcdn.com/image/fetch/$s_!qvXc!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa4fa06bb-0b31-454f-8c1b-0289a268fcc1_1580x358.png 424w, https://substackcdn.com/image/fetch/$s_!qvXc!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa4fa06bb-0b31-454f-8c1b-0289a268fcc1_1580x358.png 848w, https://substackcdn.com/image/fetch/$s_!qvXc!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa4fa06bb-0b31-454f-8c1b-0289a268fcc1_1580x358.png 1272w, https://substackcdn.com/image/fetch/$s_!qvXc!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fa4fa06bb-0b31-454f-8c1b-0289a268fcc1_1580x358.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><h4><strong>Step 4:&nbsp;Build Kubeflow</strong></h4><p>Now, we will build Kubeflow with the following command.</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!CH8W!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8cafbbbc-21bd-4885-8c0e-1c74df399396_2034x166.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!CH8W!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8cafbbbc-21bd-4885-8c0e-1c74df399396_2034x166.png 424w, https://substackcdn.com/image/fetch/$s_!CH8W!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8cafbbbc-21bd-4885-8c0e-1c74df399396_2034x166.png 848w, https://substackcdn.com/image/fetch/$s_!CH8W!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8cafbbbc-21bd-4885-8c0e-1c74df399396_2034x166.png 1272w, https://substackcdn.com/image/fetch/$s_!CH8W!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8cafbbbc-21bd-4885-8c0e-1c74df399396_2034x166.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!CH8W!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8cafbbbc-21bd-4885-8c0e-1c74df399396_2034x166.png" width="1456" height="119" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/8cafbbbc-21bd-4885-8c0e-1c74df399396_2034x166.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:119,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:18414,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://magazine.prasadzende.me/i/194549827?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8cafbbbc-21bd-4885-8c0e-1c74df399396_2034x166.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!CH8W!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8cafbbbc-21bd-4885-8c0e-1c74df399396_2034x166.png 424w, https://substackcdn.com/image/fetch/$s_!CH8W!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8cafbbbc-21bd-4885-8c0e-1c74df399396_2034x166.png 848w, https://substackcdn.com/image/fetch/$s_!CH8W!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8cafbbbc-21bd-4885-8c0e-1c74df399396_2034x166.png 1272w, https://substackcdn.com/image/fetch/$s_!CH8W!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8cafbbbc-21bd-4885-8c0e-1c74df399396_2034x166.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><p>You can monitor all the resources created by KubeFlow with the following command.</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!K9ty!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1bc0e7f1-3d3b-4f40-ad14-3ff05ef51ce7_1950x156.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!K9ty!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1bc0e7f1-3d3b-4f40-ad14-3ff05ef51ce7_1950x156.png 424w, https://substackcdn.com/image/fetch/$s_!K9ty!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1bc0e7f1-3d3b-4f40-ad14-3ff05ef51ce7_1950x156.png 848w, https://substackcdn.com/image/fetch/$s_!K9ty!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1bc0e7f1-3d3b-4f40-ad14-3ff05ef51ce7_1950x156.png 1272w, https://substackcdn.com/image/fetch/$s_!K9ty!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1bc0e7f1-3d3b-4f40-ad14-3ff05ef51ce7_1950x156.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!K9ty!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1bc0e7f1-3d3b-4f40-ad14-3ff05ef51ce7_1950x156.png" width="1456" height="116" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/1bc0e7f1-3d3b-4f40-ad14-3ff05ef51ce7_1950x156.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:116,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:14592,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://magazine.prasadzende.me/i/194549827?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1bc0e7f1-3d3b-4f40-ad14-3ff05ef51ce7_1950x156.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!K9ty!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1bc0e7f1-3d3b-4f40-ad14-3ff05ef51ce7_1950x156.png 424w, https://substackcdn.com/image/fetch/$s_!K9ty!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1bc0e7f1-3d3b-4f40-ad14-3ff05ef51ce7_1950x156.png 848w, https://substackcdn.com/image/fetch/$s_!K9ty!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1bc0e7f1-3d3b-4f40-ad14-3ff05ef51ce7_1950x156.png 1272w, https://substackcdn.com/image/fetch/$s_!K9ty!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1bc0e7f1-3d3b-4f40-ad14-3ff05ef51ce7_1950x156.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><h3>Access the Kubeflow central dashboard</h3><p>Run the following command to get your Kubeflow service&#8217;s endpoint hostname and copy the link in the browser.</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!1mQm!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8da81759-3a8d-499e-9dd6-11f263758b1d_1646x310.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!1mQm!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8da81759-3a8d-499e-9dd6-11f263758b1d_1646x310.png 424w, https://substackcdn.com/image/fetch/$s_!1mQm!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8da81759-3a8d-499e-9dd6-11f263758b1d_1646x310.png 848w, https://substackcdn.com/image/fetch/$s_!1mQm!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8da81759-3a8d-499e-9dd6-11f263758b1d_1646x310.png 1272w, https://substackcdn.com/image/fetch/$s_!1mQm!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8da81759-3a8d-499e-9dd6-11f263758b1d_1646x310.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!1mQm!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8da81759-3a8d-499e-9dd6-11f263758b1d_1646x310.png" width="1456" height="274" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/8da81759-3a8d-499e-9dd6-11f263758b1d_1646x310.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:274,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:51005,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://magazine.prasadzende.me/i/194549827?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8da81759-3a8d-499e-9dd6-11f263758b1d_1646x310.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!1mQm!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8da81759-3a8d-499e-9dd6-11f263758b1d_1646x310.png 424w, https://substackcdn.com/image/fetch/$s_!1mQm!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8da81759-3a8d-499e-9dd6-11f263758b1d_1646x310.png 848w, https://substackcdn.com/image/fetch/$s_!1mQm!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8da81759-3a8d-499e-9dd6-11f263758b1d_1646x310.png 1272w, https://substackcdn.com/image/fetch/$s_!1mQm!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F8da81759-3a8d-499e-9dd6-11f263758b1d_1646x310.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><p>This deployment may take 3-5 minutes to become ready. Once complete, you can verify the installation by opening the ingress address in your preferred browser.</p><p>To expose Kubeflow with a LoadBalancer Service, just change the type of the istio-ingressgateway Service to LoadBalancer.</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!UfMw!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0d00c7a0-c14d-4636-8039-084e44f853a9_2034x156.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!UfMw!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0d00c7a0-c14d-4636-8039-084e44f853a9_2034x156.png 424w, https://substackcdn.com/image/fetch/$s_!UfMw!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0d00c7a0-c14d-4636-8039-084e44f853a9_2034x156.png 848w, https://substackcdn.com/image/fetch/$s_!UfMw!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0d00c7a0-c14d-4636-8039-084e44f853a9_2034x156.png 1272w, https://substackcdn.com/image/fetch/$s_!UfMw!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0d00c7a0-c14d-4636-8039-084e44f853a9_2034x156.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!UfMw!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0d00c7a0-c14d-4636-8039-084e44f853a9_2034x156.png" width="1456" height="112" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/0d00c7a0-c14d-4636-8039-084e44f853a9_2034x156.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:112,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:31736,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://magazine.prasadzende.me/i/194549827?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0d00c7a0-c14d-4636-8039-084e44f853a9_2034x156.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!UfMw!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0d00c7a0-c14d-4636-8039-084e44f853a9_2034x156.png 424w, https://substackcdn.com/image/fetch/$s_!UfMw!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0d00c7a0-c14d-4636-8039-084e44f853a9_2034x156.png 848w, https://substackcdn.com/image/fetch/$s_!UfMw!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0d00c7a0-c14d-4636-8039-084e44f853a9_2034x156.png 1272w, https://substackcdn.com/image/fetch/$s_!UfMw!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0d00c7a0-c14d-4636-8039-084e44f853a9_2034x156.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><h3>Endnotes</h3><p>Congratulations on your successful deployment of Kubeflow on AWS. As the Kubeflow team releases new versions rapidly, the steps written here might change. There are other ways to deploy Kubeflow on AWS and other platforms; you can refer to the Kubeflow <a href="https://www.kubeflow.org/docs/started/installing-kubeflow/">docs</a> for more details.</p><p>Thank you for reading..! &#128591;</p>]]></content:encoded></item><item><title><![CDATA[MLOps: Build ML lifecycle from scratch]]></title><description><![CDATA[Following continuous software engineering practices, there has been an increasing interest in rapid deployment of machine learning (ML) features, called MLOps.]]></description><link>https://magazine.prasadzende.me/p/httpsray</link><guid isPermaLink="false">https://magazine.prasadzende.me/p/httpsray</guid><dc:creator><![CDATA[Prasad Z]]></dc:creator><pubDate>Wed, 15 Dec 2021 14:40:00 GMT</pubDate><enclosure url="https://substack-post-media.s3.amazonaws.com/public/images/1c6073a3-f627-423d-94f2-1bc0024ba998_1600x771.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!Cjzv!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc662a761-872a-488e-b929-44ae96d6f4b9_1600x771.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!Cjzv!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc662a761-872a-488e-b929-44ae96d6f4b9_1600x771.png 424w, https://substackcdn.com/image/fetch/$s_!Cjzv!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc662a761-872a-488e-b929-44ae96d6f4b9_1600x771.png 848w, https://substackcdn.com/image/fetch/$s_!Cjzv!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc662a761-872a-488e-b929-44ae96d6f4b9_1600x771.png 1272w, https://substackcdn.com/image/fetch/$s_!Cjzv!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc662a761-872a-488e-b929-44ae96d6f4b9_1600x771.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!Cjzv!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc662a761-872a-488e-b929-44ae96d6f4b9_1600x771.png" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/c662a761-872a-488e-b929-44ae96d6f4b9_1600x771.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:null,&quot;width&quot;:null,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;&quot;,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:true,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" title="" srcset="https://substackcdn.com/image/fetch/$s_!Cjzv!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc662a761-872a-488e-b929-44ae96d6f4b9_1600x771.png 424w, https://substackcdn.com/image/fetch/$s_!Cjzv!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc662a761-872a-488e-b929-44ae96d6f4b9_1600x771.png 848w, https://substackcdn.com/image/fetch/$s_!Cjzv!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc662a761-872a-488e-b929-44ae96d6f4b9_1600x771.png 1272w, https://substackcdn.com/image/fetch/$s_!Cjzv!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc662a761-872a-488e-b929-44ae96d6f4b9_1600x771.png 1456w" sizes="100vw" fetchpriority="high"></picture><div></div></div></a></figure></div><p>Following continuous software engineering practices, there has been an increasing interest in rapid deployment of machine learning (ML) features, called MLOps.</p><p>In this use case, we will build an ML lifecycle using tools like <a href="https://dvc.org">DVC</a>, <a href="https://mlflow.org">MLflow</a>, Flask, Jenkins and more. Final code is available on <a href="https://github.com/prasadzende/mlops_jdhubaks">Github</a>.</p><p>Note: This type of use can be vast and takes a lot of time and resources, we will limit our features, but it will teach you how to build an ML lifecycle right from scratch.</p><h3><strong>Architecture</strong> &nbsp;</h3><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!D49u!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F15b6506a-6d6f-49de-be24-5f1692e4dbd4_1600x853.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!D49u!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F15b6506a-6d6f-49de-be24-5f1692e4dbd4_1600x853.png 424w, https://substackcdn.com/image/fetch/$s_!D49u!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F15b6506a-6d6f-49de-be24-5f1692e4dbd4_1600x853.png 848w, https://substackcdn.com/image/fetch/$s_!D49u!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F15b6506a-6d6f-49de-be24-5f1692e4dbd4_1600x853.png 1272w, https://substackcdn.com/image/fetch/$s_!D49u!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F15b6506a-6d6f-49de-be24-5f1692e4dbd4_1600x853.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!D49u!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F15b6506a-6d6f-49de-be24-5f1692e4dbd4_1600x853.png" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/15b6506a-6d6f-49de-be24-5f1692e4dbd4_1600x853.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:null,&quot;width&quot;:null,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;&quot;,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" title="" srcset="https://substackcdn.com/image/fetch/$s_!D49u!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F15b6506a-6d6f-49de-be24-5f1692e4dbd4_1600x853.png 424w, https://substackcdn.com/image/fetch/$s_!D49u!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F15b6506a-6d6f-49de-be24-5f1692e4dbd4_1600x853.png 848w, https://substackcdn.com/image/fetch/$s_!D49u!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F15b6506a-6d6f-49de-be24-5f1692e4dbd4_1600x853.png 1272w, https://substackcdn.com/image/fetch/$s_!D49u!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F15b6506a-6d6f-49de-be24-5f1692e4dbd4_1600x853.png 1456w" sizes="100vw"></picture><div></div></div></a></figure></div><p>In this use case, we are using DVC for data versioning and data pipeline, MLflow for experiment tracking, Flask for model serving and Jenkins for CI/CD pipeline.&nbsp;</p><p>We are going to deploy our model on a managed Kubernetes service by Azure, but in theory, you could also use AWS, GCP or any Kubernetes service provider.&nbsp;</p><p>All these tools are used here to demonstrate the end-to-end ML lifecycle. You could also try other alternatives to build an ML pipeline based on your requirements.</p><h3><strong>Project Structure</strong></h3><p>To start with the project, we will use a template.py, which will create an initial project structure for us. Create the template.py and execute the code below to create the project structure.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!eAQ3!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdad51092-db16-4db7-ac30-61d93b0a17c7_2000x1050.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!eAQ3!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdad51092-db16-4db7-ac30-61d93b0a17c7_2000x1050.png 424w, https://substackcdn.com/image/fetch/$s_!eAQ3!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdad51092-db16-4db7-ac30-61d93b0a17c7_2000x1050.png 848w, https://substackcdn.com/image/fetch/$s_!eAQ3!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdad51092-db16-4db7-ac30-61d93b0a17c7_2000x1050.png 1272w, https://substackcdn.com/image/fetch/$s_!eAQ3!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdad51092-db16-4db7-ac30-61d93b0a17c7_2000x1050.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!eAQ3!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdad51092-db16-4db7-ac30-61d93b0a17c7_2000x1050.png" width="1456" height="764" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/dad51092-db16-4db7-ac30-61d93b0a17c7_2000x1050.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:764,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:142440,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://magazine.prasadzende.me/i/194549830?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdad51092-db16-4db7-ac30-61d93b0a17c7_2000x1050.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!eAQ3!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdad51092-db16-4db7-ac30-61d93b0a17c7_2000x1050.png 424w, https://substackcdn.com/image/fetch/$s_!eAQ3!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdad51092-db16-4db7-ac30-61d93b0a17c7_2000x1050.png 848w, https://substackcdn.com/image/fetch/$s_!eAQ3!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdad51092-db16-4db7-ac30-61d93b0a17c7_2000x1050.png 1272w, https://substackcdn.com/image/fetch/$s_!eAQ3!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fdad51092-db16-4db7-ac30-61d93b0a17c7_2000x1050.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>This will create a project structure as follows:</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!3Kyp!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe03c8036-dc8b-4909-b245-a67a8a0de4a4_272x246.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!3Kyp!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe03c8036-dc8b-4909-b245-a67a8a0de4a4_272x246.png 424w, https://substackcdn.com/image/fetch/$s_!3Kyp!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe03c8036-dc8b-4909-b245-a67a8a0de4a4_272x246.png 848w, https://substackcdn.com/image/fetch/$s_!3Kyp!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe03c8036-dc8b-4909-b245-a67a8a0de4a4_272x246.png 1272w, https://substackcdn.com/image/fetch/$s_!3Kyp!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe03c8036-dc8b-4909-b245-a67a8a0de4a4_272x246.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!3Kyp!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe03c8036-dc8b-4909-b245-a67a8a0de4a4_272x246.png" width="265" height="240" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/e03c8036-dc8b-4909-b245-a67a8a0de4a4_272x246.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:240,&quot;width&quot;:265,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;&quot;,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" title="" srcset="https://substackcdn.com/image/fetch/$s_!3Kyp!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe03c8036-dc8b-4909-b245-a67a8a0de4a4_272x246.png 424w, https://substackcdn.com/image/fetch/$s_!3Kyp!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe03c8036-dc8b-4909-b245-a67a8a0de4a4_272x246.png 848w, https://substackcdn.com/image/fetch/$s_!3Kyp!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe03c8036-dc8b-4909-b245-a67a8a0de4a4_272x246.png 1272w, https://substackcdn.com/image/fetch/$s_!3Kyp!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fe03c8036-dc8b-4909-b245-a67a8a0de4a4_272x246.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><h3><strong>Data versioning &amp; pipeline&nbsp;</strong></h3><p>In this demonstration, we are going to load data from a local repository, but in production, data can be loaded from any storage like S3, Azure Blob storage, etc. We can also track versions of the dataset using DVC, in an S3 bucket.</p><p>Let&#8217;s add our dataset to DVC for tracking with the following block of code.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!2fJJ!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0883d92b-40dc-410c-a24f-46e846d43be0_1984x528.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!2fJJ!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0883d92b-40dc-410c-a24f-46e846d43be0_1984x528.png 424w, https://substackcdn.com/image/fetch/$s_!2fJJ!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0883d92b-40dc-410c-a24f-46e846d43be0_1984x528.png 848w, https://substackcdn.com/image/fetch/$s_!2fJJ!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0883d92b-40dc-410c-a24f-46e846d43be0_1984x528.png 1272w, https://substackcdn.com/image/fetch/$s_!2fJJ!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0883d92b-40dc-410c-a24f-46e846d43be0_1984x528.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!2fJJ!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0883d92b-40dc-410c-a24f-46e846d43be0_1984x528.png" width="1456" height="387" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/0883d92b-40dc-410c-a24f-46e846d43be0_1984x528.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:387,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:67693,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://magazine.prasadzende.me/i/194549830?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0883d92b-40dc-410c-a24f-46e846d43be0_1984x528.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!2fJJ!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0883d92b-40dc-410c-a24f-46e846d43be0_1984x528.png 424w, https://substackcdn.com/image/fetch/$s_!2fJJ!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0883d92b-40dc-410c-a24f-46e846d43be0_1984x528.png 848w, https://substackcdn.com/image/fetch/$s_!2fJJ!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0883d92b-40dc-410c-a24f-46e846d43be0_1984x528.png 1272w, https://substackcdn.com/image/fetch/$s_!2fJJ!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0883d92b-40dc-410c-a24f-46e846d43be0_1984x528.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>Now, we will create a DVC pipeline which will trigger activities like data collection, loading, train-test split, model training and evaluation. After this, it will log the model with the best metrics to production.&nbsp;</p><p>The whole point of creating this dvc.yaml file is the ability to easily reproduce a pipeline, and it can be executed with the command &#8216;dvc repro&#8217;</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!EQaH!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1efc3997-2f5d-4f8a-95d1-9f3e550bef6a_1934x1384.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!EQaH!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1efc3997-2f5d-4f8a-95d1-9f3e550bef6a_1934x1384.png 424w, https://substackcdn.com/image/fetch/$s_!EQaH!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1efc3997-2f5d-4f8a-95d1-9f3e550bef6a_1934x1384.png 848w, https://substackcdn.com/image/fetch/$s_!EQaH!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1efc3997-2f5d-4f8a-95d1-9f3e550bef6a_1934x1384.png 1272w, https://substackcdn.com/image/fetch/$s_!EQaH!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1efc3997-2f5d-4f8a-95d1-9f3e550bef6a_1934x1384.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!EQaH!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1efc3997-2f5d-4f8a-95d1-9f3e550bef6a_1934x1384.png" width="1456" height="1042" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/1efc3997-2f5d-4f8a-95d1-9f3e550bef6a_1934x1384.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:1042,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:263463,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://magazine.prasadzende.me/i/194549830?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1efc3997-2f5d-4f8a-95d1-9f3e550bef6a_1934x1384.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!EQaH!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1efc3997-2f5d-4f8a-95d1-9f3e550bef6a_1934x1384.png 424w, https://substackcdn.com/image/fetch/$s_!EQaH!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1efc3997-2f5d-4f8a-95d1-9f3e550bef6a_1934x1384.png 848w, https://substackcdn.com/image/fetch/$s_!EQaH!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1efc3997-2f5d-4f8a-95d1-9f3e550bef6a_1934x1384.png 1272w, https://substackcdn.com/image/fetch/$s_!EQaH!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1efc3997-2f5d-4f8a-95d1-9f3e550bef6a_1934x1384.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>The <a href="https://github.com/prasadzende/mlops_jdhubaks/blob/main/params.yaml">params.yaml</a> used to configure metrics and hyperparameters, which will be passed as input to the dvc pipeline.&nbsp;</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!7k5I!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5ec0574c-0d8f-4a9d-8a01-cd4fb5c94c74_580x282.jpeg" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!7k5I!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5ec0574c-0d8f-4a9d-8a01-cd4fb5c94c74_580x282.jpeg 424w, https://substackcdn.com/image/fetch/$s_!7k5I!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5ec0574c-0d8f-4a9d-8a01-cd4fb5c94c74_580x282.jpeg 848w, https://substackcdn.com/image/fetch/$s_!7k5I!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5ec0574c-0d8f-4a9d-8a01-cd4fb5c94c74_580x282.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!7k5I!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5ec0574c-0d8f-4a9d-8a01-cd4fb5c94c74_580x282.jpeg 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!7k5I!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5ec0574c-0d8f-4a9d-8a01-cd4fb5c94c74_580x282.jpeg" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/5ec0574c-0d8f-4a9d-8a01-cd4fb5c94c74_580x282.jpeg&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:null,&quot;width&quot;:null,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!7k5I!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5ec0574c-0d8f-4a9d-8a01-cd4fb5c94c74_580x282.jpeg 424w, https://substackcdn.com/image/fetch/$s_!7k5I!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5ec0574c-0d8f-4a9d-8a01-cd4fb5c94c74_580x282.jpeg 848w, https://substackcdn.com/image/fetch/$s_!7k5I!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5ec0574c-0d8f-4a9d-8a01-cd4fb5c94c74_580x282.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!7k5I!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F5ec0574c-0d8f-4a9d-8a01-cd4fb5c94c74_580x282.jpeg 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><p style="text-align: center;">Image by <a href="https://pbs.twimg.com/media/E5WwjL-X0AIOej2?format=jpg&amp;name=small">@overflow_meme</a></p><h3>Let&#8217;s build our model&nbsp;</h3><p>First, we will get our data from storage and store it in the data/raw directory for further processing using the script &#8216;get_data.py&#8217; and &#8216;load_data.py&#8217;</p><p>Let's create load_data.py to load data from the data/raw directory into a dataframe to prepare it for training.</p><p>When the data is loaded, the split_data.py script will be used to split the data for model training and evaluation.</p><h3>Let&#8217;s build our model</h3><p>First, we will get our data from storage and store it in data/raw directory for further processing using the script &#8216;get_data.py&#8217; and &#8216;load_data.py&#8217;</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!UZBK!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fce03f5e9-ede2-469f-a9ea-3576fa49eef4_2018x1050.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!UZBK!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fce03f5e9-ede2-469f-a9ea-3576fa49eef4_2018x1050.png 424w, https://substackcdn.com/image/fetch/$s_!UZBK!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fce03f5e9-ede2-469f-a9ea-3576fa49eef4_2018x1050.png 848w, https://substackcdn.com/image/fetch/$s_!UZBK!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fce03f5e9-ede2-469f-a9ea-3576fa49eef4_2018x1050.png 1272w, https://substackcdn.com/image/fetch/$s_!UZBK!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fce03f5e9-ede2-469f-a9ea-3576fa49eef4_2018x1050.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!UZBK!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fce03f5e9-ede2-469f-a9ea-3576fa49eef4_2018x1050.png" width="1456" height="758" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/ce03f5e9-ede2-469f-a9ea-3576fa49eef4_2018x1050.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:758,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:195743,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://magazine.prasadzende.me/i/194549830?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fce03f5e9-ede2-469f-a9ea-3576fa49eef4_2018x1050.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!UZBK!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fce03f5e9-ede2-469f-a9ea-3576fa49eef4_2018x1050.png 424w, https://substackcdn.com/image/fetch/$s_!UZBK!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fce03f5e9-ede2-469f-a9ea-3576fa49eef4_2018x1050.png 848w, https://substackcdn.com/image/fetch/$s_!UZBK!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fce03f5e9-ede2-469f-a9ea-3576fa49eef4_2018x1050.png 1272w, https://substackcdn.com/image/fetch/$s_!UZBK!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fce03f5e9-ede2-469f-a9ea-3576fa49eef4_2018x1050.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>Let's create load_data.py to load data from data/raw directory into a dataframe to prepare it for training.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!ggzA!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc162835c-3cbd-4935-ad04-d278be0d8723_2000x862.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!ggzA!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc162835c-3cbd-4935-ad04-d278be0d8723_2000x862.png 424w, https://substackcdn.com/image/fetch/$s_!ggzA!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc162835c-3cbd-4935-ad04-d278be0d8723_2000x862.png 848w, https://substackcdn.com/image/fetch/$s_!ggzA!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc162835c-3cbd-4935-ad04-d278be0d8723_2000x862.png 1272w, https://substackcdn.com/image/fetch/$s_!ggzA!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc162835c-3cbd-4935-ad04-d278be0d8723_2000x862.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!ggzA!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc162835c-3cbd-4935-ad04-d278be0d8723_2000x862.png" width="1456" height="628" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/c162835c-3cbd-4935-ad04-d278be0d8723_2000x862.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:628,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:169724,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://magazine.prasadzende.me/i/194549830?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc162835c-3cbd-4935-ad04-d278be0d8723_2000x862.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!ggzA!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc162835c-3cbd-4935-ad04-d278be0d8723_2000x862.png 424w, https://substackcdn.com/image/fetch/$s_!ggzA!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc162835c-3cbd-4935-ad04-d278be0d8723_2000x862.png 848w, https://substackcdn.com/image/fetch/$s_!ggzA!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc162835c-3cbd-4935-ad04-d278be0d8723_2000x862.png 1272w, https://substackcdn.com/image/fetch/$s_!ggzA!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fc162835c-3cbd-4935-ad04-d278be0d8723_2000x862.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>When the data is loaded, the split_data.py script will be used to split the data for model training and evaluation.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!GOXu!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F985cb18a-bd08-4960-a226-544c7e9f0963_2048x1534.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!GOXu!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F985cb18a-bd08-4960-a226-544c7e9f0963_2048x1534.png 424w, https://substackcdn.com/image/fetch/$s_!GOXu!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F985cb18a-bd08-4960-a226-544c7e9f0963_2048x1534.png 848w, https://substackcdn.com/image/fetch/$s_!GOXu!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F985cb18a-bd08-4960-a226-544c7e9f0963_2048x1534.png 1272w, https://substackcdn.com/image/fetch/$s_!GOXu!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F985cb18a-bd08-4960-a226-544c7e9f0963_2048x1534.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!GOXu!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F985cb18a-bd08-4960-a226-544c7e9f0963_2048x1534.png" width="1456" height="1091" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/985cb18a-bd08-4960-a226-544c7e9f0963_2048x1534.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:1091,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:376197,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://magazine.prasadzende.me/i/194549830?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F985cb18a-bd08-4960-a226-544c7e9f0963_2048x1534.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!GOXu!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F985cb18a-bd08-4960-a226-544c7e9f0963_2048x1534.png 424w, https://substackcdn.com/image/fetch/$s_!GOXu!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F985cb18a-bd08-4960-a226-544c7e9f0963_2048x1534.png 848w, https://substackcdn.com/image/fetch/$s_!GOXu!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F985cb18a-bd08-4960-a226-544c7e9f0963_2048x1534.png 1272w, https://substackcdn.com/image/fetch/$s_!GOXu!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F985cb18a-bd08-4960-a226-544c7e9f0963_2048x1534.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><h3>Experiment Tracking&nbsp;</h3><p>The training code will use MLflow to track experiments and for model versioning. The model artefact will be stored in the artefact directory, but in production, the S3 bucket can be used to store model artefacts, and metadata for experiments can be stored in any SQL database. For our case, we are storing it in a SQLite database.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!8H5u!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F21a2e4af-d41a-46d6-83e0-3aaee20a5da5_1950x2092.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!8H5u!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F21a2e4af-d41a-46d6-83e0-3aaee20a5da5_1950x2092.png 424w, https://substackcdn.com/image/fetch/$s_!8H5u!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F21a2e4af-d41a-46d6-83e0-3aaee20a5da5_1950x2092.png 848w, https://substackcdn.com/image/fetch/$s_!8H5u!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F21a2e4af-d41a-46d6-83e0-3aaee20a5da5_1950x2092.png 1272w, https://substackcdn.com/image/fetch/$s_!8H5u!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F21a2e4af-d41a-46d6-83e0-3aaee20a5da5_1950x2092.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!8H5u!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F21a2e4af-d41a-46d6-83e0-3aaee20a5da5_1950x2092.png" width="1456" height="1562" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/21a2e4af-d41a-46d6-83e0-3aaee20a5da5_1950x2092.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:1562,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:465834,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://magazine.prasadzende.me/i/194549830?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F21a2e4af-d41a-46d6-83e0-3aaee20a5da5_1950x2092.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!8H5u!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F21a2e4af-d41a-46d6-83e0-3aaee20a5da5_1950x2092.png 424w, https://substackcdn.com/image/fetch/$s_!8H5u!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F21a2e4af-d41a-46d6-83e0-3aaee20a5da5_1950x2092.png 848w, https://substackcdn.com/image/fetch/$s_!8H5u!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F21a2e4af-d41a-46d6-83e0-3aaee20a5da5_1950x2092.png 1272w, https://substackcdn.com/image/fetch/$s_!8H5u!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F21a2e4af-d41a-46d6-83e0-3aaee20a5da5_1950x2092.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>The model with the best metrics will be logged as production, and it will be moved to production_service/model directory for serving.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!NcUm!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd82b40e1-6776-48e0-bb95-d32ebef36494_2034x1906.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!NcUm!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd82b40e1-6776-48e0-bb95-d32ebef36494_2034x1906.png 424w, https://substackcdn.com/image/fetch/$s_!NcUm!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd82b40e1-6776-48e0-bb95-d32ebef36494_2034x1906.png 848w, https://substackcdn.com/image/fetch/$s_!NcUm!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd82b40e1-6776-48e0-bb95-d32ebef36494_2034x1906.png 1272w, https://substackcdn.com/image/fetch/$s_!NcUm!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd82b40e1-6776-48e0-bb95-d32ebef36494_2034x1906.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!NcUm!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd82b40e1-6776-48e0-bb95-d32ebef36494_2034x1906.png" width="1456" height="1364" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/d82b40e1-6776-48e0-bb95-d32ebef36494_2034x1906.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:1364,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:411692,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://magazine.prasadzende.me/i/194549830?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd82b40e1-6776-48e0-bb95-d32ebef36494_2034x1906.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!NcUm!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd82b40e1-6776-48e0-bb95-d32ebef36494_2034x1906.png 424w, https://substackcdn.com/image/fetch/$s_!NcUm!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd82b40e1-6776-48e0-bb95-d32ebef36494_2034x1906.png 848w, https://substackcdn.com/image/fetch/$s_!NcUm!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd82b40e1-6776-48e0-bb95-d32ebef36494_2034x1906.png 1272w, https://substackcdn.com/image/fetch/$s_!NcUm!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fd82b40e1-6776-48e0-bb95-d32ebef36494_2034x1906.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!zC5E!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F530080d9-7226-4f38-b839-bfc6d5da2bab_640x330.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!zC5E!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F530080d9-7226-4f38-b839-bfc6d5da2bab_640x330.png 424w, https://substackcdn.com/image/fetch/$s_!zC5E!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F530080d9-7226-4f38-b839-bfc6d5da2bab_640x330.png 848w, https://substackcdn.com/image/fetch/$s_!zC5E!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F530080d9-7226-4f38-b839-bfc6d5da2bab_640x330.png 1272w, https://substackcdn.com/image/fetch/$s_!zC5E!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F530080d9-7226-4f38-b839-bfc6d5da2bab_640x330.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!zC5E!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F530080d9-7226-4f38-b839-bfc6d5da2bab_640x330.png" width="640" height="330" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/530080d9-7226-4f38-b839-bfc6d5da2bab_640x330.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:330,&quot;width&quot;:640,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!zC5E!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F530080d9-7226-4f38-b839-bfc6d5da2bab_640x330.png 424w, https://substackcdn.com/image/fetch/$s_!zC5E!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F530080d9-7226-4f38-b839-bfc6d5da2bab_640x330.png 848w, https://substackcdn.com/image/fetch/$s_!zC5E!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F530080d9-7226-4f38-b839-bfc6d5da2bab_640x330.png 1272w, https://substackcdn.com/image/fetch/$s_!zC5E!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F530080d9-7226-4f38-b839-bfc6d5da2bab_640x330.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!icjF!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F242b429c-7815-4133-8620-0dc3906bca1d_1359x473.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!icjF!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F242b429c-7815-4133-8620-0dc3906bca1d_1359x473.png 424w, https://substackcdn.com/image/fetch/$s_!icjF!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F242b429c-7815-4133-8620-0dc3906bca1d_1359x473.png 848w, https://substackcdn.com/image/fetch/$s_!icjF!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F242b429c-7815-4133-8620-0dc3906bca1d_1359x473.png 1272w, https://substackcdn.com/image/fetch/$s_!icjF!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F242b429c-7815-4133-8620-0dc3906bca1d_1359x473.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!icjF!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F242b429c-7815-4133-8620-0dc3906bca1d_1359x473.png" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/242b429c-7815-4133-8620-0dc3906bca1d_1359x473.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:null,&quot;width&quot;:null,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!icjF!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F242b429c-7815-4133-8620-0dc3906bca1d_1359x473.png 424w, https://substackcdn.com/image/fetch/$s_!icjF!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F242b429c-7815-4133-8620-0dc3906bca1d_1359x473.png 848w, https://substackcdn.com/image/fetch/$s_!icjF!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F242b429c-7815-4133-8620-0dc3906bca1d_1359x473.png 1272w, https://substackcdn.com/image/fetch/$s_!icjF!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F242b429c-7815-4133-8620-0dc3906bca1d_1359x473.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><h3>Model Serving&nbsp;</h3><p>For model serving, we will build a Flask application which will provide an API endpoint for predictions. This application will run on AKS, and we will expose it to the internet using the Load Balancer service.&nbsp;</p><p>In our flask application, it will receive inputs in JSON format and will send back the response in JSON with output 0 or 1.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!De6A!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0ed63787-f5fd-499a-959a-f452b9b6dedc_1850x1348.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!De6A!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0ed63787-f5fd-499a-959a-f452b9b6dedc_1850x1348.png 424w, https://substackcdn.com/image/fetch/$s_!De6A!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0ed63787-f5fd-499a-959a-f452b9b6dedc_1850x1348.png 848w, https://substackcdn.com/image/fetch/$s_!De6A!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0ed63787-f5fd-499a-959a-f452b9b6dedc_1850x1348.png 1272w, https://substackcdn.com/image/fetch/$s_!De6A!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0ed63787-f5fd-499a-959a-f452b9b6dedc_1850x1348.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!De6A!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0ed63787-f5fd-499a-959a-f452b9b6dedc_1850x1348.png" width="1456" height="1061" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/0ed63787-f5fd-499a-959a-f452b9b6dedc_1850x1348.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:1061,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:272300,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://magazine.prasadzende.me/i/194549830?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0ed63787-f5fd-499a-959a-f452b9b6dedc_1850x1348.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!De6A!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0ed63787-f5fd-499a-959a-f452b9b6dedc_1850x1348.png 424w, https://substackcdn.com/image/fetch/$s_!De6A!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0ed63787-f5fd-499a-959a-f452b9b6dedc_1850x1348.png 848w, https://substackcdn.com/image/fetch/$s_!De6A!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0ed63787-f5fd-499a-959a-f452b9b6dedc_1850x1348.png 1272w, https://substackcdn.com/image/fetch/$s_!De6A!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F0ed63787-f5fd-499a-959a-f452b9b6dedc_1850x1348.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><p>Use app.py to create the Flask endpoint, which will launch our Flask application.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!wruX!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fae8c35fb-cd76-4eca-bb20-65c8aa2a3eec_2018x1348.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!wruX!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fae8c35fb-cd76-4eca-bb20-65c8aa2a3eec_2018x1348.png 424w, https://substackcdn.com/image/fetch/$s_!wruX!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fae8c35fb-cd76-4eca-bb20-65c8aa2a3eec_2018x1348.png 848w, https://substackcdn.com/image/fetch/$s_!wruX!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fae8c35fb-cd76-4eca-bb20-65c8aa2a3eec_2018x1348.png 1272w, https://substackcdn.com/image/fetch/$s_!wruX!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fae8c35fb-cd76-4eca-bb20-65c8aa2a3eec_2018x1348.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!wruX!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fae8c35fb-cd76-4eca-bb20-65c8aa2a3eec_2018x1348.png" width="1456" height="973" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/ae8c35fb-cd76-4eca-bb20-65c8aa2a3eec_2018x1348.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:973,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:286983,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://magazine.prasadzende.me/i/194549830?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fae8c35fb-cd76-4eca-bb20-65c8aa2a3eec_2018x1348.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!wruX!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fae8c35fb-cd76-4eca-bb20-65c8aa2a3eec_2018x1348.png 424w, https://substackcdn.com/image/fetch/$s_!wruX!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fae8c35fb-cd76-4eca-bb20-65c8aa2a3eec_2018x1348.png 848w, https://substackcdn.com/image/fetch/$s_!wruX!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fae8c35fb-cd76-4eca-bb20-65c8aa2a3eec_2018x1348.png 1272w, https://substackcdn.com/image/fetch/$s_!wruX!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Fae8c35fb-cd76-4eca-bb20-65c8aa2a3eec_2018x1348.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><h3>Package model into a Docker container&nbsp;</h3><p>We will build the package of our model using Docker and push it to the container registry on Docker Hub. After this, we will use docker-compose.yml to run our Docker container.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!xcei!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F708bbbc8-e64a-4cee-a41a-db093b844c6d_1984x640.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!xcei!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F708bbbc8-e64a-4cee-a41a-db093b844c6d_1984x640.png 424w, https://substackcdn.com/image/fetch/$s_!xcei!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F708bbbc8-e64a-4cee-a41a-db093b844c6d_1984x640.png 848w, https://substackcdn.com/image/fetch/$s_!xcei!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F708bbbc8-e64a-4cee-a41a-db093b844c6d_1984x640.png 1272w, https://substackcdn.com/image/fetch/$s_!xcei!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F708bbbc8-e64a-4cee-a41a-db093b844c6d_1984x640.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!xcei!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F708bbbc8-e64a-4cee-a41a-db093b844c6d_1984x640.png" width="1456" height="470" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/708bbbc8-e64a-4cee-a41a-db093b844c6d_1984x640.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:470,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:88365,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://magazine.prasadzende.me/i/194549830?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F708bbbc8-e64a-4cee-a41a-db093b844c6d_1984x640.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!xcei!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F708bbbc8-e64a-4cee-a41a-db093b844c6d_1984x640.png 424w, https://substackcdn.com/image/fetch/$s_!xcei!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F708bbbc8-e64a-4cee-a41a-db093b844c6d_1984x640.png 848w, https://substackcdn.com/image/fetch/$s_!xcei!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F708bbbc8-e64a-4cee-a41a-db093b844c6d_1984x640.png 1272w, https://substackcdn.com/image/fetch/$s_!xcei!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F708bbbc8-e64a-4cee-a41a-db093b844c6d_1984x640.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!d0T_!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F225c0e71-d9fb-461d-82e6-515ad1a57f7e_1748x416.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!d0T_!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F225c0e71-d9fb-461d-82e6-515ad1a57f7e_1748x416.png 424w, https://substackcdn.com/image/fetch/$s_!d0T_!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F225c0e71-d9fb-461d-82e6-515ad1a57f7e_1748x416.png 848w, https://substackcdn.com/image/fetch/$s_!d0T_!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F225c0e71-d9fb-461d-82e6-515ad1a57f7e_1748x416.png 1272w, https://substackcdn.com/image/fetch/$s_!d0T_!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F225c0e71-d9fb-461d-82e6-515ad1a57f7e_1748x416.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!d0T_!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F225c0e71-d9fb-461d-82e6-515ad1a57f7e_1748x416.png" width="1456" height="347" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/225c0e71-d9fb-461d-82e6-515ad1a57f7e_1748x416.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:347,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:47482,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://magazine.prasadzende.me/i/194549830?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F225c0e71-d9fb-461d-82e6-515ad1a57f7e_1748x416.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!d0T_!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F225c0e71-d9fb-461d-82e6-515ad1a57f7e_1748x416.png 424w, https://substackcdn.com/image/fetch/$s_!d0T_!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F225c0e71-d9fb-461d-82e6-515ad1a57f7e_1748x416.png 848w, https://substackcdn.com/image/fetch/$s_!d0T_!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F225c0e71-d9fb-461d-82e6-515ad1a57f7e_1748x416.png 1272w, https://substackcdn.com/image/fetch/$s_!d0T_!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F225c0e71-d9fb-461d-82e6-515ad1a57f7e_1748x416.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><h3>Deploying our model on Kubernetes&nbsp;</h3><p>We are deploying our model on AKS. For this, we are using k8s-deployment.yml, which will create a deployment on K8S and a loadbalancer service to expose our application to the internet with port 5001.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!iFw3!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1364a9d6-6624-4f41-8023-f7c85f0fbeb5_2018x1384.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!iFw3!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1364a9d6-6624-4f41-8023-f7c85f0fbeb5_2018x1384.png 424w, https://substackcdn.com/image/fetch/$s_!iFw3!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1364a9d6-6624-4f41-8023-f7c85f0fbeb5_2018x1384.png 848w, https://substackcdn.com/image/fetch/$s_!iFw3!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1364a9d6-6624-4f41-8023-f7c85f0fbeb5_2018x1384.png 1272w, https://substackcdn.com/image/fetch/$s_!iFw3!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1364a9d6-6624-4f41-8023-f7c85f0fbeb5_2018x1384.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!iFw3!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1364a9d6-6624-4f41-8023-f7c85f0fbeb5_2018x1384.png" width="1456" height="999" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/1364a9d6-6624-4f41-8023-f7c85f0fbeb5_2018x1384.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:999,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:214137,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://magazine.prasadzende.me/i/194549830?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1364a9d6-6624-4f41-8023-f7c85f0fbeb5_2018x1384.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!iFw3!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1364a9d6-6624-4f41-8023-f7c85f0fbeb5_2018x1384.png 424w, https://substackcdn.com/image/fetch/$s_!iFw3!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1364a9d6-6624-4f41-8023-f7c85f0fbeb5_2018x1384.png 848w, https://substackcdn.com/image/fetch/$s_!iFw3!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1364a9d6-6624-4f41-8023-f7c85f0fbeb5_2018x1384.png 1272w, https://substackcdn.com/image/fetch/$s_!iFw3!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1364a9d6-6624-4f41-8023-f7c85f0fbeb5_2018x1384.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><h3>CI/CD Pipeline&nbsp;</h3><p>Now that we have built our model, let's create a CI/CD pipeline using Jenkins, which will clone the code from the Git repository, create the Docker image, push the Docker image to Docker Hub container registry and deploy the required Kubernetes components on AKS.</p><div class="captioned-image-container"><figure><a class="image-link image2 is-viewable-img" target="_blank" href="https://substackcdn.com/image/fetch/$s_!yLE6!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2baccf27-5ea3-48e1-a7e7-e334d5634aa6_1630x2540.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!yLE6!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2baccf27-5ea3-48e1-a7e7-e334d5634aa6_1630x2540.png 424w, https://substackcdn.com/image/fetch/$s_!yLE6!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2baccf27-5ea3-48e1-a7e7-e334d5634aa6_1630x2540.png 848w, https://substackcdn.com/image/fetch/$s_!yLE6!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2baccf27-5ea3-48e1-a7e7-e334d5634aa6_1630x2540.png 1272w, https://substackcdn.com/image/fetch/$s_!yLE6!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2baccf27-5ea3-48e1-a7e7-e334d5634aa6_1630x2540.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!yLE6!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2baccf27-5ea3-48e1-a7e7-e334d5634aa6_1630x2540.png" width="1456" height="2269" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/2baccf27-5ea3-48e1-a7e7-e334d5634aa6_1630x2540.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:2269,&quot;width&quot;:1456,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:335254,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:&quot;image/png&quot;,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:&quot;https://magazine.prasadzende.me/i/194549830?img=https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2baccf27-5ea3-48e1-a7e7-e334d5634aa6_1630x2540.png&quot;,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!yLE6!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2baccf27-5ea3-48e1-a7e7-e334d5634aa6_1630x2540.png 424w, https://substackcdn.com/image/fetch/$s_!yLE6!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2baccf27-5ea3-48e1-a7e7-e334d5634aa6_1630x2540.png 848w, https://substackcdn.com/image/fetch/$s_!yLE6!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2baccf27-5ea3-48e1-a7e7-e334d5634aa6_1630x2540.png 1272w, https://substackcdn.com/image/fetch/$s_!yLE6!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F2baccf27-5ea3-48e1-a7e7-e334d5634aa6_1630x2540.png 1456w" sizes="100vw" loading="lazy"></picture><div class="image-link-expand"><div class="pencraft pc-display-flex pc-gap-8 pc-reset"><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container restack-image"><svg role="img" width="20" height="20" viewBox="0 0 20 20" fill="none" stroke-width="1.5" stroke="var(--color-fg-primary)" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><g><title></title><path d="M2.53001 7.81595C3.49179 4.73911 6.43281 2.5 9.91173 2.5C13.1684 2.5 15.9537 4.46214 17.0852 7.23684L17.6179 8.67647M17.6179 8.67647L18.5002 4.26471M17.6179 8.67647L13.6473 6.91176M17.4995 12.1841C16.5378 15.2609 13.5967 17.5 10.1178 17.5C6.86118 17.5 4.07589 15.5379 2.94432 12.7632L2.41165 11.3235M2.41165 11.3235L1.5293 15.7353M2.41165 11.3235L6.38224 13.0882"></path></g></svg></button><button tabindex="0" type="button" class="pencraft pc-reset pencraft icon-container view-image"><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-maximize2 lucide-maximize-2"><polyline points="15 3 21 3 21 9"></polyline><polyline points="9 21 3 21 3 15"></polyline><line x1="21" x2="14" y1="3" y2="10"></line><line x1="3" x2="10" y1="21" y2="14"></line></svg></button></div></div></div></a></figure></div><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!pAIo!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9c3e3ed8-4b12-4f82-a609-507113523d95_1435x765.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!pAIo!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9c3e3ed8-4b12-4f82-a609-507113523d95_1435x765.png 424w, https://substackcdn.com/image/fetch/$s_!pAIo!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9c3e3ed8-4b12-4f82-a609-507113523d95_1435x765.png 848w, https://substackcdn.com/image/fetch/$s_!pAIo!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9c3e3ed8-4b12-4f82-a609-507113523d95_1435x765.png 1272w, https://substackcdn.com/image/fetch/$s_!pAIo!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9c3e3ed8-4b12-4f82-a609-507113523d95_1435x765.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!pAIo!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9c3e3ed8-4b12-4f82-a609-507113523d95_1435x765.png" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/9c3e3ed8-4b12-4f82-a609-507113523d95_1435x765.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:null,&quot;width&quot;:null,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!pAIo!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9c3e3ed8-4b12-4f82-a609-507113523d95_1435x765.png 424w, https://substackcdn.com/image/fetch/$s_!pAIo!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9c3e3ed8-4b12-4f82-a609-507113523d95_1435x765.png 848w, https://substackcdn.com/image/fetch/$s_!pAIo!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9c3e3ed8-4b12-4f82-a609-507113523d95_1435x765.png 1272w, https://substackcdn.com/image/fetch/$s_!pAIo!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9c3e3ed8-4b12-4f82-a609-507113523d95_1435x765.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><h3>Inferencing</h3><p>Let's get the external IP of the loadbalancer from the cluster and make a REST request to the model endpoint, which will return the response of a model output 0 or 1.</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!7T5F!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F45b28b99-ac60-4f27-ae2d-07a8d6131f42_809x80.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!7T5F!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F45b28b99-ac60-4f27-ae2d-07a8d6131f42_809x80.png 424w, https://substackcdn.com/image/fetch/$s_!7T5F!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F45b28b99-ac60-4f27-ae2d-07a8d6131f42_809x80.png 848w, https://substackcdn.com/image/fetch/$s_!7T5F!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F45b28b99-ac60-4f27-ae2d-07a8d6131f42_809x80.png 1272w, https://substackcdn.com/image/fetch/$s_!7T5F!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F45b28b99-ac60-4f27-ae2d-07a8d6131f42_809x80.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!7T5F!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F45b28b99-ac60-4f27-ae2d-07a8d6131f42_809x80.png" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/45b28b99-ac60-4f27-ae2d-07a8d6131f42_809x80.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:null,&quot;width&quot;:null,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;&quot;,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" title="" srcset="https://substackcdn.com/image/fetch/$s_!7T5F!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F45b28b99-ac60-4f27-ae2d-07a8d6131f42_809x80.png 424w, https://substackcdn.com/image/fetch/$s_!7T5F!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F45b28b99-ac60-4f27-ae2d-07a8d6131f42_809x80.png 848w, https://substackcdn.com/image/fetch/$s_!7T5F!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F45b28b99-ac60-4f27-ae2d-07a8d6131f42_809x80.png 1272w, https://substackcdn.com/image/fetch/$s_!7T5F!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F45b28b99-ac60-4f27-ae2d-07a8d6131f42_809x80.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!CZeC!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F11304b0f-4bb6-4c17-a29e-6b0434009ecf_1100x299.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!CZeC!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F11304b0f-4bb6-4c17-a29e-6b0434009ecf_1100x299.png 424w, https://substackcdn.com/image/fetch/$s_!CZeC!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F11304b0f-4bb6-4c17-a29e-6b0434009ecf_1100x299.png 848w, https://substackcdn.com/image/fetch/$s_!CZeC!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F11304b0f-4bb6-4c17-a29e-6b0434009ecf_1100x299.png 1272w, https://substackcdn.com/image/fetch/$s_!CZeC!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F11304b0f-4bb6-4c17-a29e-6b0434009ecf_1100x299.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!CZeC!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F11304b0f-4bb6-4c17-a29e-6b0434009ecf_1100x299.png" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/11304b0f-4bb6-4c17-a29e-6b0434009ecf_1100x299.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:null,&quot;width&quot;:null,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:&quot;&quot;,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" title="" srcset="https://substackcdn.com/image/fetch/$s_!CZeC!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F11304b0f-4bb6-4c17-a29e-6b0434009ecf_1100x299.png 424w, https://substackcdn.com/image/fetch/$s_!CZeC!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F11304b0f-4bb6-4c17-a29e-6b0434009ecf_1100x299.png 848w, https://substackcdn.com/image/fetch/$s_!CZeC!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F11304b0f-4bb6-4c17-a29e-6b0434009ecf_1100x299.png 1272w, https://substackcdn.com/image/fetch/$s_!CZeC!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F11304b0f-4bb6-4c17-a29e-6b0434009ecf_1100x299.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><h3>Endnotes</h3><p>In this demonstration, we have built an ML lifecycle right from creating a project structure to model deployment on AKS. This use case can be extended with features like continuous training, data pre-post processing, validation, model monitoring and much more.</p><p>Thank you for reading..! &#128591;<br>If you liked this use case, make sure to star the <a href="https://github.com/prasadzende/mlops_jdhubaks">GitHub repo</a> &#128521;&nbsp; &nbsp;&nbsp;</p><h3>References</h3><p>1] <a href="https://arxiv.org/abs/2103.08942">Who Needs MLOps: What Data Scientists Seek to Accomplish and How Can MLOps Help</a></p>]]></content:encoded></item></channel></rss>