<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Thu Kha Kyawe</title>
    <description>The latest articles on DEV Community by Thu Kha Kyawe (@thukhakyawe_cloud).</description>
    <link>https://dev.to/thukhakyawe_cloud</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F3601335%2Fd44a63a0-36bb-4c80-a1f0-1d55fd8ccc1c.png</url>
      <title>DEV Community: Thu Kha Kyawe</title>
      <link>https://dev.to/thukhakyawe_cloud</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/thukhakyawe_cloud"/>
    <language>en</language>
    <item>
      <title>Day 12: Configure a DVC Remote Storage</title>
      <dc:creator>Thu Kha Kyawe</dc:creator>
      <pubDate>Tue, 16 Jun 2026 12:02:21 +0000</pubDate>
      <link>https://dev.to/thukhakyawe_cloud/day-12-configure-a-dvc-remote-storage-4ld4</link>
      <guid>https://dev.to/thukhakyawe_cloud/day-12-configure-a-dvc-remote-storage-4ld4</guid>
      <description>&lt;h1&gt;
  
  
  Lab Information
&lt;/h1&gt;

&lt;p&gt;The xFusionCorp Industries ML team uses SeaweedFS as the shared S3-compatible object store for DVC-tracked data. A .dvc/config already declares a remote called s3 for the fraud-detection project, but dvc push currently fails. Correct the configuration and push the tracked data into the SeaweedFS bucket.&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;A project exists at /root/code/fraud-detection/ with DVC initialised and data/raw/transactions.csv already tracked.

SeaweedFS is already running on the controlplane:
    S3 endpoint: http://localhost:8333
    Filer UI: open the SeaweedFS Filer button at the top of the lab (forwarded port 8888) – buckets are visible under /buckets/.
    Credentials: weedadmin / weedadmin123 (already set in .dvc/config)
    Bucket name: dvc-storage (already created and visible in the Filer UI under /buckets/dvc-storage)

Review the existing .dvc/config and correct everything that prevents dvc push from succeeding. The remote called s3 must:
    point at the dvc-storage bucket using s3://;
    use the correct SeaweedFS S3 endpoint URL;
    be marked as the default remote.

Push the tracked data. After the push, the dvc-storage bucket in the SeaweedFS Filer UI must contain at least one object under the files/md5/... prefix.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;




&lt;h1&gt;
  
  
  Lab Solutions
&lt;/h1&gt;

&lt;p&gt;✅ Part 1: Lab Step-by-Step Guidelines&lt;/p&gt;

&lt;p&gt;Step 1: Move into the repository&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;cd&lt;/span&gt; /root/code/fraud-detection
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Step 2: Inspect the current DVC configuration&lt;/p&gt;

&lt;p&gt;View the config:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;cat&lt;/span&gt; .dvc/config
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Or:&lt;/p&gt;

&lt;p&gt;dvc remote list&lt;/p&gt;

&lt;p&gt;You will likely find one or more configuration mistakes.&lt;/p&gt;

&lt;p&gt;Step 3: Verify the remote configuration&lt;/p&gt;

&lt;p&gt;The lab requires:&lt;/p&gt;

&lt;p&gt;Setting Required Value&lt;br&gt;
Remote name s3&lt;br&gt;
Bucket  s3://dvc-storage&lt;br&gt;
Endpoint URL    &lt;a href="http://localhost:8333" rel="noopener noreferrer"&gt;http://localhost:8333&lt;/a&gt;&lt;br&gt;
Default remote  s3&lt;/p&gt;

&lt;p&gt;A correct configuration looks similar to:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight ini"&gt;&lt;code&gt;&lt;span class="nn"&gt;['remote "s3"']&lt;/span&gt;
    &lt;span class="py"&gt;url&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s"&gt;s3://dvc-storage&lt;/span&gt;
    &lt;span class="py"&gt;endpointurl&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s"&gt;http://localhost:8333&lt;/span&gt;
    &lt;span class="py"&gt;access_key_id&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s"&gt;weedadmin&lt;/span&gt;
    &lt;span class="py"&gt;secret_access_key&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s"&gt;weedadmin123&lt;/span&gt;

&lt;span class="nn"&gt;[core]&lt;/span&gt;
    &lt;span class="py"&gt;remote&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s"&gt;s3&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Step 4: Fix the configuration&lt;br&gt;
Set the remote URL&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;dvc remote modify s3 url s3://dvc-storage
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Set the SeaweedFS endpoint&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;dvc remote modify s3 endpointurl http://localhost:8333
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Set the remote as default&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;dvc remote default s3
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Step 5: Verify the final configuration&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;cat&lt;/span&gt; .dvc/config
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Confirm:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight ini"&gt;&lt;code&gt;&lt;span class="nn"&gt;[core]&lt;/span&gt;
    &lt;span class="py"&gt;remote&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s"&gt;s3&lt;/span&gt;
&lt;span class="nn"&gt;['remote "s3"']&lt;/span&gt;
    &lt;span class="py"&gt;url&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s"&gt;s3://dvc-storage&lt;/span&gt;
    &lt;span class="py"&gt;endpointurl&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s"&gt;http://localhost:8333&lt;/span&gt;
    &lt;span class="py"&gt;access_key_id&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s"&gt;weedadmin&lt;/span&gt;
    &lt;span class="py"&gt;secret_access_key&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s"&gt;weedadmin123&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Step 6: Check DVC status&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;dvc status
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Expected:&lt;/p&gt;

&lt;p&gt;Data and pipelines are up to date.&lt;/p&gt;

&lt;p&gt;Step 7: Push the data&lt;/p&gt;

&lt;p&gt;Run:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;dvc push
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Expected output:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight console"&gt;&lt;code&gt;&lt;span class="go"&gt;root@controlplane fraud-detection on  main [!] ➜  dvc push
Collecting                                           |1.00 [00:00,  658entry/s]
Pushing
1 file pushed   
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Step 8: Verify remote storage&lt;/p&gt;

&lt;p&gt;You can verify from DVC:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;dvc status &lt;span class="nt"&gt;-c&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Expected:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight console"&gt;&lt;code&gt;&lt;span class="go"&gt;root@controlplane fraud-detection on  main [!] ➜  dvc status -c
Cache and remote 's3' are in sync.           
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Step 9: Verify in SeaweedFS&lt;/p&gt;

&lt;p&gt;Open the SeaweedFS Filer UI:&lt;/p&gt;

&lt;p&gt;SeaweedFS Filer&lt;br&gt;
→ /buckets/&lt;br&gt;
→ dvc-storage/&lt;/p&gt;

&lt;p&gt;You should see a path similar to:&lt;/p&gt;

&lt;p&gt;files/&lt;br&gt;
└── md5/&lt;br&gt;
    └── xx/&lt;br&gt;
        └── xxxxxxxxxxxxxxxxxxxx&lt;/p&gt;

&lt;p&gt;The exact hash will vary.&lt;/p&gt;

&lt;p&gt;This confirms the dataset was uploaded successfully.&lt;/p&gt;

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




&lt;p&gt;🧠 Part 2: Simple Step-by-Step Explanation (Beginner Friendly)&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;What is happening in this lab?&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Previously, DVC was tracking the dataset locally.&lt;/p&gt;

&lt;p&gt;Right now:&lt;/p&gt;

&lt;p&gt;transactions.csv&lt;br&gt;
      ↓&lt;br&gt;
transactions.csv.dvc&lt;/p&gt;

&lt;p&gt;But the actual file content is only stored on your machine.&lt;/p&gt;

&lt;p&gt;The team wants all datasets backed up to a shared storage system.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;What is SeaweedFS?&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;SeaweedFS is acting like a private Amazon S3 service.&lt;/p&gt;

&lt;p&gt;Think of it as:&lt;/p&gt;

&lt;p&gt;Local Machine&lt;br&gt;
      ↓&lt;br&gt;
DVC&lt;br&gt;
      ↓&lt;br&gt;
SeaweedFS Bucket&lt;/p&gt;

&lt;p&gt;Instead of storing datasets in Git, DVC stores them in the bucket.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Why does dvc push fail?&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Usually because one of these is wrong:&lt;/p&gt;

&lt;p&gt;Wrong bucket name&lt;br&gt;
Wrong endpoint URL&lt;br&gt;
Remote not set as default&lt;/p&gt;

&lt;p&gt;The lab specifically tells us the correct values:&lt;/p&gt;

&lt;p&gt;Bucket: dvc-storage&lt;br&gt;
Endpoint: &lt;a href="http://localhost:8333" rel="noopener noreferrer"&gt;http://localhost:8333&lt;/a&gt;&lt;br&gt;
Remote: s3&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;What does dvc remote default s3 do?&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;It tells DVC:&lt;/p&gt;

&lt;p&gt;Whenever I push or pull,&lt;br&gt;
use the remote named "s3".&lt;/p&gt;

&lt;p&gt;Without this setting, DVC may not know which remote to use.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;What does dvc push do?&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;When you run:&lt;/p&gt;

&lt;p&gt;dvc push&lt;/p&gt;

&lt;p&gt;DVC uploads the tracked dataset into SeaweedFS.&lt;/p&gt;

&lt;p&gt;Conceptually:&lt;/p&gt;

&lt;p&gt;transactions.csv&lt;br&gt;
      ↓&lt;br&gt;
DVC Cache&lt;br&gt;
      ↓&lt;br&gt;
SeaweedFS Bucket&lt;/p&gt;




&lt;h5&gt;
  
  
  &lt;strong&gt;Resources &amp;amp; Next Steps&lt;/strong&gt;
&lt;/h5&gt;

&lt;h5&gt;
  
  
  📦 Full Code Repository: &lt;a href="https://github.com/thukhakyawe/100-Days-Of-MLOps-KodeKloud-Challenges-Solutions" rel="noopener noreferrer"&gt;KodeKloud Learning Labs&lt;/a&gt;
&lt;/h5&gt;

&lt;h5&gt;
  
  
  💬 Join Discussion: &lt;a href="https://dev.to/thukhakyawe_cloud"&gt;DEV Community&lt;/a&gt; - Share your thoughts and questions
&lt;/h5&gt;

&lt;h5&gt;
  
  
  💼 Let's Connect: &lt;a href="https://www.linkedin.com/in/thukhakyawe/" rel="noopener noreferrer"&gt;LinkedIn&lt;/a&gt; - I'd love to connect with you
&lt;/h5&gt;




&lt;h5&gt;
  
  
  &lt;strong&gt;Credits&lt;/strong&gt;
&lt;/h5&gt;

&lt;h5&gt;
  
  
  • All labs are from: &lt;a href="https://kodekloud.com/" rel="noopener noreferrer"&gt;KodeKloud&lt;/a&gt;
&lt;/h5&gt;

&lt;h5&gt;
  
  
  • I sincerely appreciate your provision of these valuable resources.
&lt;/h5&gt;




</description>
      <category>100daysofmlops</category>
      <category>kodekloud</category>
    </item>
    <item>
      <title>Day 11: Track a Dataset with DVC</title>
      <dc:creator>Thu Kha Kyawe</dc:creator>
      <pubDate>Tue, 16 Jun 2026 12:00:38 +0000</pubDate>
      <link>https://dev.to/thukhakyawe_cloud/day-11-track-a-dataset-with-dvc-4jmg</link>
      <guid>https://dev.to/thukhakyawe_cloud/day-11-track-a-dataset-with-dvc-4jmg</guid>
      <description>&lt;h1&gt;
  
  
  Lab Information
&lt;/h1&gt;

&lt;p&gt;A teammate has added the transactions dataset to the xFusionCorp Industries fraud-detection repository, but it was committed directly to Git instead of being tracked with DVC. Bring the repository in line with the team standard—every dataset under data/ must be tracked by DVC, not by Git.&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;A project exists at /root/code/fraud-detection/ with DVC already initialised. The dataset data/raw/transactions.csv is currently tracked by Git, and the team standard requires DVC to own it instead.

Stop Git from tracking the dataset without deleting it from disk.

Track the same dataset with DVC so a .dvc pointer file is produced and data/raw/.gitignore excludes the dataset itself.

Stage the new .dvc pointer and the new .gitignore, then record a Git commit with the message Track transactions dataset with DVC.

Once tracking is moved to DVC, the DVC TRACKED section in the EXPLORER panel will list the dataset, confirming the extension recognises it as a DVC-managed file.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;




&lt;h1&gt;
  
  
  Lab Solutions
&lt;/h1&gt;

&lt;p&gt;✅ Part 1: Lab Step-by-Step Guidelines&lt;/p&gt;

&lt;p&gt;Step 1: Move into the repository&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;cd&lt;/span&gt; /root/code/fraud-detection
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Verify the dataset is currently tracked by Git:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git ls-files | &lt;span class="nb"&gt;grep &lt;/span&gt;transactions.csv
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Expected:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight console"&gt;&lt;code&gt;&lt;span class="go"&gt;root@controlplane fraud-detection on  main ➜  git ls-files | grep transactions.csv
data/raw/transactions.csv
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Step 2: Stop Git from tracking the dataset (keep the file)&lt;/p&gt;

&lt;p&gt;The lab specifically says:&lt;/p&gt;

&lt;p&gt;Stop Git from tracking the dataset without deleting it from disk.&lt;/p&gt;

&lt;p&gt;Use:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git &lt;span class="nb"&gt;rm&lt;/span&gt; &lt;span class="nt"&gt;--cached&lt;/span&gt; data/raw/transactions.csv
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Important: Use --cached.&lt;/p&gt;

&lt;p&gt;Removes the file from Git tracking&lt;br&gt;
Keeps the actual file on disk&lt;/p&gt;

&lt;p&gt;Verify:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;ls&lt;/span&gt; &lt;span class="nt"&gt;-l&lt;/span&gt; data/raw/transactions.csv
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The file should still exist.&lt;/p&gt;

&lt;p&gt;Step 3: Track the dataset with DVC&lt;/p&gt;

&lt;p&gt;Run:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;dvc add data/raw/transactions.csv
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;DVC will create:&lt;/p&gt;

&lt;p&gt;data/raw/transactions.csv.dvc&lt;/p&gt;

&lt;p&gt;and update:&lt;/p&gt;

&lt;p&gt;data/raw/.gitignore&lt;/p&gt;

&lt;p&gt;Expected output:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight console"&gt;&lt;code&gt;&lt;span class="go"&gt;root@controlplane fraud-detection on  main [✘?] ➜  dvc add data/raw/transactions.csv
100% Adding...|███████████████████████████████████████|1/1 [00:00, 60.46file/s]

To track the changes with git, run:

        git add data/raw/.gitignore data/raw/transactions.csv.dvc

To enable auto staging, run:

        dvc config core.autostage true
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Step 4: Verify DVC artifacts&lt;/p&gt;

&lt;p&gt;Check:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;ls&lt;/span&gt; &lt;span class="nt"&gt;-la&lt;/span&gt; data/raw
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Expected:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight console"&gt;&lt;code&gt;&lt;span class="go"&gt;root@controlplane fraud-detection on  main [✘?] ➜  ls -la data/raw
total 20
drwxr-xr-x 2 root root 4096 Jun 14 11:59 .
drwxr-xr-x 3 root root 4096 Jun 14 11:56 ..
-rw-r--r-- 1 root root   18 Jun 14 11:59 .gitignore
-rw-r--r-- 1 root root  379 Jun 14 11:59 transactions.csv
-rw-r--r-- 1 root root   95 Jun 14 11:59 transactions.csv.dvc
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Inspect the new files:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;cat &lt;/span&gt;data/raw/.gitignore
&lt;span class="nb"&gt;cat &lt;/span&gt;data/raw/transactions.csv.dvc
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Step 5: Check Git status&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git status
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You should see something similar to:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight console"&gt;&lt;code&gt;&lt;span class="go"&gt;root@controlplane fraud-detection on  main [✘?] ➜  git status
On branch main
Changes to be committed:
&lt;/span&gt;&lt;span class="gp"&gt;  (use "git restore --staged &amp;lt;file&amp;gt;&lt;/span&gt;...&lt;span class="s2"&gt;" to unstage)
&lt;/span&gt;&lt;span class="go"&gt;        deleted:    data/raw/transactions.csv

Untracked files:
&lt;/span&gt;&lt;span class="gp"&gt;  (use "git add &amp;lt;file&amp;gt;&lt;/span&gt;...&lt;span class="s2"&gt;" to include in what will be committed)
&lt;/span&gt;&lt;span class="go"&gt;        data/
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Step 6: Stage the required files&lt;/p&gt;

&lt;p&gt;Stage everything needed for the migration:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git add data/raw/transactions.csv.dvc
git add data/raw/.gitignore
git add &lt;span class="nt"&gt;-u&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The git add -u stages the removal of transactions.csv from Git tracking.&lt;/p&gt;

