<?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: Bal Dev</title>
    <description>The latest articles on DEV Community by Bal Dev (@balddev007).</description>
    <link>https://dev.to/balddev007</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.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F1312359%2Fb10a35b1-4485-41c2-9887-49103b613e2c.png</url>
      <title>DEV Community: Bal Dev</title>
      <link>https://dev.to/balddev007</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/balddev007"/>
    <language>en</language>
    <item>
      <title>How to Setup a Private Chat GPT: A Comprehensive Guide for the Utterly Clueless</title>
      <dc:creator>Bal Dev</dc:creator>
      <pubDate>Sat, 16 Mar 2024 19:46:03 +0000</pubDate>
      <link>https://dev.to/balddev007/how-to-setup-a-private-chat-gpt-a-comprehensive-guide-for-the-utterly-clueless-52af</link>
      <guid>https://dev.to/balddev007/how-to-setup-a-private-chat-gpt-a-comprehensive-guide-for-the-utterly-clueless-52af</guid>
      <description>&lt;p&gt;Alright, dear utterly clueless audience, gather around. It’s time to dive into the mystical world of setting up a private chat GPT with Llama 2. If you’re an expert or even moderately savvy in tech, shoo! This isn’t for you. Go compile a kernel or something.&lt;/p&gt;

&lt;p&gt;Welcome to Chat GPT with Llama 2: A Noob’s Tale&lt;/p&gt;

&lt;p&gt;Once upon a time in the land of “I-Don’t-Know-What-I’m-Doing,” there were brave souls who decided to embark on a quest to set up their own chat GPT with Llama 2. It was said to be a task only for the valiant, but fear not, for I shall guide thee through this enchanted forest of technology. Once you get enough confidence, you can further enhance, train &amp;amp; use it locally on your data with minimal hardware in a windows laptop.&lt;/p&gt;

&lt;p&gt;Step 1: The hardware - I am using my normal work laptop with 24GB ram and an old nvidia graphics card with 4 GB DRAM.&lt;/p&gt;

&lt;p&gt;Step 2: I am going to install CUDA in my system. Note down your version. I am using 12.2&lt;/p&gt;

&lt;p&gt;Step 3: I am going to use prebuilt llama.cpp from ggerganov in github to avoid any complexity of environment setup. I will need lama-b2440-bin-win-cublas-cu12.2.0-x64.zip &amp;amp; cudart-llama-bin-win-cu12.2.0-x64.zip. Download &amp;amp; extract them in the same folder.&lt;/p&gt;

&lt;p&gt;Step 4: Finding the Llama. Look for llama-2-7b-chat.Q5_K_M.gguf in Hugging face &amp;amp; download it into the same directory as above&lt;/p&gt;

&lt;p&gt;Step 5: Awakening the Llama. Run below command if have reached upto here successfully. If all goes well, you’ll have a chatbot ready to converse with you about the mysteries of the universe or, more likely, the weather.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;main -m llama-2-7b-chat.Q5_K_M.gguf -i --n-gpu-layers 32 -ins --color -p "Starting your language model"&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Step 6: Chatting with the Llama Congratulations! &lt;/p&gt;

&lt;p&gt;You’ve successfully set up your chat GPT with Llama 2. Now you can chat about life’s greatest questions, like “Why are we here?” or “What’s for dinner?” Just remember, the Llama is wise, but it’s not a chef.&lt;/p&gt;

&lt;p&gt;And there you have it, a simple guide for the utterly clueless. May your chats be merry, and your Llama never spit.&lt;/p&gt;

</description>
      <category>chatgpt</category>
      <category>llama2</category>
      <category>ai</category>
    </item>
    <item>
      <title>Docker-Compose Chronicles: Conquering the Volume Conundrum</title>
      <dc:creator>Bal Dev</dc:creator>
      <pubDate>Wed, 28 Feb 2024 21:14:45 +0000</pubDate>
      <link>https://dev.to/balddev007/docker-compose-chronicles-conquering-the-volume-conundrum-341m</link>
      <guid>https://dev.to/balddev007/docker-compose-chronicles-conquering-the-volume-conundrum-341m</guid>
      <description>&lt;p&gt;In the intricate landscape of container orchestration, there exists a formidable realm known as Docker-Compose, where brave souls venture to weave together the intricate threads of microservices. Among the myriad challenges faced by these intrepid adventurers, none is more notorious than the enigma of volumes. Let’s embark on a short technical journey to the treacherous waters of Docker-Compose volumes, armed with a fervent desire for mastery.volumes:&lt;/p&gt;