&lt;p&gt;Verify:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git status
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Everything should be staged.&lt;/p&gt;

&lt;p&gt;Step 7: Commit the changes&lt;/p&gt;

&lt;p&gt;Use the exact commit message required by the lab:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git commit &lt;span class="nt"&gt;-m&lt;/span&gt; &lt;span class="s2"&gt;"Track transactions dataset with DVC"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Step 8: Verify the commit&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git log &lt;span class="nt"&gt;--oneline&lt;/span&gt; &lt;span class="nt"&gt;-n&lt;/span&gt; 1
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Expected:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight console"&gt;&lt;code&gt;&lt;span class="go"&gt;root@controlplane fraud-detection on  main ➜  git log --oneline -n 1
&lt;/span&gt;&lt;span class="gp"&gt;1b8a2c7 (HEAD -&amp;gt;&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;main&lt;span class="o"&gt;)&lt;/span&gt; Track transactions dataset with DVC
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Step 9: Final verification&lt;/p&gt;

&lt;p&gt;Confirm Git no longer tracks the dataset:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git ls-files | &lt;span class="nb"&gt;grep &lt;/span&gt;transactions.csv
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Expected:&lt;/p&gt;

&lt;p&gt;data/raw/transactions.csv.dvc&lt;/p&gt;

&lt;p&gt;Confirm DVC tracks it:&lt;/p&gt;

&lt;p&gt;dvc status&lt;/p&gt;

&lt;p&gt;Expected:&lt;/p&gt;

&lt;p&gt;Data and pipelines are up to date. &lt;/p&gt;




&lt;p&gt;🧠 Part 2: Simple Step-by-Step Explanation (Beginner Friendly)&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;What is the problem?&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Right now:&lt;/p&gt;

&lt;p&gt;Git&lt;br&gt;
 └── data/raw/transactions.csv&lt;/p&gt;

&lt;p&gt;Git is tracking a dataset file.&lt;/p&gt;

&lt;p&gt;The team standard says:&lt;/p&gt;

&lt;p&gt;Git → track code and metadata&lt;br&gt;
DVC → track datasets and models&lt;/p&gt;

&lt;p&gt;So we need to move ownership of the dataset from Git to DVC.&lt;/p&gt;

&lt;p&gt;Why use git rm --cached?&lt;/p&gt;

&lt;p&gt;If you run:&lt;/p&gt;

&lt;p&gt;git rm data/raw/transactions.csv&lt;/p&gt;

&lt;p&gt;Git removes the file completely.&lt;/p&gt;

&lt;p&gt;We don't want that.&lt;/p&gt;

&lt;p&gt;Instead:&lt;/p&gt;

&lt;p&gt;git rm --cached data/raw/transactions.csv&lt;/p&gt;

&lt;p&gt;removes it only from Git tracking.&lt;/p&gt;

&lt;p&gt;The file remains on disk:&lt;/p&gt;

&lt;p&gt;data/raw/transactions.csv&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;What does dvc add do?&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;When you run:&lt;/p&gt;

&lt;p&gt;dvc add data/raw/transactions.csv&lt;/p&gt;

&lt;p&gt;DVC creates a pointer file:&lt;/p&gt;

&lt;p&gt;data/raw/transactions.csv.dvc&lt;/p&gt;

&lt;p&gt;Think of it as:&lt;/p&gt;

&lt;p&gt;transactions.csv.dvc&lt;br&gt;
   ↓&lt;br&gt;
points to&lt;br&gt;
   ↓&lt;br&gt;
transactions.csv&lt;/p&gt;

&lt;p&gt;Git stores the small .dvc file instead of the large dataset.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Why is .gitignore created?&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;DVC automatically adds:&lt;/p&gt;

&lt;p&gt;data/raw/.gitignore&lt;/p&gt;

&lt;p&gt;so Git ignores:&lt;/p&gt;

&lt;p&gt;transactions.csv&lt;/p&gt;

&lt;p&gt;This prevents someone from accidentally committing the dataset again.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;What gets committed to Git?&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;After migration, Git stores:&lt;/p&gt;

&lt;p&gt;data/raw/transactions.csv.dvc&lt;br&gt;
data/raw/.gitignore&lt;/p&gt;

&lt;p&gt;Git no longer stores:&lt;/p&gt;

&lt;p&gt;data/raw/transactions.csv&lt;/p&gt;




&lt;h5&gt;
  
  
  &lt;strong&gt;Resources &amp;amp; Next Steps&lt;/strong&gt;
&lt;/h5&gt;

&lt;h5&gt;
  
  
  📦 Full Code Repository: &lt;a href="https://github.com/thukhakyawe/100-Days-Of-MLOps-KodeKloud-Challenges-Solutions" rel="noopener noreferrer"&gt;KodeKloud Learning Labs&lt;/a&gt;
&lt;/h5&gt;

&lt;h5&gt;
  
  
  💬 Join Discussion: &lt;a href="https://dev.to/thukhakyawe_cloud"&gt;DEV Community&lt;/a&gt; - Share your thoughts and questions
&lt;/h5&gt;

&lt;h5&gt;
  
  
  💼 Let's Connect: &lt;a href="https://www.linkedin.com/in/thukhakyawe/" rel="noopener noreferrer"&gt;LinkedIn&lt;/a&gt; - I'd love to connect with you
&lt;/h5&gt;




&lt;h5&gt;
  
  
  &lt;strong&gt;Credits&lt;/strong&gt;
&lt;/h5&gt;

&lt;h5&gt;
  
  
  • All labs are from: &lt;a href="https://kodekloud.com/" rel="noopener noreferrer"&gt;KodeKloud&lt;/a&gt;
&lt;/h5&gt;

&lt;h5&gt;
  
  
  • I sincerely appreciate your provision of these valuable resources.
&lt;/h5&gt;




</description>
      <category>100daysofmlops</category>
      <category>kodekloud</category>
    </item>
    <item>
      <title>Day 10: Install and Initialize DVC in an ML Project</title>
      <dc:creator>Thu Kha Kyawe</dc:creator>
      <pubDate>Tue, 16 Jun 2026 11:58:12 +0000</pubDate>
      <link>https://dev.to/thukhakyawe_cloud/day-10-install-and-initialize-dvc-in-an-ml-project-2hcp</link>
      <guid>https://dev.to/thukhakyawe_cloud/day-10-install-and-initialize-dvc-in-an-ml-project-2hcp</guid>
      <description>&lt;h1&gt;
  
  
  Lab Information
&lt;/h1&gt;

&lt;p&gt;The xFusionCorp Industries ML team is adopting DVC so that datasets and model files are versioned separately from code. Initialise DVC inside the existing Git repository at /root/code/fraud-detection/ and record the initialisation in Git.&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;A Git repository already exists at /root/code/fraud-detection/ with an initial commit.

Initialise DVC inside that repository so that the standard .dvc/ control directory and .dvcignore file are created alongside the existing Git working tree.

Stage every file that DVC produces during initialisation, and record them in a new Git commit with the message Initialize DVC.

Once initialisation is complete, the DVC extension will detect the new .dvc/ directory and surface the DVC TRACKED section in the EXPLORER panel together with a DVC indicator in the bottom status bar.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;




&lt;h1&gt;
  
  
  Lab Solutions
&lt;/h1&gt;

&lt;p&gt;✅ Part 1: Lab Step-by-Step Guidelines&lt;/p&gt;

&lt;p&gt;Step 1: Move into the existing Git repository&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;cd&lt;/span&gt; /root/code/fraud-detection
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Verify it's a Git repository:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git status
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You should see something like:&lt;/p&gt;

&lt;p&gt;On branch main&lt;br&gt;
nothing to commit, working tree clean&lt;/p&gt;

&lt;p&gt;Step 2: Verify DVC is installed&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;dvc version
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Expected output:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight console"&gt;&lt;code&gt;&lt;span class="go"&gt;root@controlplane fraud-detection on  master ➜  dvc version
DVC version: 3.67.1 (pip)
-------------------------
Platform: Python 3.12.3 on Linux-6.8.0-94-generic-x86_64-with-glibc2.39
Subprojects:
        dvc_data = 3.18.3
        dvc_objects = 5.2.0
        dvc_render = 1.0.2
        dvc_task = 0.40.2
        scmrepo = 3.6.2
Supports:
        http (aiohttp = 3.13.5, aiohttp-retry = 2.9.1),
        https (aiohttp = 3.13.5, aiohttp-retry = 2.9.1),
        s3 (s3fs = 2026.4.0)
Config:
        Global: /root/.config/dvc
        System: /etc/xdg/dvc
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Step 3: Initialize DVC&lt;/p&gt;

&lt;p&gt;Run:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;dvc init
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This creates:&lt;/p&gt;

&lt;p&gt;.dvc/&lt;br&gt;
.dvcignore&lt;/p&gt;

&lt;p&gt;Typical output:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight console"&gt;&lt;code&gt;&lt;span class="go"&gt;root@controlplane fraud-detection on  master ➜  dvc init
Initialized DVC repository.

You can now commit the changes to git.

+---------------------------------------------------------------------+
|                                                                     |
|        DVC has enabled anonymous aggregate usage analytics.         |
|     Read the analytics documentation (and how to opt-out) here:     |
&lt;/span&gt;&lt;span class="gp"&gt;|             &amp;lt;https://dvc.org/doc/user-guide/analytics&amp;gt;&lt;/span&gt;&lt;span class="w"&gt;              &lt;/span&gt;|
&lt;span class="go"&gt;|                                                                     |
+---------------------------------------------------------------------+

What's next?
------------
&lt;/span&gt;&lt;span class="gp"&gt;- Check out the documentation: &amp;lt;https://dvc.org/doc&amp;gt;&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="gp"&gt;- Get help and share ideas: &amp;lt;https://dvc.org/chat&amp;gt;&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="gp"&gt;- Star us on GitHub: &amp;lt;https://github.com/treeverse/dvc&amp;gt;&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Step 4: Verify the new files&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;ls&lt;/span&gt; &lt;span class="nt"&gt;-la&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You should now see:&lt;/p&gt;

&lt;p&gt;.dvc/&lt;br&gt;
.dvcignore&lt;/p&gt;

&lt;p&gt;You can also inspect:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;find .dvc
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Step 5: Check Git status&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git status
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Expected output will show new DVC files:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight console"&gt;&lt;code&gt;&lt;span class="go"&gt;root@controlplane fraud-detection on  master [+] ➜  git status
On branch master
Changes to be committed:
&lt;/span&gt;&lt;span class="gp"&gt;  (use "git restore --staged &amp;lt;file&amp;gt;&lt;/span&gt;...&lt;span class="s2"&gt;" to unstage)
&lt;/span&gt;&lt;span class="go"&gt;        new file:   .dvc/.gitignore
        new file:   .dvc/config
        new file:   .dvcignore
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Step 6: Stage all DVC-generated files&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git add .dvc .dvcignore
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Verify:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git status
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Everything should be staged.&lt;/p&gt;

&lt;p&gt;Step 7: Commit the DVC initialization&lt;/p&gt;

&lt;p&gt;Use the exact commit message required by the lab:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git commit &lt;span class="nt"&gt;-m&lt;/span&gt; &lt;span class="s2"&gt;"Initialize DVC"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Expected output:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight console"&gt;&lt;code&gt;&lt;span class="go"&gt;root@controlplane fraud-detection on  master [+] ➜  git commit -m "Initialize DVC"
[master e1de19a] Initialize DVC
 3 files changed, 6 insertions(+)
 create mode 100644 .dvc/.gitignore
 create mode 100644 .dvc/config
 create mode 100644 .dvcignore
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Step 8: Verify the commit&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git log &lt;span class="nt"&gt;--oneline&lt;/span&gt; &lt;span class="nt"&gt;-n&lt;/span&gt; 2
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Expected:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight console"&gt;&lt;code&gt;&lt;span class="go"&gt;root@controlplane fraud-detection on  master ➜  git log --oneline -n 2
&lt;/span&gt;&lt;span class="gp"&gt;e1de19a (HEAD -&amp;gt;&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;master&lt;span class="o"&gt;)&lt;/span&gt; Initialize DVC
&lt;span class="go"&gt;446962d Initial commit
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;p&gt;🧠 Part 2: Simple Step-by-Step Explanation (Beginner Friendly)&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;What is DVC?&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;DVC (Data Version Control) is a tool used in Machine Learning projects to track:&lt;/p&gt;

&lt;p&gt;Datasets&lt;br&gt;
Models&lt;br&gt;
Large files&lt;/p&gt;

&lt;p&gt;without storing them directly in Git.&lt;/p&gt;

&lt;p&gt;Think of it like:&lt;/p&gt;

&lt;p&gt;Git  -&amp;gt; tracks code&lt;br&gt;
DVC  -&amp;gt; tracks data and models&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Why are we running dvc init?&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The repository already exists as a Git project.&lt;/p&gt;

&lt;p&gt;When we run:&lt;/p&gt;

&lt;p&gt;dvc init&lt;/p&gt;

&lt;p&gt;DVC adds its own management files:&lt;/p&gt;

&lt;p&gt;.dvc/&lt;br&gt;
.dvcignore&lt;/p&gt;

&lt;p&gt;These files tell DVC how to manage datasets and model artifacts.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;What does .dvc/ contain?&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Example:&lt;/p&gt;

&lt;p&gt;.dvc/&lt;br&gt;
├── config&lt;br&gt;
├── .gitignore&lt;br&gt;
└── tmp/&lt;/p&gt;

&lt;p&gt;These files store DVC configuration information.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Why do we commit the DVC files?&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The lab specifically says:&lt;/p&gt;

&lt;p&gt;Record the initialization in Git.&lt;/p&gt;

&lt;p&gt;This means the new DVC files must be saved in Git history.&lt;/p&gt;

&lt;p&gt;So we:&lt;/p&gt;

&lt;p&gt;git add .dvc .dvcignore&lt;br&gt;
git commit -m "Initialize DVC"&lt;/p&gt;

&lt;p&gt;This creates a permanent record that DVC was enabled in the project.&lt;/p&gt;




&lt;h5&gt;
  
  
  &lt;strong&gt;Resources &amp;amp; Next Steps&lt;/strong&gt;
&lt;/h5&gt;

&lt;h5&gt;
  
  
  📦 Full Code Repository: &lt;a href="https://github.com/thukhakyawe/100-Days-Of-MLOps-KodeKloud-Challenges-Solutions" rel="noopener noreferrer"&gt;KodeKloud Learning Labs&lt;/a&gt;
&lt;/h5&gt;

&lt;h5&gt;
  
  
  💬 Join Discussion: &lt;a href="https://dev.to/thukhakyawe_cloud"&gt;DEV Community&lt;/a&gt; - Share your thoughts and questions
&lt;/h5&gt;

&lt;h5&gt;
  
  
  💼 Let's Connect: &lt;a href="https://www.linkedin.com/in/thukhakyawe/" rel="noopener noreferrer"&gt;LinkedIn&lt;/a&gt; - I'd love to connect with you
&lt;/h5&gt;




&lt;h5&gt;
  
  
  &lt;strong&gt;Credits&lt;/strong&gt;
&lt;/h5&gt;

&lt;h5&gt;
  
  
  • All labs are from: &lt;a href="https://kodekloud.com/" rel="noopener noreferrer"&gt;KodeKloud&lt;/a&gt;
&lt;/h5&gt;

&lt;h5&gt;
  
  
  • I sincerely appreciate your provision of these valuable resources.
&lt;/h5&gt;




</description>
      <category>100daysofmlops</category>
      <category>kodekloud</category>
    </item>
    <item>
      <title>5.Generate Tags and Keywords with AI</title>
      <dc:creator>Thu Kha Kyawe</dc:creator>
      <pubDate>Sun, 14 Jun 2026 11:30:00 +0000</pubDate>
      <link>https://dev.to/thukhakyawe_cloud/5generate-tags-and-keywords-with-ai-obi</link>
      <guid>https://dev.to/thukhakyawe_cloud/5generate-tags-and-keywords-with-ai-obi</guid>
      <description>&lt;h1&gt;
  
  
  Lab Information
&lt;/h1&gt;

&lt;p&gt;The datacenter AI Commerce team is developing tools to automatically enhance product visibility and branding through intelligent marketing assistance. You are tasked to build a Python-based Product Tag and Keyword Generator that creates creative titles and SEO-optimized keyword sets for product listings, helping businesses reach the right audience effectively.&lt;/p&gt;

&lt;p&gt;Your task is to create a function that generates a marketing title and a fixed number of SEO keywords based on a product description and a target tone. The file tag_generator.py is ready for your code.&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Initialize the OpenAIclient using api_key and base_url provided under /root/.bash_profile

Define a function named generate_seo(description: str, tone: str) -&amp;gt; str.

Construct a parameterized prompt asking the AI to:
    Generate a short, attention-grabbing product title (4-8 words) in the specified tone.
    Generate exactly ten low-competition keywords, separated by commas, for SEO tagging.

Send this prompt to the API, ensuring the output is strictly two lines:
    Line 1: The generated title.
    Line 2: The ten comma-separated keywords.

Use the following parameters:
    model: openai/gpt-4.1-mini
    messages: {"role": "user", "content": constructed prompt}
    max_tokens: 60
    temperature: 0.7 (for creative tone)

In the main execution, call the function with:
    Description: 'A waterproof, lightweight backpack designed for multi-day hikes in difficult terrain.'
    Tone: 'Rugged and Adventurous'

Print only the raw two-line output to the console.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;Notes:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Ensure you are working in the /root/openaiproject directory.

Your API credentials will be provided under /root/.bash_profile.

The entire output must consist of exactly two lines separated by a newline (\n), with no extra text.

The keywords line must contain exactly 10 comma-separated values (no spaces around commas).

Use hardcoded values for api_key and base_url when initializing the OpenAI client or read them from environment variables via os.environ.get('OPENAI_API_KEY') and os.environ.get('OPENAI_BASE_URL').

Before running tag_generator.py, create and activate a virtual environment, then install OpenAI using:
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;python3 -m venv venv &amp;amp;&amp;amp; source venv/bin/activate &amp;amp;&amp;amp; pip install openai&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;The output should be a single, case-sensitive word extracted from the AI's response.

You are allowed a maximum of 10 requests. After this, you may encounter a rate limiter error. Therefore, use your requests judiciously.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;




&lt;h1&gt;
  
  
  Lab Solutions
&lt;/h1&gt;

&lt;p&gt;Part 1: Lab Step-by-Step Guidelines&lt;/p&gt;

&lt;p&gt;Step 1 — Navigate to the Project Directory&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;cd&lt;/span&gt; /root/openaiproject
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Step 2 — Create and Activate Virtual Environment&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;python3 &lt;span class="nt"&gt;-m&lt;/span&gt; venv venv
&lt;span class="nb"&gt;source &lt;/span&gt;venv/bin/activate
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Step 3 — Install OpenAI SDK&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;pip &lt;span class="nb"&gt;install &lt;/span&gt;openai
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Step 4 — Verify OpenAI Variables&lt;/p&gt;

&lt;p&gt;Since your previous labs showed:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;printenv&lt;/span&gt; | &lt;span class="nb"&gt;grep &lt;/span&gt;OPENAI
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Output similar to:&lt;/p&gt;

&lt;p&gt;OPENAI_API_KEY=...&lt;br&gt;
OPENAI_API_BASE=&lt;a href="https://kodekey.ai.kodekloud.com/v1" rel="noopener noreferrer"&gt;https://kodekey.ai.kodekloud.com/v1&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Use:&lt;/p&gt;

&lt;p&gt;os.environ.get("OPENAI_API_KEY")&lt;br&gt;
os.environ.get("OPENAI_API_BASE")&lt;/p&gt;

&lt;p&gt;when creating the client.&lt;/p&gt;

&lt;p&gt;Step 5 — Edit tag_generator.py&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;vi /root/openaiproject/tag_generator.py
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Replace the contents with:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;os&lt;/span&gt;
&lt;span class="kn"&gt;from&lt;/span&gt; &lt;span class="n"&gt;openai&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;OpenAI&lt;/span&gt;

&lt;span class="n"&gt;client&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nc"&gt;OpenAI&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
    &lt;span class="n"&gt;api_key&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;os&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;environ&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;get&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;OPENAI_API_KEY&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt;
    &lt;span class="n"&gt;base_url&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;os&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;environ&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;get&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;OPENAI_API_BASE&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="p"&gt;)&lt;/span&gt;


&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;generate_seo&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;description&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;str, tone: str) -&amp;gt; str:&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;
    &lt;span class="n"&gt;prompt&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="sa"&gt;f&lt;/span&gt;&lt;span class="sh"&gt;"""&lt;/span&gt;&lt;span class="s"&gt;
Product Description:
&lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="n"&gt;description&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="s"&gt;

Tone:
&lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="n"&gt;tone&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="s"&gt;

Generate:
1. A short attention-grabbing product title (4-8 words).
2. Exactly 10 low-competition SEO keywords.

Output Rules:
- Output exactly two lines.
- Line 1: title only.
- Line 2: exactly 10 keywords.
- Keywords must be comma-separated.
- No spaces around commas.
- No numbering.
- No labels.
- No extra text.
&lt;/span&gt;&lt;span class="sh"&gt;"""&lt;/span&gt;

    &lt;span class="n"&gt;response&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;client&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;chat&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;completions&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;create&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
        &lt;span class="n"&gt;model&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;openai/gpt-4.1-mini&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="n"&gt;messages&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;
            &lt;span class="p"&gt;{&lt;/span&gt;
                &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;role&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;user&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
                &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;content&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;prompt&lt;/span&gt;
            &lt;span class="p"&gt;}&lt;/span&gt;
        &lt;span class="p"&gt;],&lt;/span&gt;
        &lt;span class="n"&gt;max_tokens&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="mi"&gt;60&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="n"&gt;temperature&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="mf"&gt;0.7&lt;/span&gt;
    &lt;span class="p"&gt;)&lt;/span&gt;

    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;response&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;choices&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;].&lt;/span&gt;&lt;span class="n"&gt;message&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;content&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;strip&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;


&lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;__name__&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;__main__&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="n"&gt;result&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;generate_seo&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
        &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;A waterproof, lightweight backpack designed for multi-day hikes in difficult terrain.&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Rugged and Adventurous&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;
    &lt;span class="p"&gt;)&lt;/span&gt;

    &lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;result&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Save and exit:&lt;/p&gt;

&lt;p&gt;Step 6 — Run the Script&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;python tag_generator.py
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Step 7 — Verify Output Format&lt;/p&gt;

&lt;p&gt;Example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight console"&gt;&lt;code&gt;&lt;span class="go"&gt;~/openaiproject ➜  python tag_generator.py
Trailblazer Waterproof Hiking Backpack  
waterproof backpack,hiking gear,multi-day backpack,lightweight hiking bag,rugged backpack,adventure gear,off-road backpack,durable hiking pack,outdoor backpack,trekking backpack
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;p&gt;Part 2: Simple Beginner-Friendly Explanation&lt;/p&gt;

&lt;p&gt;What This Lab Does&lt;/p&gt;

&lt;p&gt;In this lab, you are building an AI-powered SEO content generator.&lt;/p&gt;

&lt;p&gt;The AI receives:&lt;/p&gt;

&lt;p&gt;A product description&lt;br&gt;
A desired tone&lt;/p&gt;

&lt;p&gt;It then generates:&lt;/p&gt;

&lt;p&gt;A marketing title&lt;br&gt;
Ten SEO keywords&lt;/p&gt;

&lt;p&gt;This helps products become easier to find online.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Why We Use a Prompt
prompt = f"""
...
"""&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The prompt tells the AI exactly what to create.&lt;/p&gt;

&lt;p&gt;It includes:&lt;/p&gt;

&lt;p&gt;Product details&lt;br&gt;
Desired writing style&lt;br&gt;
Output format requirements&lt;/p&gt;

&lt;p&gt;A clear prompt helps the AI produce consistent results.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Why We Include the Tone
Tone:
Rugged and Adventurous&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The tone influences how the title sounds.&lt;/p&gt;

&lt;p&gt;For example:&lt;/p&gt;

&lt;p&gt;Professional Tone&lt;/p&gt;

&lt;p&gt;Lightweight Waterproof Hiking Backpack&lt;/p&gt;

&lt;p&gt;Rugged and Adventurous Tone&lt;/p&gt;

&lt;p&gt;Trailblazer Pack for Wild Terrain&lt;/p&gt;

&lt;p&gt;The same product can be presented differently depending on the target audience.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Why We Generate Keywords&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Keywords help search engines understand a product.&lt;/p&gt;

&lt;p&gt;Example keywords:&lt;/p&gt;

&lt;p&gt;waterproofhikingpack&lt;br&gt;
multidaybackpack&lt;br&gt;
adventurebackpack&lt;/p&gt;

&lt;p&gt;These keywords improve discoverability in online searches.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Why Temperature is 0.7
temperature=0.7&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;A higher temperature increases creativity.&lt;/p&gt;

&lt;p&gt;Benefits:&lt;/p&gt;

&lt;p&gt;More engaging titles&lt;br&gt;
More varied wording&lt;br&gt;
Better marketing-style content&lt;/p&gt;

&lt;p&gt;This is useful for branding and product promotion.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;How the Program Works&lt;br&gt;
The product description is provided.&lt;br&gt;
The desired tone is provided.&lt;br&gt;
Both are inserted into the prompt.&lt;br&gt;
The prompt is sent to the AI model.&lt;br&gt;
The model creates:&lt;br&gt;
One title&lt;br&gt;
Ten keywords&lt;br&gt;
The result is returned and printed.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Example Input&lt;br&gt;
Description:&lt;br&gt;
A waterproof, lightweight backpack designed for multi-day hikes in difficult terrain.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Tone:&lt;br&gt;
Rugged and Adventurous&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Example Output
Trailblazer Pack for Wild Terrain
waterproofhikingpack,multidaybackpack,ruggedtrailgear,lightweighthikingbag,adventurebackpack,trekkingequipment,outdoorhikingpack,mountaintrailpack,durablehikegear,backpackingessentials&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The first line is the marketing title.&lt;/p&gt;

&lt;p&gt;The second line contains exactly ten SEO keywords separated by commas with no spaces, matching the lab requirements.&lt;/p&gt;




&lt;h5&gt;
  
  
  &lt;strong&gt;Resources &amp;amp; Next Steps&lt;/strong&gt;
&lt;/h5&gt;

&lt;h5&gt;
  
  
  📦 Full Code Repository: &lt;a href="https://github.com/thukhakyawe/100-Days-Of-DevOps-KodeKloud-Challenges-Solutions" rel="noopener noreferrer"&gt;KodeKloud Learning Labs&lt;/a&gt;
&lt;/h5&gt;

&lt;h5&gt;
  
  
  💬 Join Discussion: &lt;a href="https://dev.to/thukhakyawe_cloud"&gt;DEV Community&lt;/a&gt; - Share your thoughts and questions
&lt;/h5&gt;

&lt;h5&gt;
  
  
  💼 Let's Connect: &lt;a href="https://www.linkedin.com/in/thukhakyawe/" rel="noopener noreferrer"&gt;LinkedIn&lt;/a&gt; - I'd love to connect with you
&lt;/h5&gt;




&lt;h5&gt;
  
  
  &lt;strong&gt;Credits&lt;/strong&gt;
&lt;/h5&gt;

&lt;h5&gt;
  
  
  • All labs are from: &lt;a href="https://kodekloud.com/" rel="noopener noreferrer"&gt;KodeKloud&lt;/a&gt;
&lt;/h5&gt;

&lt;h5&gt;
  
  
  • I sincerely appreciate your provision of these valuable resources.
&lt;/h5&gt;




</description>
      <category>ai</category>
      <category>kodekloud</category>
    </item>
    <item>
      <title>4.Create a Structured Quiz with AI</title>
      <dc:creator>Thu Kha Kyawe</dc:creator>
      <pubDate>Sun, 14 Jun 2026 08:30:00 +0000</pubDate>
      <link>https://dev.to/thukhakyawe_cloud/4create-a-structured-quiz-with-ai-3e4n</link>
      <guid>https://dev.to/thukhakyawe_cloud/4create-a-structured-quiz-with-ai-3e4n</guid>
      <description>&lt;h1&gt;
  
  
  Lab Information
&lt;/h1&gt;

&lt;p&gt;The nautilus AI Learning team is developing intelligent training tools that automatically generate learning content for developers and students. You are tasked to build a Python-based Structured Quiz Generator that creates a single, well-formatted multiple-choice question (MCQ) in JSON format to support automated learning modules.&lt;/p&gt;

&lt;p&gt;Build a function that generates a quiz on a given topic, ensuring the output is a strict JSON array containing a single question object. The file quiz_generator.py has been created.&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Initialize the OpenAI clientusing api_key andbase_urlunder /root/.bash_profile

Define a function generate_quiz(topic: str) -&amp;gt; str.

Implement the API call using a detailed prompt and system message to instruct the AI to generate exactly one multiple-choice question (MCQ) on the topic: 'Basic Linux Commands'.

The final output must be a JSON array containing a single object with the keys: question, options (an array of 4 strings), and answer (the correct option text).

Use the following parameters, and print the raw JSON output to the console:

model: openai/gpt-4.1-mini
max_tokens: 150
temperature: 0.3

You must output your response ONLY as a JSON array that strictly follows this schema:
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;[&lt;br&gt;
 {"question": "The question text.", "options": ["Option A", "Option B", "Option C", "Option D"], "answer": "The correct answer text."}&lt;br&gt;
 ]&lt;/p&gt;

&lt;p&gt;Notes:&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Ensure you are working in the /root/openaiproject folder.

Use the system message to strictly enforce the JSON format and the constraint of one question.

Use hardcoded values for api_key and base_url when initializing the OpenAI client or read them from environment variables via os.environ.get('OPENAI_API_KEY') and os.environ.get('OPENAI_BASE_URL').

Before running quiz_generator.py, create and activate a virtual environment, then install OpenAI using:
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;p&gt;python3 -m venv venv &amp;amp;&amp;amp; source venv/bin/activate &amp;amp;&amp;amp; pip install openai&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Question should be related to topic Linux operating system.

You are allowed a maximum of 10 requests. After this, you may encounter a rate limiter error. Therefore, use your requests judiciously.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;h1&gt;
  
  
  Lab Solutions
&lt;/h1&gt;

&lt;p&gt;Part 1: Lab Step-by-Step Guidelines&lt;/p&gt;

&lt;p&gt;Step 1 — Navigate to the Project Directory&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;cd&lt;/span&gt; /root/openaiproject
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Step 2 — Create and Activate a Virtual Environment&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;python3 &lt;span class="nt"&gt;-m&lt;/span&gt; venv venv
&lt;span class="nb"&gt;source &lt;/span&gt;venv/bin/activate
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Step 3 — Install OpenAI SDK&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;pip &lt;span class="nb"&gt;install &lt;/span&gt;openai
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Step 4 — Verify OpenAI Environment Variables&lt;/p&gt;

&lt;p&gt;Check which variables are available:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;printenv&lt;/span&gt; | &lt;span class="nb"&gt;grep &lt;/span&gt;OPENAI
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;From your previous labs, you likely have:&lt;/p&gt;

&lt;p&gt;OPENAI_API_KEY=...&lt;br&gt;
OPENAI_API_BASE=...&lt;/p&gt;

&lt;p&gt;Use the actual variable names that exist in your environment.&lt;/p&gt;

&lt;p&gt;Step 5 — Edit quiz_generator.py&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;vi /root/openaiproject/quiz_generator.py
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Replace the contents with:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;os&lt;/span&gt;
&lt;span class="kn"&gt;from&lt;/span&gt; &lt;span class="n"&gt;openai&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;OpenAI&lt;/span&gt;

&lt;span class="n"&gt;client&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nc"&gt;OpenAI&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
    &lt;span class="n"&gt;api_key&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;os&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;environ&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;get&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;OPENAI_API_KEY&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt;
    &lt;span class="n"&gt;base_url&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;os&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;environ&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;get&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;OPENAI_API_BASE&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="p"&gt;)&lt;/span&gt;