&lt;p&gt;Volumes in Docker Compose enable data persistence by mounting host directories or named volumes to specific paths within containers. This allows containers to share data or retain state beyond their lifecycle. Here’s a very textbook defination of the different volume declaration methods:&lt;/p&gt;

&lt;p&gt;Host Bind Mounts:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;volumes:
  - /host/path:/container/path
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This syntax mounts a directory from the host machine into the container. While straightforward, it’s crucial to ensure that the host path exists and has appropriate permissions. Otherwise, Docker will throw errors during container startup or fail to persist data.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Named Volumes:
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;volumes:
  - my_volume:/container/path
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Named volumes provide a convenient way to manage persistent data independently of container lifecycle. However, overlooking volume creation or forgetting to specify the driver may lead to unexpected behavior or data loss. Always define named volumes explicitly in your Docker Compose file to avoid surprises.&lt;/p&gt;

&lt;p&gt;Common Mistakes and Errors: Now, let’s address some common mistakes that even senior developers encounter when declaring volumes in Docker Compose:&lt;/p&gt;

&lt;p&gt;Missing/Invalid Host Paths: Now, what could be invalid host path you ask. In windows, any reference path should like below&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;volumes:
  - ./source/path:/container/path
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Mind the . (dot). That’s could be the source of all problem.&lt;/p&gt;

&lt;p&gt;In mac or linux, below syntaxt is valid&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;volumes:
  - /source/path:/container/path
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Volume Permissions: When using host bind mounts, ensure that the mounted directories have the necessary permissions for both the host and container processes. Mismatched permissions can lead to permission denied errors or unexpected behavior within the container.&lt;/p&gt;

&lt;p&gt;Specially, if there’s a shell or bash script in the mounted volume, it should be given exceute permission explicitly.&lt;/p&gt;

&lt;p&gt;Implicit Volume Creation: Neglecting to explicitly define named volumes in the Docker Compose file might result in Docker creating them implicitly. While Docker’s automatic volume creation can be convenient, it’s essential to have full control over volume lifecycle and configuration for better management and troubleshooting.&lt;/p&gt;

&lt;p&gt;Volume Cleanup: Failing to remove unused volumes can clutter the host filesystem over time, consuming valuable disk space. Regularly prune unused volumes using docker volume prune or by removing them explicitly with docker volume rm.&lt;/p&gt;

&lt;p&gt;Best Practices: To avoid these pitfalls and ensure smooth volume management in Docker Compose, follow these best practices:&lt;/p&gt;

&lt;p&gt;Explicit Volume Declaration: Always define volumes explicitly in your Docker Compose file, whether using host bind mounts or named volumes. This improves readability, facilitates troubleshooting, and prevents Docker from creating volumes implicitly.&lt;br&gt;
Documentation and Version Control: Document volume configurations thoroughly and version control your Docker Compose files. This ensures consistency across environments and helps track changes that may impact volume behavior.&lt;br&gt;
Regular Maintenance: Implement routine maintenance tasks such as volume cleanup to prevent clutter and optimize resource utilization on the host machine.&lt;br&gt;
Conclusion: Volumes are indispensable for data persistence and sharing in Docker Compose environments. By understanding common mistakes, adopting best practices, and paying attention to detail when declaring volumes, you can harness the full power of Docker Compose while avoiding headaches down the road. Remember, a well-managed volume setup is key to a robust and reliable containerized infrastructure.&lt;/p&gt;

</description>
      <category>docker</category>
      <category>aspnet</category>
      <category>dotnetcore</category>
      <category>csharp</category>
    </item>
  </channel>
</rss>