&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;generate_quiz&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;topic&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;str&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;-&amp;gt;&lt;/span&gt; &lt;span class="nb"&gt;str&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="n"&gt;system_message&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="sh"&gt;"""&lt;/span&gt;&lt;span class="s"&gt;
You are a quiz generator.

Generate EXACTLY one multiple-choice question.

Return ONLY a valid JSON array containing a single object.

Required schema:
[
  {
    &lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;question&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;: &lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Question text&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;,
    &lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;options&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;: [&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Option A&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;, &lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Option B&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;, &lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Option C&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;, &lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Option D&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;],
    &lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;answer&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;: &lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Correct option text&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;
  }
]

Rules:
- Generate exactly one question.
- Include exactly 4 options.
- The answer must match one option exactly.
- Do not include markdown.
- Do not include explanations.
- Output JSON only.
&lt;/span&gt;&lt;span class="sh"&gt;"""&lt;/span&gt;

    &lt;span class="n"&gt;user_message&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;
        &lt;span class="sa"&gt;f&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Generate one MCQ about the topic: &lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="n"&gt;topic&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="s"&gt;. &lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;
        &lt;span class="sa"&gt;f&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;The question should relate to Linux operating systems.&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;
    &lt;span class="p"&gt;)&lt;/span&gt;

    &lt;span class="n"&gt;response&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;client&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;chat&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;completions&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;create&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
        &lt;span class="n"&gt;model&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;openai/gpt-4.1-mini&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="n"&gt;messages&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;
            &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;role&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;system&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;content&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;system_message&lt;/span&gt;&lt;span class="p"&gt;},&lt;/span&gt;
            &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;role&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;user&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;content&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;user_message&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;
        &lt;span class="p"&gt;],&lt;/span&gt;
        &lt;span class="n"&gt;max_tokens&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="mi"&gt;150&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="n"&gt;temperature&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="mf"&gt;0.3&lt;/span&gt;
    &lt;span class="p"&gt;)&lt;/span&gt;

    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;response&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;choices&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;].&lt;/span&gt;&lt;span class="n"&gt;message&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;content&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;strip&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;


&lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;__name__&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;__main__&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="n"&gt;result&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;generate_quiz&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Basic Linux Commands&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;result&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Save and exit:&lt;/p&gt;

&lt;p&gt;Step 6 — Run the Script&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;python quiz_generator.py
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Step 7 — Verify Output&lt;/p&gt;

&lt;p&gt;Expected format:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight console"&gt;&lt;code&gt;&lt;span class="go"&gt;~/openaiproject ➜  python quiz_generator.py
[
  {
    "question": "Which command is used to list the files and directories in the current directory in Linux?",
    "options": ["ls", "cd", "mkdir", "rm"],
    "answer": "ls"
  }
]
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;p&gt;Part 2: Simple Beginner-Friendly Explanation&lt;/p&gt;

&lt;p&gt;What This Lab Does&lt;/p&gt;

&lt;p&gt;In this lab, you are building an AI-powered quiz generator.&lt;/p&gt;

&lt;p&gt;The AI will:&lt;/p&gt;

&lt;p&gt;Receive a topic.&lt;br&gt;
Create one multiple-choice question.&lt;br&gt;
Generate four answer choices.&lt;br&gt;
Identify the correct answer.&lt;br&gt;
Return everything in JSON format.&lt;/p&gt;

&lt;p&gt;This can be used in learning platforms, training systems, or educational applications.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Why We Use JSON&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;JSON (JavaScript Object Notation) is a common format for storing and exchanging structured data.&lt;/p&gt;

&lt;p&gt;Example:&lt;/p&gt;

&lt;p&gt;[&lt;br&gt;
  {&lt;br&gt;
    "question": "Which command lists files in Linux?",&lt;br&gt;
    "options": ["ls", "pwd", "cd", "mkdir"],&lt;br&gt;
    "answer": "ls"&lt;br&gt;
  }&lt;br&gt;
]&lt;/p&gt;

&lt;p&gt;JSON is easy for both humans and programs to read.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Why We Use a System Message
system_message = """
You are a quiz generator...
"""&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The system message provides strict instructions to the AI.&lt;/p&gt;

&lt;p&gt;It tells the model:&lt;/p&gt;

&lt;p&gt;Generate only one question.&lt;br&gt;
Use the required JSON format.&lt;br&gt;
Include four options.&lt;br&gt;
Provide the correct answer.&lt;br&gt;
Return JSON only.&lt;/p&gt;

&lt;p&gt;Think of the system message as the rules the AI must follow.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Why We Use a User Message
user_message = (
f"Generate one MCQ about the topic: {topic}"
)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The user message contains the actual task.&lt;/p&gt;

&lt;p&gt;In this lab, the topic is:&lt;/p&gt;

&lt;p&gt;Basic Linux Commands&lt;/p&gt;

&lt;p&gt;Think of it this way:&lt;/p&gt;

&lt;p&gt;System message = instructions&lt;br&gt;
User message = specific request&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Why Temperature is 0.3
temperature=0.3&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Temperature controls creativity.&lt;/p&gt;

&lt;p&gt;A value of 0.3:&lt;/p&gt;

&lt;p&gt;Allows some variation in questions.&lt;br&gt;
Keeps answers reliable.&lt;br&gt;
Produces consistent quiz content.&lt;/p&gt;

&lt;p&gt;This is useful when generating educational questions.&lt;/p&gt;




&lt;h5&gt;
  
  
  &lt;strong&gt;Resources &amp;amp; Next Steps&lt;/strong&gt;
&lt;/h5&gt;

&lt;h5&gt;
  
  
  📦 Full Code Repository: &lt;a href="https://github.com/thukhakyawe/100-Days-Of-DevOps-KodeKloud-Challenges-Solutions" rel="noopener noreferrer"&gt;KodeKloud Learning Labs&lt;/a&gt;
&lt;/h5&gt;

&lt;h5&gt;
  
  
  💬 Join Discussion: &lt;a href="https://dev.to/thukhakyawe_cloud"&gt;DEV Community&lt;/a&gt; - Share your thoughts and questions
&lt;/h5&gt;

&lt;h5&gt;
  
  
  💼 Let's Connect: &lt;a href="https://www.linkedin.com/in/thukhakyawe/" rel="noopener noreferrer"&gt;LinkedIn&lt;/a&gt; - I'd love to connect with you
&lt;/h5&gt;




&lt;h5&gt;
  
  
  &lt;strong&gt;Credits&lt;/strong&gt;
&lt;/h5&gt;

&lt;h5&gt;
  
  
  • All labs are from: &lt;a href="https://kodekloud.com/" rel="noopener noreferrer"&gt;KodeKloud&lt;/a&gt;
&lt;/h5&gt;

&lt;h5&gt;
  
  
  • I sincerely appreciate your provision of these valuable resources.
&lt;/h5&gt;




</description>
      <category>ai</category>
      <category>kodekloud</category>
    </item>
    <item>
      <title>3.Analyze Sentiment with AI</title>
      <dc:creator>Thu Kha Kyawe</dc:creator>
      <pubDate>Sun, 14 Jun 2026 05:30:00 +0000</pubDate>
      <link>https://dev.to/thukhakyawe_cloud/3analyze-sentiment-with-ai-mpl</link>
      <guid>https://dev.to/thukhakyawe_cloud/3analyze-sentiment-with-ai-mpl</guid>
      <description>&lt;h1&gt;
  
  
  Lab Information
&lt;/h1&gt;

&lt;p&gt;The datacenter AI Engineering team is developing tools to interpret the tone of developer communications. You are tasked to build a Python-based AI Sentiment Analyzer that identifies whether a given message or feedback is Positive, Negative, or Neutral, helping teams gauge emotional context quickly.&lt;/p&gt;

&lt;p&gt;Create a Python program named under /root/openaiproject/sentiment_analyzer.py that analyzes the sentiment (Positive, Negative, or Neutral) of a given text using the OpenAI API.&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Initialize the OpenAI client with the provided api_key and base_url.

Define a function named analyze_sentiment(text: str) -&amp;gt; str that:
    Constructs a parameterized prompt asking the AI to analyze the sentiment of the given text and respond with Sentiment and Reason.
    Sends this prompt to the API using the following parameters:
    model: openai/gpt-4.1-mini
    messages:{"role": "user", "content": constructed prompt}
    max_tokens: 60
    temperature: 0.0
    Extracts and returns both the Sentiment label (Positive, Negative, or Neutral) and a short Reason explaining the classification.

In the main execution block, analyze the following text:
I am really happy with the new update!

Print the output strictly in the following format:
Sentiment:&amp;lt;Positive/Negative/Neutral&amp;gt;
Reason:&amp;lt;short explanation&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;Notes:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Ensure you are working in the /root/openaiproject directory.

Your API credentials will be provided under /root/.bash_profile.

Use hardcoded values for api_key and base_url when initializing the OpenAI client or read them from environment variables via os.environ.get('OPENAI_API_KEY') and os.environ.get('OPENAI_BASE_URL').

Before running sentiment_analyzer.py, create and activate a virtual environment, then install OpenAI using:
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;python3 -m venv venv &amp;amp;&amp;amp; source venv/bin/activate &amp;amp;&amp;amp; pip install openai&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;The output should be a single, case-sensitive word &amp;amp; short reason extracted from the AI's response.

You are allowed a maximum of 10 requests. After this, you may encounter a rate limiter error. Therefore, use your requests judiciously.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;




&lt;h1&gt;
  
  
  Lab Solutions
&lt;/h1&gt;

&lt;p&gt;Part 1: Lab Step-by-Step Guidelines&lt;/p&gt;

&lt;p&gt;Step 1 — Navigate to the Project Directory&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;cd&lt;/span&gt; /root/openaiproject
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Step 2 — Create and Activate a Virtual Environment&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;python3 &lt;span class="nt"&gt;-m&lt;/span&gt; venv venv
&lt;span class="nb"&gt;source &lt;/span&gt;venv/bin/activate
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Step 3 — Verify Environment Variables&lt;/p&gt;

&lt;p&gt;Based on your previous labs, check which OpenAI variables are available:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;printenv&lt;/span&gt; | &lt;span class="nb"&gt;grep &lt;/span&gt;OPENAI
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You will likely see:&lt;/p&gt;

&lt;p&gt;OPENAI_API_KEY=...&lt;br&gt;
OPENAI_API_BASE=...&lt;/p&gt;

&lt;p&gt;Use the actual variable names that exist in your environment.&lt;/p&gt;

&lt;p&gt;Step 4 — Edit sentiment_analyzer.py&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;vi /root/openaiproject/sentiment_analyzer.py
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Replace the contents with:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;os&lt;/span&gt;
&lt;span class="kn"&gt;from&lt;/span&gt; &lt;span class="n"&gt;openai&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;OpenAI&lt;/span&gt;

&lt;span class="n"&gt;client&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nc"&gt;OpenAI&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
    &lt;span class="n"&gt;api_key&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;os&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;environ&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;get&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;OPENAI_API_KEY&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt;
    &lt;span class="n"&gt;base_url&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;os&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;environ&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;get&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;OPENAI_API_BASE&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="p"&gt;)&lt;/span&gt;


&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;analyze_sentiment&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;text&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;str&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;-&amp;gt;&lt;/span&gt; &lt;span class="nb"&gt;str&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="n"&gt;prompt&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="sa"&gt;f&lt;/span&gt;&lt;span class="sh"&gt;"""&lt;/span&gt;&lt;span class="s"&gt;
Analyze the sentiment of the following text.

Classify it as exactly one of:
- Positive
- Negative
- Neutral

Respond in exactly this format:

Sentiment:&amp;lt;Positive/Negative/Neutral&amp;gt;
Reason:&amp;lt;short explanation&amp;gt;

Text:
&lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="n"&gt;text&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="s"&gt;
&lt;/span&gt;&lt;span class="sh"&gt;"""&lt;/span&gt;

    &lt;span class="n"&gt;response&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;client&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;chat&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;completions&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;create&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
        &lt;span class="n"&gt;model&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;openai/gpt-4.1-mini&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="n"&gt;messages&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;
            &lt;span class="p"&gt;{&lt;/span&gt;
                &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;role&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;user&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
                &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;content&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;prompt&lt;/span&gt;
            &lt;span class="p"&gt;}&lt;/span&gt;
        &lt;span class="p"&gt;],&lt;/span&gt;
        &lt;span class="n"&gt;max_tokens&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="mi"&gt;60&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="n"&gt;temperature&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="mf"&gt;0.0&lt;/span&gt;
    &lt;span class="p"&gt;)&lt;/span&gt;

    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;response&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;choices&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;].&lt;/span&gt;&lt;span class="n"&gt;message&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;content&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;strip&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;


&lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;__name__&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;__main__&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="n"&gt;text&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;I am really happy with the new update!&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;

    &lt;span class="n"&gt;result&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;analyze_sentiment&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;text&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

    &lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;result&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Save and exit:&lt;/p&gt;

&lt;p&gt;Step 5 — Run the Script&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;python sentiment_analyzer.py
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Step 6 — Verify Output&lt;/p&gt;

&lt;p&gt;Expected format:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight console"&gt;&lt;code&gt;&lt;span class="go"&gt;~/openaiproject ➜  python sentiment_analyzer.py
Sentiment:Positive  
Reason: The text expresses happiness and satisfaction with the new update.
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;p&gt;Part 2: Simple Beginner-Friendly Explanation&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;What This Lab Does&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;In this lab, you are building a simple AI-powered sentiment analyzer.&lt;/p&gt;

&lt;p&gt;The AI reads a piece of text and determines whether the sentiment is:&lt;/p&gt;

&lt;p&gt;Positive&lt;br&gt;
Negative&lt;br&gt;
Neutral&lt;/p&gt;

&lt;p&gt;It also explains why it made that decision.&lt;/p&gt;

&lt;p&gt;This helps teams quickly understand the emotional tone of messages, comments, or feedback.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Why We Create a Prompt&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;prompt = f"""&lt;br&gt;
Analyze the sentiment of the following text...&lt;br&gt;
"""&lt;/p&gt;

&lt;p&gt;A prompt is the instruction we send to the AI.&lt;/p&gt;

&lt;p&gt;It tells the model:&lt;/p&gt;

&lt;p&gt;What task to perform&lt;br&gt;
Which sentiment labels are allowed&lt;br&gt;
What format the response should follow&lt;/p&gt;

&lt;p&gt;Good prompts help produce consistent results.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Why We Use a User Message&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;messages=[&lt;br&gt;
    {&lt;br&gt;
        "role": "user",&lt;br&gt;
        "content": prompt&lt;br&gt;
    }&lt;br&gt;
]&lt;/p&gt;

&lt;p&gt;The user message contains:&lt;/p&gt;

&lt;p&gt;The instructions&lt;br&gt;
The text being analyzed&lt;/p&gt;

&lt;p&gt;Think of it as:&lt;/p&gt;

&lt;p&gt;Prompt = task description + data&lt;br&gt;
User message = what is sent to the model&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Why Temperature is Zero&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;temperature=0.0&lt;/p&gt;

&lt;p&gt;Temperature controls randomness.&lt;/p&gt;

&lt;p&gt;A value of 0.0 means:&lt;/p&gt;

&lt;p&gt;Very consistent results&lt;br&gt;
Minimal creativity&lt;br&gt;
More predictable classifications&lt;/p&gt;

&lt;p&gt;This is useful for sentiment analysis because we want reliable answers.&lt;/p&gt;

&lt;p&gt;How the Analysis Works&lt;br&gt;
The script receives some text.&lt;br&gt;
The text is inserted into the prompt.&lt;br&gt;
The prompt is sent to the AI model.&lt;br&gt;
The model determines the sentiment.&lt;br&gt;
The model provides a short reason.&lt;br&gt;
The result is printed to the terminal.&lt;/p&gt;

&lt;p&gt;Example Input&lt;br&gt;
I am really happy with the new update!&lt;/p&gt;

&lt;p&gt;The phrase:&lt;/p&gt;

&lt;p&gt;really happy&lt;/p&gt;

&lt;p&gt;shows satisfaction and enthusiasm.&lt;/p&gt;

&lt;p&gt;Example Output&lt;br&gt;
Sentiment:Positive&lt;br&gt;
Reason:Expresses happiness and satisfaction with the update.&lt;/p&gt;

&lt;p&gt;Only the sentiment and reason are printed, making the output easy to read and process.&lt;/p&gt;




&lt;h5&gt;
  
  
  &lt;strong&gt;Resources &amp;amp; Next Steps&lt;/strong&gt;
&lt;/h5&gt;

&lt;h5&gt;
  
  
  📦 Full Code Repository: &lt;a href="https://github.com/thukhakyawe/100-Days-Of-DevOps-KodeKloud-Challenges-Solutions" rel="noopener noreferrer"&gt;KodeKloud Learning Labs&lt;/a&gt;
&lt;/h5&gt;

&lt;h5&gt;
  
  
  💬 Join Discussion: &lt;a href="https://dev.to/thukhakyawe_cloud"&gt;DEV Community&lt;/a&gt; - Share your thoughts and questions
&lt;/h5&gt;

&lt;h5&gt;
  
  
  💼 Let's Connect: &lt;a href="https://www.linkedin.com/in/thukhakyawe/" rel="noopener noreferrer"&gt;LinkedIn&lt;/a&gt; - I'd love to connect with you
&lt;/h5&gt;




&lt;h5&gt;
  
  
  &lt;strong&gt;Credits&lt;/strong&gt;
&lt;/h5&gt;

&lt;h5&gt;
  
  
  • All labs are from: &lt;a href="https://kodekloud.com/" rel="noopener noreferrer"&gt;KodeKloud&lt;/a&gt;
&lt;/h5&gt;

&lt;h5&gt;
  
  
  • I sincerely appreciate your provision of these valuable resources.
&lt;/h5&gt;




</description>
      <category>kodekloud</category>
      <category>ai</category>
    </item>
    <item>
      <title>2.Analyse Logs with AI</title>
      <dc:creator>Thu Kha Kyawe</dc:creator>
      <pubDate>Sun, 14 Jun 2026 02:30:00 +0000</pubDate>
      <link>https://dev.to/thukhakyawe_cloud/2analyse-logs-with-ai-m71</link>
      <guid>https://dev.to/thukhakyawe_cloud/2analyse-logs-with-ai-m71</guid>
      <description>&lt;h1&gt;
  
  
  Lab Information
&lt;/h1&gt;

&lt;p&gt;The datacenter AI Reliability team is designing intelligent tools to monitor application health and proactively detect production issues. You are tasked to build a Python-based Log Anomaly Detector and Summarizer that reads a log file, identifies the most critical failure, and generates a concise, human-readable summary — helping engineers quickly understand the nature and impact of system errors.&lt;/p&gt;

&lt;p&gt;Your task is to build a Python script to detect and summarize critical errors from a log file. The file log_analyzer.py has been created under /root/openaiproject.&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Initialize the OpenAI client using the api_key and base_url provided in your environment.

Define a function named analyze_log_anomaly(log_file_path: str) -&amp;gt; str.

Inside the function:
    Read the entire content of the provided log file (app.log under/root/openaiproject).
    Construct the API call using both a system message and a user message.
    The system instruction is critical: You must instruct the AI to act as an auditor, focus ONLY on the [CRITICAL] line, and provide a two-part summary: 1) The error type, 2) Immediate Impact.

Send this prompt (including the log content in the user message) to the API using the following parameters:
    model: openai/gpt-4.1-mini
    messages: [{"role": "user", "content": prompt}]
    max_tokens: 80
    temperature: 0.1 (for factual summarization)

In the main execution, call the function with the path '/root/openaiproject/app.log' and print only the raw summary to the console.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;Notes:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Ensure you are working in the /root/openaiproject folder.

You will be provided with an OpenAI api_key &amp;amp; base_urlfor this session under /root/.bash_profile

The prompt must include the log file content.

The final output printed should be only the concise summary text.

Use hardcoded values for api_key and base_url when initializing the OpenAI client or read them from environment variables via os.environ.get('OPENAI_API_KEY') and os.environ.get('OPENAI_BASE_URL').

Before running log_analyzer.py, create and activate a virtual environment, then install OpenAI using:
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;python3 -m venv venv &amp;amp;&amp;amp; source venv/bin/activate &amp;amp;&amp;amp; pip install openai&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;You are allowed a maximum of 10 requests. After this, you may encounter a rate limiter error. Therefore, use your requests judiciously.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;




&lt;h1&gt;
  
  
  Lab Solutions
&lt;/h1&gt;

&lt;p&gt;Part 1: Lab Step-by-Step Guidelines&lt;/p&gt;

&lt;p&gt;Step 1 — Navigate to the Project Directory&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;cd&lt;/span&gt; /root/openaiproject
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Step 2 — Create and Activate Virtual Environment&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;python3 &lt;span class="nt"&gt;-m&lt;/span&gt; venv venv
&lt;span class="nb"&gt;source &lt;/span&gt;venv/bin/activate
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Step 3 — Install OpenAI SDK&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;pip &lt;span class="nb"&gt;install &lt;/span&gt;openai
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Step 4 — Check Environment Variables&lt;/p&gt;

&lt;p&gt;Based on your previous lab, verify the actual variable names:&lt;/p&gt;

&lt;p&gt;printenv | grep OPENAI&lt;/p&gt;

&lt;p&gt;You will likely see:&lt;/p&gt;

&lt;p&gt;OPENAI_API_KEY=...&lt;br&gt;
OPENAI_API_BASE=...&lt;/p&gt;

&lt;p&gt;If so, use OPENAI_API_BASE in your code.&lt;/p&gt;

&lt;p&gt;Step 5 — Edit log_analyzer.py&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;vi /root/openaiproject/log_analyzer.py
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Replace the file contents with:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;os&lt;/span&gt;
&lt;span class="kn"&gt;from&lt;/span&gt; &lt;span class="n"&gt;openai&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;OpenAI&lt;/span&gt;

&lt;span class="n"&gt;client&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nc"&gt;OpenAI&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
    &lt;span class="n"&gt;api_key&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;os&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;environ&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;get&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;OPENAI_API_KEY&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt;
    &lt;span class="n"&gt;base_url&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;os&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;environ&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;get&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;OPENAI_API_BASE&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="p"&gt;)&lt;/span&gt;


&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;analyze_log_anomaly&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;log_file_path&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;str&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;-&amp;gt;&lt;/span&gt; &lt;span class="nb"&gt;str&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="k"&gt;with&lt;/span&gt; &lt;span class="nf"&gt;open&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;log_file_path&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;r&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;as&lt;/span&gt; &lt;span class="nb"&gt;file&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
        &lt;span class="n"&gt;log_content&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;file&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;read&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;

    &lt;span class="n"&gt;system_message&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;
        &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;You are an auditor. Focus ONLY on the [CRITICAL] log entry. &lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;
        &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Provide a concise two-part summary:&lt;/span&gt;&lt;span class="se"&gt;\n&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;
        &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;1. Error Type&lt;/span&gt;&lt;span class="se"&gt;\n&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;
        &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;2. Immediate Impact&lt;/span&gt;&lt;span class="se"&gt;\n&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;
        &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Ignore all non-critical log entries.&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;
    &lt;span class="p"&gt;)&lt;/span&gt;

    &lt;span class="n"&gt;user_message&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="sa"&gt;f&lt;/span&gt;&lt;span class="sh"&gt;"""&lt;/span&gt;&lt;span class="s"&gt;
Analyze the following log file.

Log Content:
&lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="n"&gt;log_content&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="s"&gt;
&lt;/span&gt;&lt;span class="sh"&gt;"""&lt;/span&gt;

    &lt;span class="n"&gt;response&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;client&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;chat&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;completions&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;create&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
        &lt;span class="n"&gt;model&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;openai/gpt-4.1-mini&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="n"&gt;messages&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;
            &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;role&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;system&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;content&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;system_message&lt;/span&gt;&lt;span class="p"&gt;},&lt;/span&gt;
            &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;role&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;user&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;content&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;user_message&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;
        &lt;span class="p"&gt;],&lt;/span&gt;
        &lt;span class="n"&gt;max_tokens&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="mi"&gt;80&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="n"&gt;temperature&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="mf"&gt;0.1&lt;/span&gt;
    &lt;span class="p"&gt;)&lt;/span&gt;

    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;response&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;choices&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;].&lt;/span&gt;&lt;span class="n"&gt;message&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;content&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;strip&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;


&lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;__name__&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;__main__&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="n"&gt;result&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;analyze_log_anomaly&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
        &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;/root/openaiproject/app.log&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;
    &lt;span class="p"&gt;)&lt;/span&gt;

    &lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;result&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Save:&lt;/p&gt;

&lt;p&gt;Step 6 — Run the Script&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;python log_analyzer.py
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Example Output:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight console"&gt;&lt;code&gt;&lt;span class="go"&gt;~/openaiproject ✖ python log_analyzer.py
1. Error Type: OutOfMemoryError in main thread due to JVM heap exhaustion.  
2. Immediate Impact: Service is shutting down immediately, causing potential downtime and service unavailability.
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;p&gt;Part 2: Simple Beginner-Friendly Explanation&lt;/p&gt;

&lt;p&gt;What This Lab Does&lt;/p&gt;

&lt;p&gt;In this lab, you are building a simple AI-powered log analyzer.&lt;/p&gt;

&lt;p&gt;Instead of manually reading hundreds or thousands of log entries, the AI:&lt;/p&gt;

&lt;p&gt;Reads the log file.&lt;br&gt;
Examines the log entries.&lt;br&gt;
Focuses on the most important [CRITICAL] event.&lt;br&gt;
Generates a short, human-readable summary.&lt;br&gt;
Explains the immediate impact of the problem.&lt;/p&gt;

&lt;p&gt;This helps engineers quickly understand serious production issues.&lt;/p&gt;

&lt;p&gt;Why We Read the Log File&lt;br&gt;
with open(log_file_path, "r") as file:&lt;br&gt;
    log_content = file.read()&lt;/p&gt;

&lt;p&gt;This code opens the log file and reads all its contents into a variable called log_content.&lt;/p&gt;

&lt;p&gt;Example log:&lt;/p&gt;

&lt;p&gt;[INFO] Service started&lt;br&gt;
[WARNING] Memory usage high&lt;br&gt;
[CRITICAL] Database connection failed&lt;/p&gt;

&lt;p&gt;The AI can only analyze information that is sent to it. Therefore, the log file contents must be included in the API request.&lt;/p&gt;

&lt;p&gt;Why We Use a System Message&lt;br&gt;
system_message = (&lt;br&gt;
    "You are an auditor..."&lt;br&gt;
)&lt;/p&gt;

&lt;p&gt;The system message provides instructions that guide the AI's behavior.&lt;/p&gt;

&lt;p&gt;In this lab, it tells the AI to:&lt;/p&gt;

&lt;p&gt;Act as an auditor.&lt;br&gt;
Focus on the [CRITICAL] log entry.&lt;br&gt;
Identify the error type.&lt;br&gt;
Describe the immediate impact.&lt;br&gt;
Avoid summarizing the entire log file.&lt;/p&gt;

&lt;p&gt;Think of the system message as the rules the AI must follow.&lt;/p&gt;

&lt;p&gt;Why We Use a User Message&lt;br&gt;
user_message = f"""&lt;br&gt;
Analyze the following log file.&lt;/p&gt;

&lt;p&gt;Log Content:&lt;br&gt;
{log_content}&lt;br&gt;
"""&lt;/p&gt;

&lt;p&gt;The user message contains the actual data that the AI will analyze.&lt;/p&gt;

&lt;p&gt;It includes the full contents of the log file.&lt;/p&gt;

&lt;p&gt;Think of it this way:&lt;/p&gt;

&lt;p&gt;System message = instructions&lt;br&gt;
User message = data&lt;/p&gt;

&lt;p&gt;The AI follows the instructions from the system message while analyzing the data in the user message.&lt;/p&gt;

&lt;p&gt;Why We Use a Low Temperature&lt;br&gt;
temperature=0.1&lt;/p&gt;

&lt;p&gt;Temperature controls how creative the AI is.&lt;/p&gt;

&lt;p&gt;A low temperature:&lt;/p&gt;

&lt;p&gt;Produces more consistent responses.&lt;br&gt;
Reduces randomness.&lt;br&gt;
Focuses on factual information.&lt;br&gt;
Helps generate reliable summaries.&lt;/p&gt;

&lt;p&gt;This is ideal for log analysis because accuracy is more important than creativity.&lt;/p&gt;

&lt;p&gt;How the API Processes the Logs&lt;br&gt;
The script reads the log file.&lt;br&gt;
The log contents are added to the user message.&lt;br&gt;
The system message tells the AI what to look for.&lt;br&gt;
The request is sent to the AI model.&lt;br&gt;
The AI finds the critical issue and summarizes it.&lt;br&gt;
The summary is returned and printed to the terminal.&lt;br&gt;
Example Output&lt;/p&gt;

&lt;p&gt;If the critical log entry is:&lt;/p&gt;

&lt;p&gt;[CRITICAL] Database connection failed&lt;/p&gt;

&lt;p&gt;The AI might return:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Error Type: Database Connection Failure&lt;/li&gt;
&lt;li&gt;Immediate Impact: Application cannot access backend data and user requests may fail.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Only the summary is printed to the console, making it easy for engineers to quickly understand the problem.&lt;/p&gt;




&lt;h5&gt;
  
  
  &lt;strong&gt;Resources &amp;amp; Next Steps&lt;/strong&gt;
&lt;/h5&gt;

&lt;h5&gt;
  
  
  📦 Full Code Repository: &lt;a href="https://github.com/thukhakyawe/100-Days-Of-DevOps-KodeKloud-Challenges-Solutions" rel="noopener noreferrer"&gt;KodeKloud Learning Labs&lt;/a&gt;
&lt;/h5&gt;

&lt;h5&gt;
  
  
  💬 Join Discussion: &lt;a href="https://dev.to/thukhakyawe_cloud"&gt;DEV Community&lt;/a&gt; - Share your thoughts and questions
&lt;/h5&gt;

&lt;h5&gt;
  
  
  💼 Let's Connect: &lt;a href="https://www.linkedin.com/in/thukhakyawe/" rel="noopener noreferrer"&gt;LinkedIn&lt;/a&gt; - I'd love to connect with you
&lt;/h5&gt;




&lt;h5&gt;
  
  
  &lt;strong&gt;Credits&lt;/strong&gt;
&lt;/h5&gt;

&lt;h5&gt;
  
  
  • All labs are from: &lt;a href="https://kodekloud.com/" rel="noopener noreferrer"&gt;KodeKloud&lt;/a&gt;
&lt;/h5&gt;

&lt;h5&gt;
  
  
  • I sincerely appreciate your provision of these valuable resources.
&lt;/h5&gt;




</description>
      <category>ai</category>
      <category>kodekloud</category>
    </item>
    <item>
      <title>1.Generate Commit Messages with AI</title>
      <dc:creator>Thu Kha Kyawe</dc:creator>
      <pubDate>Sat, 13 Jun 2026 23:30:00 +0000</pubDate>
      <link>https://dev.to/thukhakyawe_cloud/1generate-commit-messages-with-ai-2e2j</link>
      <guid>https://dev.to/thukhakyawe_cloud/1generate-commit-messages-with-ai-2e2j</guid>
      <description>&lt;h1&gt;
  
  
  Lab Information
&lt;/h1&gt;

&lt;p&gt;The xfusion AI Development Team is building intelligent developer-assistance tools that enhance productivity and communication across engineering workflows. Continuing this mission, you are tasked to develop a Python-based AI Commit Generator that analyzes code change descriptions and produces clean, Conventional Commit–style messages — ensuring consistency and clarity in version control histories.&lt;/p&gt;

&lt;p&gt;Your task is to build a function that takes a summary of code changes and generates a formal Git commit message adhering to the Conventional Commit standard (: ). The file /root/openaiproject/commit_generator.py is ready.&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Initialize the OpenAI client using api_key &amp;amp; base_url credentials provided under root/.bash_profile.

Define a function named generate_commit(changes: str) -&amp;gt; str.

Construct a detailed prompt asking the AI to:
    Analyze the input changes.
    Choose the appropriate commit type from: feat, fix, or docs.
    Generate a concise subject (under 50 characters).
    The output must be only the commit message in the exact format: &amp;lt;type&amp;gt;: &amp;lt;subject&amp;gt;.

Send this prompt to the API using the following parameters:
    model: openai/gpt-4.1-mini
    messages: [{\"role\": \"user\", \"content\": prompt}]
    max_tokens: 30
    temperature: 0.0 (for strict formatting)

In the main execution, call the function with the changes summary:
    Summary: 'Added a new user registration endpoint and fixed a typo in the README file.'

Print only the generated commit message to the console.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;Notes:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;The final output must be a single line of text.

The output must contain a colon (:) exactly once, separating the type and subject.

Ensure the commit type correctly matches the primary nature of the change (e.g., feat for new functionality, fix for a bug correction, docs for documentation updates).

Use hardcoded values for api_key and base_url when initializing the OpenAI client or read them from environment variables via os.environ.get('OPENAI_API_KEY') and os.environ.get('OPENAI_BASE_URL').

Before running commit_generator.py, create and activate a virtual environment, then install OpenAI using:
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;python3 -m venv venv &amp;amp;&amp;amp; source venv/bin/activate &amp;amp;&amp;amp; pip install openai&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;The script should strictly output only the formatted commit message, with no additional commentary or lines.

You are allowed a maximum of 10 requests. After this, you may encounter a rate limiter error. Therefore, use your requests judiciously.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;




&lt;h1&gt;
  
  
  Lab Solutions
&lt;/h1&gt;

&lt;p&gt;Part 1: Lab Step-by-Step Guidelines&lt;/p&gt;

&lt;p&gt;Step 1 — Navigate to the Project Directory&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;cd&lt;/span&gt; /root/openaiproject
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Step 2 — Create and Activate a Virtual Environment&lt;/p&gt;

&lt;p&gt;Run:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;python3 &lt;span class="nt"&gt;-m&lt;/span&gt; venv venv
&lt;span class="nb"&gt;source &lt;/span&gt;venv/bin/activate
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Step 3 — Install OpenAI SDK&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;pip &lt;span class="nb"&gt;install &lt;/span&gt;openai
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Step 4 — Open the Python File&lt;/p&gt;

&lt;p&gt;Edit the file:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;vi commit_generator.py
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Replace everything with:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;os&lt;/span&gt;
&lt;span class="kn"&gt;from&lt;/span&gt; &lt;span class="n"&gt;openai&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;OpenAI&lt;/span&gt;

&lt;span class="n"&gt;client&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nc"&gt;OpenAI&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
    &lt;span class="n"&gt;api_key&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;os&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;environ&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;get&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;OPENAI_API_KEY&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt;
    &lt;span class="n"&gt;base_url&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;os&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;environ&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;get&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;OPENAI_API_BASE&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="p"&gt;)&lt;/span&gt;


&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;generate_commit&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;changes&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;str&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;-&amp;gt;&lt;/span&gt; &lt;span class="nb"&gt;str&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="n"&gt;prompt&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="sa"&gt;f&lt;/span&gt;&lt;span class="sh"&gt;"""&lt;/span&gt;&lt;span class="s"&gt;
Analyze the following code changes and generate a Conventional Commit message.

Rules:
- Choose only one commit type from: feat, fix, docs
- Format must be exactly: &amp;lt;type&amp;gt;: &amp;lt;subject&amp;gt;
- Subject must be concise and under 50 characters
- Output only the commit message
- Do not include quotes or extra text

Changes:
&lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="n"&gt;changes&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="s"&gt;
&lt;/span&gt;&lt;span class="sh"&gt;"""&lt;/span&gt;

    &lt;span class="n"&gt;response&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;client&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;chat&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;completions&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;create&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
        &lt;span class="n"&gt;model&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;openai/gpt-4.1-mini&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="n"&gt;messages&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;
            &lt;span class="p"&gt;{&lt;/span&gt;
                &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;role&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;user&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
                &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;content&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;prompt&lt;/span&gt;
            &lt;span class="p"&gt;}&lt;/span&gt;
        &lt;span class="p"&gt;],&lt;/span&gt;
        &lt;span class="n"&gt;max_tokens&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="mi"&gt;30&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="n"&gt;temperature&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="mf"&gt;0.0&lt;/span&gt;
    &lt;span class="p"&gt;)&lt;/span&gt;

    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;response&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;choices&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;].&lt;/span&gt;&lt;span class="n"&gt;message&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;content&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;strip&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;


&lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;__name__&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;__main__&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="n"&gt;changes&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;
        &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Added a new user registration endpoint and &lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;
        &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;fixed a typo in the README file.&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;
    &lt;span class="p"&gt;)&lt;/span&gt;

    &lt;span class="n"&gt;commit_message&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;generate_commit&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;changes&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

    &lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;commit_message&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Save and exit:&lt;/p&gt;

&lt;p&gt;Step 5 — Load Environment Variables&lt;/p&gt;

&lt;p&gt;Run:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;source&lt;/span&gt; /root/.bash_profile
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Step 6 — Execute the Script&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;python commit_generator.py
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Step 7 — Verify Output&lt;/p&gt;

&lt;p&gt;Expected format example:&lt;/p&gt;

&lt;p&gt;feat: add user registration endpoint&lt;/p&gt;

&lt;p&gt;Requirements:&lt;/p&gt;

&lt;p&gt;Single line only&lt;br&gt;
Exactly one colon&lt;br&gt;
Conventional Commit format&lt;/p&gt;




&lt;p&gt;Part 2: Simple Beginner-Friendly Explanation&lt;/p&gt;

&lt;p&gt;What This Lab Does&lt;/p&gt;

&lt;p&gt;You are building a small AI-powered Git commit message generator.&lt;/p&gt;

&lt;p&gt;Instead of manually writing commit messages, the AI:&lt;/p&gt;

&lt;p&gt;Reads a summary of code changes&lt;br&gt;
Understands the main purpose&lt;br&gt;
Generates a clean Conventional Commit message&lt;/p&gt;

&lt;p&gt;Why Conventional Commits Matter&lt;br&gt;
Conventional Commits keep Git history organized.&lt;/p&gt;

&lt;p&gt;Examples:&lt;/p&gt;

&lt;p&gt;feat: add login API&lt;br&gt;
fix: resolve crash on startup&lt;br&gt;
docs: update installation guide&lt;/p&gt;

&lt;p&gt;This helps teams:&lt;br&gt;
Read project history easily&lt;br&gt;
Automate changelogs&lt;br&gt;
Understand changes quickly&lt;/p&gt;

&lt;p&gt;What the Code Is Doing&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;Importing Libraries&lt;br&gt;
from openai import OpenAI&lt;br&gt;
This imports the OpenAI SDK so Python can talk to the AI model.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Creating the Client&lt;br&gt;
client = OpenAI(&lt;br&gt;
api_key=os.environ.get("OPENAI_API_KEY"),&lt;br&gt;
base_url=os.environ.get("OPENAI_BASE_URL")&lt;br&gt;
)&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;This connects your script to the AI API using credentials stored in .bash_profile.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Defining the Function
def generate_commit(changes: str) -&amp;gt; str:&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;This function:&lt;br&gt;
Accepts a change summary&lt;br&gt;
Sends it to the AI&lt;br&gt;
Returns a commit message&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Building the Prompt
prompt = f"""
...
"""&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;The prompt tells the AI:&lt;br&gt;
Use only feat, fix, or docs&lt;br&gt;
Follow exact formatting&lt;br&gt;
Keep subject short&lt;br&gt;
Output only the commit message&lt;br&gt;
Good prompts produce reliable outputs.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Sending the API Request
response = client.chat.completions.create(&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;This sends your prompt to the AI model.&lt;br&gt;
Important settings:&lt;br&gt;
temperature=0.0&lt;br&gt;
→ Makes output predictable and strict&lt;br&gt;
max_tokens=30&lt;br&gt;
→ Prevents long responses&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;Extracting the Response&lt;br&gt;
return response.choices[0].message.content.strip()&lt;br&gt;
This gets only the generated commit message text.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Running the Script&lt;br&gt;
print(commit_message)&lt;br&gt;
This prints the final commit message to the terminal.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Example:&lt;br&gt;
feat: add user registration endpoint&lt;/p&gt;




&lt;h5&gt;
  
  
  &lt;strong&gt;Resources &amp;amp; Next Steps&lt;/strong&gt;
&lt;/h5&gt;

&lt;h5&gt;
  
  
  📦 Full Code Repository: &lt;a href="https://github.com/thukhakyawe/100-Days-Of-DevOps-KodeKloud-Challenges-Solutions" rel="noopener noreferrer"&gt;KodeKloud Learning Labs&lt;/a&gt;
&lt;/h5&gt;

&lt;h5&gt;
  
  
  💬 Join Discussion: &lt;a href="https://dev.to/thukhakyawe_cloud"&gt;DEV Community&lt;/a&gt; - Share your thoughts and questions
&lt;/h5&gt;

&lt;h5&gt;
  
  
  💼 Let's Connect: &lt;a href="https://www.linkedin.com/in/thukhakyawe/" rel="noopener noreferrer"&gt;LinkedIn&lt;/a&gt; - I'd love to connect with you
&lt;/h5&gt;




&lt;h5&gt;
  
  
  &lt;strong&gt;Credits&lt;/strong&gt;
&lt;/h5&gt;

&lt;h5&gt;
  
  
  • All labs are from: &lt;a href="https://kodekloud.com/" rel="noopener noreferrer"&gt;KodeKloud&lt;/a&gt;
&lt;/h5&gt;

&lt;h5&gt;
  
  
  • I sincerely appreciate your provision of these valuable resources.
&lt;/h5&gt;




</description>
      <category>ai</category>
      <category>kodekloud</category>
    </item>
    <item>
      <title>Day 9: Create a Custom ML Project Template with Cookiecutter</title>
      <dc:creator>Thu Kha Kyawe</dc:creator>
      <pubDate>Sat, 13 Jun 2026 13:56:31 +0000</pubDate>
      <link>https://dev.to/thukhakyawe_cloud/day-9-create-a-custom-ml-project-template-with-cookiecutter-4n7p</link>
      <guid>https://dev.to/thukhakyawe_cloud/day-9-create-a-custom-ml-project-template-with-cookiecutter-4n7p</guid>
      <description>&lt;h1&gt;
  
  
  Lab Information
&lt;/h1&gt;

&lt;p&gt;The xFusionCorp Industries ML platform team maintains a Cookiecutter template that new ML projects are generated from. A draft template exists at /root/code/mlops-template/, but it does not render. Correct the template and use it to generate a project.&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;A Cookiecutter template exists at /root/code/mlops-template/. cookiecutter is installed system-wide.

The corrected template must satisfy every one of the following:
    The cookiecutter.json declares four variables:
        project_name (default my-ml-project)
        author (default xFusionCorp)
        python_version (default 3.11)
        ml_framework with the choices sklearn, pytorch, and tensorflow
    The generated requirements.txt logic:
        Contains scikit-learn when ml_framework is sklearn
        Contains torch when ml_framework is pytorch
        Contains tensorflow when ml_framework is tensorflow
    The generated README.md content:
        Must reference both the project_name and the author from cookiecutter variables.
    The template directory structure {{cookiecutter.project_name}}/ must contain:
        Files: README.md and requirements.txt
        Directories: data/, models/, src/, and tests/

Review the existing template in the VS Code explorer and correct everything that prevents it from rendering.

Once the template renders, generate a project at /root/code/churn-model/:
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;cookiecutter /root/code/mlops-template/ -o /root/code/ --no-input project_name=churn-model ml_framework=sklearn&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;The generated project must contain a requirements.txt listing scikit-learn and a README.md that mentions xFusionCorp.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;




&lt;h1&gt;
  
  
  Lab Solutions
&lt;/h1&gt;

&lt;p&gt;✅ Part 1: Lab Step-by-Step Guidelines&lt;/p&gt;

&lt;p&gt;This is a Cookiecutter template repair and generation task.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Inspect the existing template
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;cd&lt;/span&gt; /root/code/mlops-template
find &lt;span class="nb"&gt;.&lt;/span&gt; &lt;span class="nt"&gt;-type&lt;/span&gt; f
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Check:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;cat &lt;/span&gt;cookiecutter.json
find &lt;span class="nb"&gt;.&lt;/span&gt; &lt;span class="nt"&gt;-type&lt;/span&gt; d
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;Correct cookiecutter.json&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;It must contain exactly these variables and defaults:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"project_name"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"my-ml-project"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"author"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"xFusionCorp"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"python_version"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"3.11"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"ml_framework"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="s2"&gt;"sklearn"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="s2"&gt;"pytorch"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="s2"&gt;"tensorflow"&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;Ensure template directory name is correct&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Cookiecutter project template directory must be:&lt;/p&gt;

&lt;p&gt;{{cookiecutter.project_name}}/&lt;/p&gt;

&lt;p&gt;Inside it create:&lt;/p&gt;

&lt;p&gt;{{cookiecutter.project_name}}/&lt;br&gt;
├── README.md&lt;br&gt;
├── requirements.txt&lt;br&gt;
├── data/&lt;br&gt;
├── models/&lt;br&gt;
├── src/&lt;br&gt;
└── tests/&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Fix README.md&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;README must reference both variables:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight markdown"&gt;&lt;code&gt;&lt;span class="gh"&gt;# {{ cookiecutter.project_name }}&lt;/span&gt;

Created by {{ cookiecutter.author }}.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;Fix requirements.txt conditional logic&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Use Jinja conditionals:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight jinja"&gt;&lt;code&gt;&lt;span class="cp"&gt;{%&lt;/span&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="nv"&gt;cookiecutter.ml_framework&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="s1"&gt;'sklearn'&lt;/span&gt; &lt;span class="cp"&gt;%}&lt;/span&gt;
scikit-learn
&lt;span class="cp"&gt;{%&lt;/span&gt; &lt;span class="nv"&gt;elif&lt;/span&gt; &lt;span class="nv"&gt;cookiecutter.ml_framework&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="s1"&gt;'pytorch'&lt;/span&gt; &lt;span class="cp"&gt;%}&lt;/span&gt;
torch
&lt;span class="cp"&gt;{%&lt;/span&gt; &lt;span class="nv"&gt;elif&lt;/span&gt; &lt;span class="nv"&gt;cookiecutter.ml_framework&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="s1"&gt;'tensorflow'&lt;/span&gt; &lt;span class="cp"&gt;%}&lt;/span&gt;
tensorflow
&lt;span class="cp"&gt;{%&lt;/span&gt; &lt;span class="k"&gt;endif&lt;/span&gt; &lt;span class="cp"&gt;%}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;Generate the project&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Run exactly:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;cookiecutter /root/code/mlops-template/ &lt;span class="se"&gt;\&lt;/span&gt;
&lt;span class="nt"&gt;-o&lt;/span&gt; /root/code/ &lt;span class="se"&gt;\&lt;/span&gt;
&lt;span class="nt"&gt;--no-input&lt;/span&gt; &lt;span class="se"&gt;\&lt;/span&gt;
&lt;span class="nv"&gt;project_name&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;churn-model &lt;span class="se"&gt;\&lt;/span&gt;
&lt;span class="nv"&gt;ml_framework&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;sklearn
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;Verify output
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;apt update
apt &lt;span class="nb"&gt;install&lt;/span&gt; &lt;span class="nt"&gt;-y&lt;/span&gt; tree
tree /root/code/churn-model
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Check README:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight markdown"&gt;&lt;code&gt;cat /root/code/churn-model/README.md
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Expected Output:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight console"&gt;&lt;code&gt;&lt;span class="go"&gt;root@controlplane ~/code/mlops-template ➜  cat /root/code/churn-model/README.md
&lt;/span&gt;&lt;span class="gp"&gt;#&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;churn-model
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Check requirements:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;cat /root/code/churn-model/requirements.txt
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Expected Output:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight console"&gt;&lt;code&gt;&lt;span class="go"&gt;root@controlplane ~/code/mlops-template ➜  cat /root/code/churn-model/requirements.txt
scikit-learn
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;p&gt;🧠 Part 2: Simple Step-by-Step Explanation (Beginner Friendly)&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;What is broken?
A Cookiecutter template is a project blueprint. Cookiecutter reads:&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;cookiecutter.json&lt;br&gt;
template folders&lt;br&gt;
template files&lt;/p&gt;

&lt;p&gt;and generates a new project.&lt;/p&gt;

&lt;p&gt;If any variable names, folder names, or Jinja syntax are wrong, rendering fails.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Why do we need cookiecutter.json?
This file tells Cookiecutter which values users can provide.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Required values:&lt;/p&gt;

&lt;p&gt;Variable    Default&lt;br&gt;
project_name    my-ml-project&lt;br&gt;
author  xFusionCorp&lt;br&gt;
python_version  3.11&lt;br&gt;
ml_framework    sklearn / pytorch / tensorflow&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Why use {{cookiecutter.project_name}}?
Cookiecutter replaces:&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;{{cookiecutter.project_name}}&lt;/p&gt;

&lt;p&gt;with:&lt;/p&gt;

&lt;p&gt;churn-model&lt;/p&gt;

&lt;p&gt;when generating the project.&lt;/p&gt;

&lt;p&gt;So the generated folder becomes:&lt;/p&gt;

&lt;p&gt;/root/code/churn-model&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Why use Jinja conditions in requirements.txt?&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The lab wants different packages depending on the framework.&lt;/p&gt;

&lt;p&gt;If:&lt;/p&gt;

&lt;p&gt;ml_framework=sklearn&lt;/p&gt;

&lt;p&gt;then output:&lt;/p&gt;

&lt;p&gt;scikit-learn&lt;/p&gt;

&lt;p&gt;If:&lt;/p&gt;

&lt;p&gt;ml_framework=pytorch&lt;/p&gt;

&lt;p&gt;then output:&lt;/p&gt;

&lt;p&gt;torch&lt;/p&gt;

&lt;p&gt;If:&lt;/p&gt;

&lt;p&gt;ml_framework=tensorflow&lt;/p&gt;

&lt;p&gt;then output:&lt;/p&gt;

&lt;p&gt;tensorflow&lt;/p&gt;

&lt;p&gt;Jinja if/elif statements make this happen automatically.&lt;/p&gt;




&lt;h5&gt;
  
  
  &lt;strong&gt;Resources &amp;amp; Next Steps&lt;/strong&gt;
&lt;/h5&gt;

&lt;h5&gt;
  
  
  📦 Full Code Repository: &lt;a href="https://github.com/thukhakyawe/100-Days-Of-MLOps-KodeKloud-Challenges-Solutions" rel="noopener noreferrer"&gt;KodeKloud Learning Labs&lt;/a&gt;
&lt;/h5&gt;

&lt;h5&gt;
  
  
  💬 Join Discussion: &lt;a href="https://dev.to/thukhakyawe_cloud"&gt;DEV Community&lt;/a&gt; - Share your thoughts and questions
&lt;/h5&gt;

&lt;h5&gt;
  
  
  💼 Let's Connect: &lt;a href="https://www.linkedin.com/in/thukhakyawe/" rel="noopener noreferrer"&gt;LinkedIn&lt;/a&gt; - I'd love to connect with you
&lt;/h5&gt;




&lt;h5&gt;
  
  
  &lt;strong&gt;Credits&lt;/strong&gt;
&lt;/h5&gt;

&lt;h5&gt;
  
  
  • All labs are from: &lt;a href="https://kodekloud.com/" rel="noopener noreferrer"&gt;KodeKloud&lt;/a&gt;
&lt;/h5&gt;

&lt;h5&gt;
  
  
  • I sincerely appreciate your provision of these valuable resources.
&lt;/h5&gt;




</description>
      <category>100daysofmlops</category>
      <category>kodekloud</category>
    </item>
    <item>
      <title>🚀 Exciting opportunity for anyone looking to build a strong foundation in AI and Cloud!</title>
      <dc:creator>Thu Kha Kyawe</dc:creator>
      <pubDate>Fri, 12 Jun 2026 11:09:56 +0000</pubDate>
      <link>https://dev.to/thukhakyawe_cloud/exciting-opportunity-for-anyone-looking-to-build-a-strong-foundation-in-ai-and-cloud-5e4i</link>
      <guid>https://dev.to/thukhakyawe_cloud/exciting-opportunity-for-anyone-looking-to-build-a-strong-foundation-in-ai-and-cloud-5e4i</guid>
      <description>&lt;p&gt;AWS and Pearson VUE have launched a special offer that makes it easier than ever to start your certification journey:&lt;/p&gt;

&lt;p&gt;✅ Get 50% off the AWS Certified AI Practitioner (AIF-C01) exam using the promo code AIF2CLOUD&lt;/p&gt;

&lt;p&gt;✅ Pass the AI Practitioner exam and receive a FREE voucher for the AWS Certified Cloud Practitioner exam&lt;/p&gt;

&lt;p&gt;This initiative is designed for both technical and non-technical professionals who want to understand AI, Generative AI, machine learning concepts, and cloud fundamentals without requiring prior coding or engineering experience.&lt;/p&gt;

&lt;p&gt;As AI continues to transform every industry, combining AI literacy with cloud knowledge is becoming an increasingly valuable skill set. This is a great opportunity to validate your knowledge while accelerating your learning path in the AWS ecosystem.&lt;/p&gt;

&lt;p&gt;Here is official link: &lt;a href="https://www.pearsonvue.com/us/en/aws/aif2cloud.html" rel="noopener noreferrer"&gt;https://www.pearsonvue.com/us/en/aws/aif2cloud.html&lt;/a&gt;&lt;/p&gt;

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

</description>
      <category>certifications</category>
      <category>aws</category>
    </item>
    <item>
      <title>Day 8: Configure Pre-Commit Hooks for ML Repository</title>
      <dc:creator>Thu Kha Kyawe</dc:creator>
      <pubDate>Thu, 11 Jun 2026 11:12:47 +0000</pubDate>
      <link>https://dev.to/thukhakyawe_cloud/day-8-configure-pre-commit-hooks-for-ml-repository-5bd1</link>
      <guid>https://dev.to/thukhakyawe_cloud/day-8-configure-pre-commit-hooks-for-ml-repository-5bd1</guid>
      <description>&lt;h1&gt;
  
  
  Lab Information
&lt;/h1&gt;

&lt;p&gt;The xFusionCorp Industries ML team enforces code quality on every commit via pre-commit. A draft .pre-commit-config.yaml exists in the git repository at /root/code/fraud-detection/, but it does not match the team's standard and pre-commit run --all-files fails against it. Correct the configuration.&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;A git repository already exists at /root/code/fraud-detection/ with .pre-commit-config.yaml and process.py already tracked. pre-commit is installed system-wide.

The corrected configuration must declare the following five hooks so that pre-commit run --all-files executes every one of them:
    trailing-whitespace, end-of-file-fixer, and check-yaml – All three sourced from the pre-commit/pre-commit-hooks repository, pinned to a current release;
    ruff – Sourced from the astral-sh/ruff-pre-commit repository, pinned to a current release;
    black – Sourced from the psf/black-pre-commit-mirror repository, pinned to a current release.

Every repository entry in the configuration must include a rev: field.

Review the existing .pre-commit-config.yaml and correct everything that prevents the hooks above from running.

Once the configuration is correct, register the hooks with git and run them against the tracked files:
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;pre-commit install&lt;br&gt;
   pre-commit run --all-files&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Tip: pre-commit autoupdate queries each referenced repository and rewrites the rev: pins to the latest released tag. This is the standard way to discover current versions without looking them up by hand.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;h1&gt;
  
  
  Lab Solutions
&lt;/h1&gt;

&lt;p&gt;🧭 Part 1: Lab Step-by-Step Guidelines&lt;/p&gt;

&lt;p&gt;Step 1 — Move into the Repository&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;cd&lt;/span&gt; /root/code/fraud-detection
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Step 2 — Inspect the Current Configuration&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;cat&lt;/span&gt; .pre-commit-config.yaml
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Look for:&lt;/p&gt;

&lt;p&gt;missing hooks&lt;br&gt;
missing rev: fields&lt;br&gt;
incorrect repository URLs&lt;br&gt;
outdated configuration structure&lt;br&gt;
Step 3 — Create a Valid Configuration&lt;/p&gt;

&lt;p&gt;Edit the file:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;vi .pre-commit-config.yaml
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Use a configuration like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight yaml"&gt;&lt;code&gt;&lt;span class="na"&gt;repos&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
  &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;repo&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;https://github.com/pre-commit/pre-commit-hooks&lt;/span&gt;
    &lt;span class="na"&gt;rev&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;v0.0.0&lt;/span&gt;
    &lt;span class="na"&gt;hooks&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
      &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;id&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;trailing-whitespace&lt;/span&gt;
      &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;id&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;end-of-file-fixer&lt;/span&gt;
      &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;id&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;check-yaml&lt;/span&gt;

  &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;repo&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;https://github.com/astral-sh/ruff-pre-commit&lt;/span&gt;
    &lt;span class="na"&gt;rev&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;v0.0.0&lt;/span&gt;
    &lt;span class="na"&gt;hooks&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
      &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;id&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;ruff&lt;/span&gt;

  &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;repo&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;https://github.com/psf/black-pre-commit-mirror&lt;/span&gt;
    &lt;span class="na"&gt;rev&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;v0.0.0&lt;/span&gt;
    &lt;span class="na"&gt;hooks&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
      &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;id&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;black&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Step 4 — Update to Current Releases&lt;/p&gt;

&lt;p&gt;Run:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;pre-commit autoupdate
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Example Output:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight console"&gt;&lt;code&gt;&lt;span class="go"&gt;root@controlplane fraud-detection on  main via 🐍 v3.12.3 ➜  pre-commit autoupdate
&lt;/span&gt;&lt;span class="gp"&gt;[https://github.com/pre-commit/pre-commit-hooks] updating v0.0.0 -&amp;gt;&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;v6.0.0
&lt;span class="gp"&gt;[https://github.com/astral-sh/ruff-pre-commit] updating v0.0.0 -&amp;gt;&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;v0.15.16
&lt;span class="gp"&gt;[https://github.com/psf/black-pre-commit-mirror] updating v0.0.0 -&amp;gt;&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;26.5.1
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This automatically:&lt;/p&gt;

&lt;p&gt;discovers current released tags&lt;br&gt;
updates all rev: values&lt;br&gt;
satisfies the lab requirement that repositories are pinned to current releases&lt;/p&gt;

&lt;p&gt;Verify:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;cat&lt;/span&gt; .pre-commit-config.yaml
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You should now see real version tags instead of placeholders.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight yaml"&gt;&lt;code&gt;&lt;span class="s"&gt;root@controlplane fraud-detection on  main [!] via 🐍 v3.12.3 ➜  cat .pre-commit-config.yaml&lt;/span&gt;
&lt;span class="na"&gt;repos&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
  &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;repo&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;https://github.com/pre-commit/pre-commit-hooks&lt;/span&gt;
    &lt;span class="na"&gt;rev&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;v6.0.0&lt;/span&gt;
    &lt;span class="na"&gt;hooks&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
      &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;id&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;trailing-whitespace&lt;/span&gt;
      &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;id&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;end-of-file-fixer&lt;/span&gt;
      &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;id&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;check-yaml&lt;/span&gt;

  &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;repo&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;https://github.com/astral-sh/ruff-pre-commit&lt;/span&gt;
    &lt;span class="na"&gt;rev&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;v0.15.16&lt;/span&gt;
    &lt;span class="na"&gt;hooks&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
      &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;id&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;ruff&lt;/span&gt;

  &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;repo&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;https://github.com/psf/black-pre-commit-mirror&lt;/span&gt;
    &lt;span class="na"&gt;rev&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;26.5.1&lt;/span&gt;
    &lt;span class="na"&gt;hooks&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
      &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;id&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;black&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Step 5 — Install the Hooks&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;pre-commit &lt;span class="nb"&gt;install&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Expected output:&lt;/p&gt;

&lt;p&gt;pre-commit installed at .git/hooks/pre-commit&lt;/p&gt;

&lt;p&gt;Step 6 — Run All Hooks&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;pre-commit run &lt;span class="nt"&gt;--all-files&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Expected output:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight console"&gt;&lt;code&gt;&lt;span class="go"&gt;root@controlplane fraud-detection on  main [!] via 🐍 v3.12.3 ➜  pre-commit run --all-files
[INFO] Initializing environment for https://github.com/pre-commit/pre-commit-hooks.
[INFO] Initializing environment for https://github.com/astral-sh/ruff-pre-commit.
[INFO] Initializing environment for https://github.com/psf/black-pre-commit-mirror.
[INFO] Installing environment for https://github.com/pre-commit/pre-commit-hooks.
[INFO] Once installed this environment will be reused.
[INFO] This may take a few minutes...
[INFO] Installing environment for https://github.com/astral-sh/ruff-pre-commit.
[INFO] Once installed this environment will be reused.
[INFO] This may take a few minutes...
[INFO] Installing environment for https://github.com/psf/black-pre-commit-mirror.
[INFO] Once installed this environment will be reused.
[INFO] This may take a few minutes...
trim trailing whitespace.................................................Failed
- hook id: trailing-whitespace
- exit code: 1
- files were modified by this hook

Fixing process.py

fix end of files.........................................................Failed
- hook id: end-of-file-fixer
- exit code: 1
- files were modified by this hook

Fixing .pre-commit-config.yaml

check yaml...............................................................Passed
ruff (legacy alias)......................................................Passed
black....................................................................Passed
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;p&gt;🧠 Part 2: Simple Beginner-Friendly Explanation&lt;/p&gt;

&lt;p&gt;What is Pre-Commit?&lt;br&gt;
Pre-commit is a tool that automatically checks code before it is committed to Git.&lt;/p&gt;

&lt;p&gt;It helps catch:&lt;br&gt;
formatting problems&lt;br&gt;
linting issues&lt;br&gt;
whitespace errors&lt;br&gt;
configuration mistakes&lt;/p&gt;

&lt;p&gt;before code reaches the repository.&lt;/p&gt;

&lt;p&gt;What is .pre-commit-config.yaml?&lt;br&gt;
This file tells pre-commit:&lt;/p&gt;

&lt;p&gt;which checks to run&lt;br&gt;
where the hooks come from&lt;br&gt;
which versions to use&lt;/p&gt;

&lt;p&gt;Each hook is downloaded from a Git repository.&lt;/p&gt;

&lt;p&gt;Why rev: Is Required&lt;br&gt;
Example:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;repo: &lt;a href="https://github.com/pre-commit/pre-commit-hooks" rel="noopener noreferrer"&gt;https://github.com/pre-commit/pre-commit-hooks&lt;/a&gt;
rev: v6.0.0&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The rev: field pins the hook to a specific release.&lt;/p&gt;

&lt;p&gt;Benefits:&lt;br&gt;
reproducible behavior&lt;br&gt;
same version for every developer&lt;br&gt;
prevents unexpected changes&lt;/p&gt;

&lt;p&gt;The lab requires every repository entry to have a rev: field.&lt;/p&gt;

&lt;p&gt;Understanding the Required Hooks&lt;br&gt;
trailing-whitespace&lt;br&gt;
Removes spaces at the ends of lines.&lt;br&gt;
Bad:&lt;br&gt;
hello···&lt;/p&gt;

&lt;p&gt;Good:&lt;br&gt;
hello&lt;/p&gt;

&lt;p&gt;end-of-file-fixer&lt;br&gt;
Ensures files end with a single newline.&lt;br&gt;
Many tools expect this format.&lt;/p&gt;

&lt;p&gt;check-yaml&lt;br&gt;
Validates YAML syntax.&lt;br&gt;
Useful for files such as:&lt;br&gt;
.pre-commit-config.yaml&lt;br&gt;
docker-compose.yml&lt;/p&gt;

&lt;p&gt;ruff&lt;br&gt;
Runs Ruff linting checks on Python code.&lt;br&gt;
Detects:&lt;br&gt;
unused imports&lt;br&gt;
syntax issues&lt;br&gt;
import ordering problems&lt;/p&gt;

&lt;p&gt;black&lt;br&gt;
Formats Python code automatically.&lt;br&gt;
Ensures all developers use the same code style.&lt;/p&gt;

&lt;p&gt;What pre-commit autoupdate Does&lt;br&gt;
Command:&lt;br&gt;
pre-commit autoupdate&lt;br&gt;
automatically updates:&lt;br&gt;
rev:&lt;br&gt;
to the latest released versions.&lt;br&gt;
This is the recommended way to obtain current release tags.&lt;/p&gt;

&lt;p&gt;Why You May Need to Run Hooks Twice&lt;br&gt;
Some hooks automatically fix files.&lt;br&gt;
Example:&lt;br&gt;
Black reformats Python code&lt;br&gt;
trailing-whitespace removes extra spaces&lt;/p&gt;

&lt;p&gt;The first run modifies files.&lt;br&gt;
The second run verifies everything is clean.&lt;/p&gt;




&lt;h5&gt;
  
  
  &lt;strong&gt;Resources &amp;amp; Next Steps&lt;/strong&gt;
&lt;/h5&gt;

&lt;h5&gt;
  
  
  📦 Full Code Repository: &lt;a href="https://github.com/thukhakyawe/100-Days-Of-MLOps-KodeKloud-Challenges-Solutions" rel="noopener noreferrer"&gt;KodeKloud Learning Labs&lt;/a&gt;
&lt;/h5&gt;

&lt;h5&gt;
  
  
  💬 Join Discussion: &lt;a href="https://dev.to/thukhakyawe_cloud"&gt;DEV Community&lt;/a&gt; - Share your thoughts and questions
&lt;/h5&gt;

&lt;h5&gt;
  
  
  💼 Let's Connect: &lt;a href="https://www.linkedin.com/in/thukhakyawe/" rel="noopener noreferrer"&gt;LinkedIn&lt;/a&gt; - I'd love to connect with you
&lt;/h5&gt;




&lt;h5&gt;
  
  
  &lt;strong&gt;Credits&lt;/strong&gt;
&lt;/h5&gt;

&lt;h5&gt;
  
  
  • All labs are from: &lt;a href="https://kodekloud.com/" rel="noopener noreferrer"&gt;KodeKloud&lt;/a&gt;
&lt;/h5&gt;

&lt;h5&gt;
  
  
  • I sincerely appreciate your provision of these valuable resources.
&lt;/h5&gt;




</description>
      <category>100daysofmlops</category>
      <category>kodekloud</category>
    </item>
    <item>
      <title>Day 7: Package an ML Project as Installable Python Package</title>
      <dc:creator>Thu Kha Kyawe</dc:creator>
      <pubDate>Wed, 10 Jun 2026 14:55:56 +0000</pubDate>
      <link>https://dev.to/thukhakyawe_cloud/day-7-package-an-ml-project-as-installable-python-package-2432</link>
      <guid>https://dev.to/thukhakyawe_cloud/day-7-package-an-ml-project-as-installable-python-package-2432</guid>
      <description>&lt;h1&gt;
  
  
  Lab Information
&lt;/h1&gt;

&lt;p&gt;The xFusionCorp Industries deployment team needs the fraud-detection model code packaged as an installable Python distribution. A draft pyproject.toml exists at /root/code/fraud-detection/, but it does not build a wheel that meets the team's standard. Correct the file and produce a compliant package.&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;The project at /root/code/fraud-detection/ already contains the source code under src/fraud_detection/. The Python files are complete—you do not need to modify any of them.

The corrected pyproject.toml must satisfy every one of the following:
    it declares a [build-system] section with requires = ["setuptools&amp;gt;=61.0", "wheel"] and build-backend = "setuptools.build_meta";
    name is fraud_detection (the distribution name must match the module path under src/);
    version is 0.1.0;
    requires-python is &amp;gt;=3.10;
    dependencies is ["scikit-learn", "pandas", "numpy"].

Review the existing pyproject.toml and correct everything that does not match the requirements above.

Build the package from the project directory:
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;cd /root/code/fraud-detection&lt;br&gt;
   python3 -m build&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;The build must produce a wheel named fraud_detection-0.1.0-*.whl under dist/.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;p&gt;The build package is already installed. Use python3 rather than python.&lt;/p&gt;


&lt;h1&gt;
  
  
  Lab Solutions
&lt;/h1&gt;

&lt;p&gt;🧭 Part 1: Lab Step-by-Step Guidelines&lt;/p&gt;

&lt;p&gt;Step 1 — Move into the project directory&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;cd&lt;/span&gt; /root/code/fraud-detection
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Step 2 — Inspect the existing pyproject.toml&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;cat &lt;/span&gt;pyproject.toml
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Look for:&lt;/p&gt;

&lt;p&gt;missing [build-system]&lt;br&gt;
incorrect package name&lt;br&gt;
wrong version&lt;br&gt;
missing dependencies&lt;br&gt;
incorrect Python version requirement&lt;/p&gt;

&lt;p&gt;Step 3 — Fix pyproject.toml&lt;/p&gt;

&lt;p&gt;Open the file:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;vi pyproject.toml
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Replace the contents with:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight toml"&gt;&lt;code&gt;&lt;span class="nn"&gt;[build-system]&lt;/span&gt;
&lt;span class="py"&gt;requires&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="py"&gt;["setuptools&amp;gt;&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="mf"&gt;61.0&lt;/span&gt;&lt;span class="s"&gt;", "&lt;/span&gt;&lt;span class="err"&gt;wheel&lt;/span&gt;&lt;span class="s"&gt;"]&lt;/span&gt;&lt;span class="err"&gt;
&lt;/span&gt;&lt;span class="py"&gt;build-backend&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s"&gt;"setuptools.build_meta"&lt;/span&gt;

&lt;span class="nn"&gt;[project]&lt;/span&gt;
&lt;span class="py"&gt;name&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s"&gt;"fraud_detection"&lt;/span&gt;
&lt;span class="py"&gt;version&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s"&gt;"0.1.0"&lt;/span&gt;
&lt;span class="py"&gt;requires-python&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="py"&gt;"&amp;gt;&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="mf"&gt;3.10&lt;/span&gt;&lt;span class="s"&gt;"&lt;/span&gt;&lt;span class="err"&gt;
&lt;/span&gt;&lt;span class="py"&gt;dependencies&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;
    &lt;span class="s"&gt;"scikit-learn"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="s"&gt;"pandas"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="s"&gt;"numpy"&lt;/span&gt;
&lt;span class="p"&gt;]&lt;/span&gt;

&lt;span class="nn"&gt;[tool.setuptools.packages.find]&lt;/span&gt;
&lt;span class="py"&gt;where&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s"&gt;"src"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Step 4 — Build the Package&lt;/p&gt;

&lt;p&gt;Run exactly:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;python3 &lt;span class="nt"&gt;-m&lt;/span&gt; build
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Expected output:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight console"&gt;&lt;code&gt;&lt;span class="go"&gt;root@controlplane ~/code/fraud-detection via 🐍 v3.12.3 ✖ python3 -m build
* Creating isolated environment: venv+pip...
* Installing packages in isolated environment:
&lt;/span&gt;&lt;span class="gp"&gt;  - setuptools&amp;gt;&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;61.0
&lt;span class="go"&gt;  - wheel
* Getting build dependencies for sdist...
running egg_info
creating src/fraud_detection.egg-info
writing src/fraud_detection.egg-info/PKG-INFO
writing dependency_links to src/fraud_detection.egg-info/dependency_links.txt
writing requirements to src/fraud_detection.egg-info/requires.txt
writing top-level names to src/fraud_detection.egg-info/top_level.txt
writing manifest file 'src/fraud_detection.egg-info/SOURCES.txt'
reading manifest file 'src/fraud_detection.egg-info/SOURCES.txt'
writing manifest file 'src/fraud_detection.egg-info/SOURCES.txt'
* Building sdist...
running sdist
running egg_info
writing src/fraud_detection.egg-info/PKG-INFO
writing dependency_links to src/fraud_detection.egg-info/dependency_links.txt
writing requirements to src/fraud_detection.egg-info/requires.txt
writing top-level names to src/fraud_detection.egg-info/top_level.txt
reading manifest file 'src/fraud_detection.egg-info/SOURCES.txt'
writing manifest file 'src/fraud_detection.egg-info/SOURCES.txt'
warning: sdist: standard file not found: should have one of README, README.rst, README.txt, README.md

running check
creating fraud_detection-0.1.0
creating fraud_detection-0.1.0/src/fraud_detection
creating fraud_detection-0.1.0/src/fraud_detection.egg-info
copying files to fraud_detection-0.1.0...
&lt;/span&gt;&lt;span class="gp"&gt;copying pyproject.toml -&amp;gt;&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;fraud_detection-0.1.0
&lt;span class="gp"&gt;copying src/fraud_detection/__init__.py -&amp;gt;&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;fraud_detection-0.1.0/src/fraud_detection
&lt;span class="gp"&gt;copying src/fraud_detection/predict.py -&amp;gt;&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;fraud_detection-0.1.0/src/fraud_detection
&lt;span class="gp"&gt;copying src/fraud_detection.egg-info/PKG-INFO -&amp;gt;&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;fraud_detection-0.1.0/src/fraud_detection.egg-info
&lt;span class="gp"&gt;copying src/fraud_detection.egg-info/SOURCES.txt -&amp;gt;&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;fraud_detection-0.1.0/src/fraud_detection.egg-info
&lt;span class="gp"&gt;copying src/fraud_detection.egg-info/dependency_links.txt -&amp;gt;&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;fraud_detection-0.1.0/src/fraud_detection.egg-info
&lt;span class="gp"&gt;copying src/fraud_detection.egg-info/requires.txt -&amp;gt;&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;fraud_detection-0.1.0/src/fraud_detection.egg-info
&lt;span class="gp"&gt;copying src/fraud_detection.egg-info/top_level.txt -&amp;gt;&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;fraud_detection-0.1.0/src/fraud_detection.egg-info
&lt;span class="gp"&gt;copying src/fraud_detection.egg-info/SOURCES.txt -&amp;gt;&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;fraud_detection-0.1.0/src/fraud_detection.egg-info
&lt;span class="go"&gt;Writing fraud_detection-0.1.0/setup.cfg
Creating tar archive
removing 'fraud_detection-0.1.0' (and everything under it)
* Building wheel from sdist
* Creating isolated environment: venv+pip...
* Installing packages in isolated environment:
&lt;/span&gt;&lt;span class="gp"&gt;  - setuptools&amp;gt;&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;61.0
&lt;span class="go"&gt;  - wheel
* Getting build dependencies for wheel...
running egg_info
writing src/fraud_detection.egg-info/PKG-INFO
writing dependency_links to src/fraud_detection.egg-info/dependency_links.txt
writing requirements to src/fraud_detection.egg-info/requires.txt
writing top-level names to src/fraud_detection.egg-info/top_level.txt
reading manifest file 'src/fraud_detection.egg-info/SOURCES.txt'
writing manifest file 'src/fraud_detection.egg-info/SOURCES.txt'
* Building wheel...
running bdist_wheel
running build
running build_py
creating build/lib/fraud_detection
&lt;/span&gt;&lt;span class="gp"&gt;copying src/fraud_detection/predict.py -&amp;gt;&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;build/lib/fraud_detection
&lt;span class="gp"&gt;copying src/fraud_detection/__init__.py -&amp;gt;&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;build/lib/fraud_detection
&lt;span class="go"&gt;running egg_info
writing src/fraud_detection.egg-info/PKG-INFO
writing dependency_links to src/fraud_detection.egg-info/dependency_links.txt
writing requirements to src/fraud_detection.egg-info/requires.txt
writing top-level names to src/fraud_detection.egg-info/top_level.txt
reading manifest file 'src/fraud_detection.egg-info/SOURCES.txt'
writing manifest file 'src/fraud_detection.egg-info/SOURCES.txt'
installing to build/bdist.linux-x86_64/wheel
running install
running install_lib
creating build/bdist.linux-x86_64/wheel
creating build/bdist.linux-x86_64/wheel/fraud_detection
&lt;/span&gt;&lt;span class="gp"&gt;copying build/lib/fraud_detection/predict.py -&amp;gt;&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;build/bdist.linux-x86_64/wheel/./fraud_detection
&lt;span class="gp"&gt;copying build/lib/fraud_detection/__init__.py -&amp;gt;&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;build/bdist.linux-x86_64/wheel/./fraud_detection
&lt;span class="go"&gt;running install_egg_info
Copying src/fraud_detection.egg-info to build/bdist.linux-x86_64/wheel/./fraud_detection-0.1.0-py3.12.egg-info
running install_scripts
creating build/bdist.linux-x86_64/wheel/fraud_detection-0.1.0.dist-info/WHEEL
creating '/root/code/fraud-detection/dist/.tmp-k44hfcde/fraud_detection-0.1.0-py3-none-any.whl' and adding 'build/bdist.linux-x86_64/wheel' to it
adding 'fraud_detection/__init__.py'
adding 'fraud_detection/predict.py'
adding 'fraud_detection-0.1.0.dist-info/METADATA'
adding 'fraud_detection-0.1.0.dist-info/WHEEL'
adding 'fraud_detection-0.1.0.dist-info/top_level.txt'
adding 'fraud_detection-0.1.0.dist-info/RECORD'
removing build/bdist.linux-x86_64/wheel
Successfully built fraud_detection-0.1.0.tar.gz and fraud_detection-0.1.0-py3-none-any.whl
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Step 5 — Verify the Wheel File&lt;/p&gt;

&lt;p&gt;Check the dist/ directory:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;ls &lt;/span&gt;dist/
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Expected wheel name pattern:&lt;/p&gt;

&lt;p&gt;Example:&lt;/p&gt;

&lt;p&gt;fraud_detection-0.1.0-py3-none-any.whl  fraud_detection-0.1.0.tar.gz&lt;/p&gt;




&lt;p&gt;🧠 Part 2: Simple Beginner-Friendly Explanation&lt;/p&gt;

&lt;p&gt;What is this lab about?&lt;/p&gt;

&lt;p&gt;This lab focuses on packaging a Python project into an installable distribution.&lt;/p&gt;

&lt;p&gt;The goal is to:&lt;/p&gt;

&lt;p&gt;configure the project correctly&lt;br&gt;
build a Python wheel package&lt;br&gt;
make the ML code installable on other systems&lt;/p&gt;

&lt;p&gt;What is pyproject.toml?&lt;br&gt;
pyproject.toml is the modern Python project configuration file.&lt;/p&gt;

&lt;p&gt;It defines:&lt;br&gt;
project metadata&lt;br&gt;
dependencies&lt;br&gt;
build system configuration&lt;br&gt;
packaging settings&lt;/p&gt;

&lt;p&gt;It replaces older files like:&lt;br&gt;
setup.py&lt;br&gt;
setup.cfg&lt;/p&gt;

&lt;p&gt;in many modern Python projects.&lt;br&gt;
Understanding the [build-system] Section&lt;/p&gt;

&lt;p&gt;The lab requires:&lt;/p&gt;

&lt;p&gt;[build-system]&lt;br&gt;
requires = ["setuptools&amp;gt;=61.0", "wheel"]&lt;br&gt;
build-backend = "setuptools.build_meta"&lt;/p&gt;

&lt;p&gt;This tells Python:&lt;br&gt;
which tools are needed to build the package&lt;br&gt;
which backend performs the build&lt;/p&gt;

&lt;p&gt;Why setuptools and wheel Are Required&lt;br&gt;
Package Purpose&lt;br&gt;
setuptools  Builds Python packages&lt;br&gt;
wheel   Creates .whl files&lt;/p&gt;

&lt;p&gt;Without these:&lt;br&gt;
package building may fail&lt;/p&gt;

&lt;p&gt;Why the Package Name Matters&lt;br&gt;
The lab requires:&lt;br&gt;
name = "fraud_detection"&lt;br&gt;
This must match the module directory:&lt;br&gt;
src/fraud_detection/&lt;br&gt;
Using a different name can break:&lt;/p&gt;

&lt;p&gt;imports&lt;br&gt;
packaging&lt;br&gt;
installation&lt;/p&gt;

&lt;p&gt;What requires-python Means&lt;br&gt;
Required setting:&lt;br&gt;
requires-python = "&amp;gt;=3.10"&lt;br&gt;
This means:&lt;br&gt;
the package only supports Python 3.10 or newer.&lt;/p&gt;

&lt;p&gt;Why Dependencies Are Declared&lt;br&gt;
Required dependencies:&lt;/p&gt;

&lt;p&gt;dependencies = [&lt;br&gt;
    "scikit-learn",&lt;br&gt;
    "pandas",&lt;br&gt;
    "numpy"&lt;br&gt;
]&lt;/p&gt;

&lt;p&gt;When someone installs the package:&lt;br&gt;
these libraries install automatically&lt;/p&gt;

&lt;p&gt;What python3 -m build Does&lt;/p&gt;

&lt;p&gt;Command:&lt;br&gt;
python3 -m build&lt;br&gt;
performs the packaging process.&lt;/p&gt;

&lt;p&gt;It creates:&lt;/p&gt;

&lt;p&gt;source distribution (.tar.gz)&lt;br&gt;
wheel distribution (.whl)&lt;/p&gt;

&lt;p&gt;inside:&lt;/p&gt;

&lt;p&gt;dist/&lt;/p&gt;

&lt;p&gt;What Is a Wheel File?&lt;br&gt;
A wheel (.whl) is a standard Python package format.&lt;/p&gt;

&lt;p&gt;Example:&lt;br&gt;
fraud_detection-0.1.0-py3-none-any.whl&lt;/p&gt;

&lt;p&gt;It allows fast installation using:&lt;br&gt;
pip install package.whl&lt;/p&gt;

&lt;p&gt;Why python3 Must Be Used&lt;br&gt;
The lab explicitly requires:&lt;/p&gt;

&lt;p&gt;python3 -m build&lt;/p&gt;

&lt;p&gt;instead of:&lt;/p&gt;

&lt;p&gt;python -m build&lt;/p&gt;

&lt;p&gt;This guarantees the correct Python interpreter is used.&lt;/p&gt;




&lt;h5&gt;
  
  
  &lt;strong&gt;Resources &amp;amp; Next Steps&lt;/strong&gt;
&lt;/h5&gt;

&lt;h5&gt;
  
  
  📦 Full Code Repository: &lt;a href="https://github.com/thukhakyawe/100-Days-Of-MLOps-KodeKloud-Challenges-Solutions" rel="noopener noreferrer"&gt;KodeKloud Learning Labs&lt;/a&gt;
&lt;/h5&gt;

&lt;h5&gt;
  
  
  💬 Join Discussion: &lt;a href="https://dev.to/thukhakyawe_cloud"&gt;DEV Community&lt;/a&gt; - Share your thoughts and questions
&lt;/h5&gt;

&lt;h5&gt;
  
  
  💼 Let's Connect: &lt;a href="https://www.linkedin.com/in/thukhakyawe/" rel="noopener noreferrer"&gt;LinkedIn&lt;/a&gt; - I'd love to connect with you
&lt;/h5&gt;




&lt;h5&gt;
  
  
  &lt;strong&gt;Credits&lt;/strong&gt;
&lt;/h5&gt;

&lt;h5&gt;
  
  
  • All labs are from: &lt;a href="https://kodekloud.com/" rel="noopener noreferrer"&gt;KodeKloud&lt;/a&gt;
&lt;/h5&gt;

&lt;h5&gt;
  
  
  • I sincerely appreciate your provision of these valuable resources.
&lt;/h5&gt;




</description>
      <category>100daysofmlops</category>
      <category>kodekloud</category>
    </item>
  </channel>
</rss>
