<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Ihar Kryvanos on Medium]]></title>
        <description><![CDATA[Stories by Ihar Kryvanos on Medium]]></description>
        <link>https://medium.com/@ihar.kryvanos?source=rss-dc35ed8a94e4------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*BjLHDKuwnR249q4Wmv-hNQ.gif</url>
            <title>Stories by Ihar Kryvanos on Medium</title>
            <link>https://medium.com/@ihar.kryvanos?source=rss-dc35ed8a94e4------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Tue, 17 Nov 2026 19:20:41 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@ihar.kryvanos/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[How to run Llama 3.1 in your browser without a backend?]]></title>
            <link>https://medium.com/@ihar.kryvanos/how-to-run-llama-in-your-browser-without-a-backend-1d1f8d1ae7d4?source=rss-dc35ed8a94e4------2</link>
            <guid isPermaLink="false">https://medium.com/p/1d1f8d1ae7d4</guid>
            <category><![CDATA[promt]]></category>
            <category><![CDATA[webllm]]></category>
            <category><![CDATA[ai]]></category>
            <category><![CDATA[llama-3]]></category>
            <dc:creator><![CDATA[Ihar Kryvanos]]></dc:creator>
            <pubDate>Mon, 23 Sep 2024 10:28:25 GMT</pubDate>
            <atom:updated>2024-09-23T12:23:17.839Z</atom:updated>
            <content:encoded><![CDATA[<p>Imagine if it would be possible to run Llama directly in a browser without the necessity of setting up a server and building backend API for it. It is not necessary to protect access tokens, you could scale up to infinity, and be fully private. Is it a dream? No, it is reality</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ZU8JdKF9GAQMVYZ1b1bvRQ.png" /></figure><p>I’m talking about <a href="https://webllm.mlc.ai/">WebLLM</a>. It&#39;s a brand-new technology that allows you to run LLMs directly in your browser. It is compatible with a lot of open-source models such as lama, Phi, Gemma, RedPajama, Mistral, Qwen and etc. It is super easy to use and opens huge variety of option for you to use</p><h3>How to get started</h3><p>To add it to your project install it via npm:</p><pre># npm<br>npm install @mlc-ai/web-llm<br># yarn<br>yarn add @mlc-ai/web-llm</pre><p>or load it from the DNS</p><pre>import * as webllm from &quot;https://esm.run/@mlc-ai/web-llm&quot;;</pre><p>Then you need to choose the model and load it to context. Let&#39;s take <em>Llama-3.1–8B-Instruct-q4f32_1-MLC </em>for our example</p><pre>import { MLCEngine } from &quot;@mlc-ai/web-llm&quot;;<br><br>// Callback function to update model loading progress<br>const initProgressCallback = (initProgress) =&gt; {<br>  // Replace it with updating preloader on you page<br>  console.log(initProgress);<br>}<br><br>const engine = new MLCEngine({<br>  initProgressCallback: initProgressCallback<br>});<br><br>// This is an asynchrounous call and can take a long time to finish<br>// for a first time. Model would be cached and <br>// second load would be almost imidiate<br>await engine.reload(selectedModel);</pre><p>And last but not least, how to make a prompt</p><pre>const messages = [<br>  // initial bot promt<br>  { role: &quot;system&quot;, content: &quot;You are a helpful AI assistant.&quot; },<br>  // user request<br>  { role: &quot;user&quot;, content: &quot;Hello!&quot; },<br>]<br><br>const reply = await engine.chat.completions.create({<br>  messages,<br>});<br><br>// bot reply<br>console.log(reply.choices[0].message);<br><br>// reply stats<br>console.log(reply.usage);</pre><h3>Now let&#39;s compete OpenAI</h3><p>Here is the cut version of ChatGPT that you could run in your local browser or just open <a href="https://jsfiddle.net/jwfyta09/">demo</a></p><pre>&lt;html&gt;<br>&lt;style&gt;<br>  body {<br>    padding: 0px;<br>    margin: 0px;<br>  }<br>  .left-panel {<br>    width: 300px;<br>    height: 100%;<br>    float: left;<br>    background: #DDD;<br>    padding: 15px;<br>    margin-right: 10px;<br>  }<br>  .chats-header {<br>    text-align: right;<br>  }<br>  .chat {<br>    margin-left: 330px;<br>  }<br>  #messages {<br>    height: 90%;<br>    overflow: scroll;<br>  }<br>  .user-input {<br>        height: 10%;<br>        text-align: center;<br>  }<br>  .user-input textarea {<br>        width: 400px;<br>        height: 90%;<br>        border-radius: 10px;<br>        padding: 10px;<br>        text-align: left;<br>        resize: none;<br>  }<br>  .bot-message {<br>    background: #99F;<br>    min-width: 300px;<br>    padding: 10px;<br>    border-radius: 10px;<br>    margin: 5px 5px 5px 30px;<br>  }<br>  .user-message {<br>    background: #999;<br>    min-width: 300px;<br>    padding: 10px;<br>    border-radius: 10px;<br>    margin: 5px 30px 5px 5px;<br>  }<br>&lt;/style&gt;<br>&lt;body&gt;<br>  &lt;div class=&#39;left-panel&#39;&gt;<br>    &lt;div class=&#39;chats-header&#39;&gt;<br>        &lt;button id=&#39;new-chat-btn&#39;&gt;New Chat&lt;/button&gt;<br>    &lt;/div&gt;<br>  &lt;/div&gt;<br>  &lt;div class=&#39;chat&#39;&gt;<br>    &lt;div id=&#39;messages&#39;&gt;<br>    &lt;/div&gt;<br>    &lt;div class=&#39;user-input&#39;&gt;<br>      &lt;textarea disabled id=&#39;promt&#39;&gt;&lt;/textarea&gt;<br>      &lt;button id=&#39;submit-promt&#39;&gt;Send&lt;/button&gt;<br>    &lt;/div&gt;<br>  &lt;/div&gt;<br>  <br>&lt;/body&gt;<br><br>&lt;script type=&quot;module&quot;&gt;<br>  import { MLCEngine } from &quot;https://esm.run/@mlc-ai/web-llm&quot;;<br>  const promtInput = document.getElementById(&#39;promt&#39;);<br><br>  // Callback function to update model loading progress<br>  const initProgressCallback = (initProgress) =&gt; {<br>    const progress = (initProgress.progress * 100).toFixed(2);<br>    promtInput.value = `Initialization completed on ${progress}%`;<br>  }<br><br>  // create engine<br>  const engine = new MLCEngine({<br>    initProgressCallback: initProgressCallback,<br>  });<br><br>  const selectedModel = &quot;Llama-3.1-8B-Instruct-q4f32_1-MLC&quot;;<br>  // loading model<br>  await engine.reload(selectedModel);<br>  promtInput.disabled = false;<br>  promtInput.value = &#39;&#39;;<br><br><br>  let messages = [<br>    { role: &quot;system&quot;, content: &quot;You are a helpful AI assistant.&quot; },<br>  ];<br>  const displayMessages = () =&gt; {<br>    const container = document.getElementById(&#39;messages&#39;);<br>    container.innerHTML = &#39;&#39;;<br><br>    console.log(messages)<br>    for (const { role, content } of messages) {<br>        if (role === &#39;system&#39;) {<br>            // skip system messages<br>            continue;<br>        }<br><br>        const el = document.createElement(&#39;div&#39;);<br>        const cssClass = role === &#39;assistant&#39; ? &#39;bot-message&#39; : &#39;user-message&#39;;<br>        el.classList.add(cssClass);<br>        el.innerText = content<br>        container.appendChild(el);<br>    }<br>  }<br><br>  document.getElementById(&#39;submit-promt&#39;).onclick = async () =&gt; {<br>    messages.push({<br>      role: &#39;user&#39;, <br>      content: promtInput.value,<br>    });<br>    promtInput.value = &#39;&#39;;<br>         <br>    const reply = await engine.chat.completions.create({<br>      messages,<br>    });<br>    messages.push(reply.choices[0].message)<br>    displayMessages();<br>  };<br><br>  document.getElementById(&#39;new-chat-btn&#39;).onclick = () =&gt; {<br>    messages = [<br>      { role: &quot;system&quot;, content: &quot;You are a helpful AI assistant.&quot; },<br>    ];<br>    displayMessages();<br>  }<br>&lt;/script&gt;<br>&lt;/html&gt;</pre><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=1d1f8d1ae7d4" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Why GenAI makes Design Patterns more important than ever]]></title>
            <description><![CDATA[<div class="medium-feed-item"><p class="medium-feed-image"><a href="https://medium.com/@ihar.kryvanos/why-genai-makes-design-patterns-more-important-than-ever-93d2fc425dd9?source=rss-dc35ed8a94e4------2"><img src="https://cdn-images-1.medium.com/max/600/1*7T9vmn1O-WKLiEcYbZ2Hpw.jpeg" width="600"></a></p><p class="medium-feed-snippet">Everybody knows that GenAI such as ChatGPT, Llama, GitHub Copilot, and Gemini can generate a lot of code very effectively and much faster&#x2026;</p><p class="medium-feed-link"><a href="https://medium.com/@ihar.kryvanos/why-genai-makes-design-patterns-more-important-than-ever-93d2fc425dd9?source=rss-dc35ed8a94e4------2">Continue reading on Medium »</a></p></div>]]></description>
            <link>https://medium.com/@ihar.kryvanos/why-genai-makes-design-patterns-more-important-than-ever-93d2fc425dd9?source=rss-dc35ed8a94e4------2</link>
            <guid isPermaLink="false">https://medium.com/p/93d2fc425dd9</guid>
            <category><![CDATA[design-patterns]]></category>
            <category><![CDATA[computer-science]]></category>
            <category><![CDATA[genai]]></category>
            <category><![CDATA[chatgpt]]></category>
            <dc:creator><![CDATA[Ihar Kryvanos]]></dc:creator>
            <pubDate>Fri, 03 May 2024 14:20:43 GMT</pubDate>
            <atom:updated>2024-05-03T14:20:43.590Z</atom:updated>
        </item>
        <item>
            <title><![CDATA[What is controller pattern, or how to separate business logic and]]></title>
            <description><![CDATA[<div class="medium-feed-item"><p class="medium-feed-image"><a href="https://medium.com/@ihar.kryvanos/what-is-controller-pattern-or-how-to-separate-business-logic-and-823a6a67380f?source=rss-dc35ed8a94e4------2"><img src="https://cdn-images-1.medium.com/max/1920/1*06FFcTCV_h-9cy9YzdQVqw.jpeg" width="1920"></a></p><p class="medium-feed-snippet">Controller is great pattern which could help you to make you application better, scalable and make logic cleaner, but are you sure you use&#x2026;</p><p class="medium-feed-link"><a href="https://medium.com/@ihar.kryvanos/what-is-controller-pattern-or-how-to-separate-business-logic-and-823a6a67380f?source=rss-dc35ed8a94e4------2">Continue reading on Medium »</a></p></div>]]></description>
            <link>https://medium.com/@ihar.kryvanos/what-is-controller-pattern-or-how-to-separate-business-logic-and-823a6a67380f?source=rss-dc35ed8a94e4------2</link>
            <guid isPermaLink="false">https://medium.com/p/823a6a67380f</guid>
            <category><![CDATA[software-architecture]]></category>
            <category><![CDATA[nodejs]]></category>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[node]]></category>
            <dc:creator><![CDATA[Ihar Kryvanos]]></dc:creator>
            <pubDate>Sun, 31 Jul 2022 12:13:40 GMT</pubDate>
            <atom:updated>2024-05-06T08:26:33.705Z</atom:updated>
        </item>
        <item>
            <title><![CDATA[Validation vs Verification]]></title>
            <link>https://medium.com/@ihar.kryvanos/validation-vs-verification-e6e861f4e8f0?source=rss-dc35ed8a94e4------2</link>
            <guid isPermaLink="false">https://medium.com/p/e6e861f4e8f0</guid>
            <category><![CDATA[data-validation]]></category>
            <dc:creator><![CDATA[Ihar Kryvanos]]></dc:creator>
            <pubDate>Sun, 31 Jul 2022 12:12:16 GMT</pubDate>
            <atom:updated>2022-07-31T12:12:16.434Z</atom:updated>
            <content:encoded><![CDATA[<p>A lot of times you hearing words “<strong>validation</strong>” and “<strong>verification</strong>”, but do you know what different between them? Is this words meaning the same thing?</p><p>Actually they are really simular, but uses on a different levels. In simple words <strong>validation </strong>is checking data format and does it satisfy data quality. And <strong>verification</strong> is checks does you data satisfy some specific business or consistency rules.</p><h3>Let me give several examples:</h3><p>Validation is used to check is provided data satisfies format requirements:</p><ul><li>does data has exact types which you expects</li><li>does data has enough parameters</li></ul><p>Verification checks is data satisfy all business requirements and consistent with itself, let me provide several check for e-shop application:</p><ul><li>does basket total is not lower then sum of product prices</li><li>does discount is lower then basket total</li><li>does product price not negative</li></ul><p>That’s it you know the difference</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e6e861f4e8f0" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Authorisation vs Authentication]]></title>
            <link>https://medium.com/@ihar.kryvanos/authorisation-vs-authentication-13ac729b4cf2?source=rss-dc35ed8a94e4------2</link>
            <guid isPermaLink="false">https://medium.com/p/13ac729b4cf2</guid>
            <category><![CDATA[authentication]]></category>
            <category><![CDATA[authorization]]></category>
            <dc:creator><![CDATA[Ihar Kryvanos]]></dc:creator>
            <pubDate>Sun, 31 Jul 2022 11:59:41 GMT</pubDate>
            <atom:updated>2022-07-31T11:59:41.226Z</atom:updated>
            <content:encoded><![CDATA[<p>A lot of times you hearing words “<strong>authorisation</strong>”, “<strong>authentication</strong>”, but do you know what different between them? Is this words meaning the same thing?</p><p>Actually it a parts of single process, but meanth different parts of it. First of all let’s check terms definition from wiki:</p><blockquote><a href="https://en.wikipedia.org/wiki/Authentication"><strong>Authentication</strong></a><strong> — </strong>is the act of <a href="https://en.wikipedia.org/wiki/Proof_(truth)">proving</a> an <a href="https://en.wikipedia.org/wiki/Logical_assertion">assertion</a>, such as the <a href="https://en.wikipedia.org/wiki/Digital_identity">identity</a> of a computer system user</blockquote><blockquote><a href="https://en.wikipedia.org/wiki/Authorization"><strong>Authorization</strong></a><strong> — </strong>is the function of specifying access rights/privileges to resources</blockquote><p>In simple words <strong>authentication</strong> of identification that you is some specific user. <strong>Authorization</strong> is checking does you as a specific user able to do what you ask for.</p><h3>Let get an example from real live:</h3><ul><li>you try to opening some private some post from closed instagram account<br>- At first instagram will make an authentication, if you have no active session it asked you to authenricates, in simple words just log-in<br>- After instagram understand who you are, it will make an authorization. In simple words just check do you have an access to read this post<br>- And if you you have it will display post for you</li></ul><p>That’s it you know the difference</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=13ac729b4cf2" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Repository pattern or how I made business logic simpler]]></title>
            <description><![CDATA[<div class="medium-feed-item"><p class="medium-feed-image"><a href="https://medium.com/@ihar.kryvanos/repository-pattern-or-how-i-made-business-logic-simpler-6c2cdbab43fe?source=rss-dc35ed8a94e4------2"><img src="https://cdn-images-1.medium.com/max/900/1*M5Rb3Urs8EtmraKicAwjiQ.jpeg" width="900"></a></p><p class="medium-feed-snippet">Repository&#x200A;&#x2014;&#x200A;awesome pattern to make business logic cleaner and hide data source integration specific logic</p><p class="medium-feed-link"><a href="https://medium.com/@ihar.kryvanos/repository-pattern-or-how-i-made-business-logic-simpler-6c2cdbab43fe?source=rss-dc35ed8a94e4------2">Continue reading on Medium »</a></p></div>]]></description>
            <link>https://medium.com/@ihar.kryvanos/repository-pattern-or-how-i-made-business-logic-simpler-6c2cdbab43fe?source=rss-dc35ed8a94e4------2</link>
            <guid isPermaLink="false">https://medium.com/p/6c2cdbab43fe</guid>
            <category><![CDATA[repository-pattern]]></category>
            <category><![CDATA[nodejs]]></category>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[data-access-layer]]></category>
            <category><![CDATA[software-architecture]]></category>
            <dc:creator><![CDATA[Ihar Kryvanos]]></dc:creator>
            <pubDate>Sun, 05 Jun 2022 12:24:02 GMT</pubDate>
            <atom:updated>2024-05-06T08:28:42.596Z</atom:updated>
        </item>
        <item>
            <title><![CDATA[Unique indexes in DynamoDB]]></title>
            <description><![CDATA[<div class="medium-feed-item"><p class="medium-feed-image"><a href="https://medium.com/@ihar.kryvanos/unique-indexes-in-dynamodb-7c76461ae944?source=rss-dc35ed8a94e4------2"><img src="https://cdn-images-1.medium.com/max/1920/1*YqYw0iy9i3OmV87Z0KlrzA.jpeg" width="1920"></a></p><p class="medium-feed-snippet">DynamoDB doesn&#x2019;t have a mechanism to ensure value uniqueness for several columns, Let&#x2019;s me tell you how to handle it by ourselfs</p><p class="medium-feed-link"><a href="https://medium.com/@ihar.kryvanos/unique-indexes-in-dynamodb-7c76461ae944?source=rss-dc35ed8a94e4------2">Continue reading on Medium »</a></p></div>]]></description>
            <link>https://medium.com/@ihar.kryvanos/unique-indexes-in-dynamodb-7c76461ae944?source=rss-dc35ed8a94e4------2</link>
            <guid isPermaLink="false">https://medium.com/p/7c76461ae944</guid>
            <category><![CDATA[nodejs]]></category>
            <category><![CDATA[dynamodb]]></category>
            <category><![CDATA[aws]]></category>
            <category><![CDATA[bds]]></category>
            <dc:creator><![CDATA[Ihar Kryvanos]]></dc:creator>
            <pubDate>Wed, 01 Jun 2022 13:35:15 GMT</pubDate>
            <atom:updated>2024-05-06T08:28:00.543Z</atom:updated>
        </item>
        <item>
            <title><![CDATA[Transactions with DynamoDB]]></title>
            <description><![CDATA[<div class="medium-feed-item"><p class="medium-feed-image"><a href="https://medium.com/@ihar.kryvanos/transactions-with-dynamodb-7cae2c2fc947?source=rss-dc35ed8a94e4------2"><img src="https://cdn-images-1.medium.com/max/2600/1*V1ychuVLVp0h6PU8-078XQ.jpeg" width="6250"></a></p><p class="medium-feed-snippet">This article describes how to implement transactions in DynamoDB from single-operation to transactions covering full business flow</p><p class="medium-feed-link"><a href="https://medium.com/@ihar.kryvanos/transactions-with-dynamodb-7cae2c2fc947?source=rss-dc35ed8a94e4------2">Continue reading on Medium »</a></p></div>]]></description>
            <link>https://medium.com/@ihar.kryvanos/transactions-with-dynamodb-7cae2c2fc947?source=rss-dc35ed8a94e4------2</link>
            <guid isPermaLink="false">https://medium.com/p/7cae2c2fc947</guid>
            <category><![CDATA[transactions]]></category>
            <category><![CDATA[nodejs]]></category>
            <category><![CDATA[race-condition]]></category>
            <category><![CDATA[dynamodb]]></category>
            <dc:creator><![CDATA[Ihar Kryvanos]]></dc:creator>
            <pubDate>Wed, 01 Jun 2022 05:41:56 GMT</pubDate>
            <atom:updated>2024-05-06T08:28:21.938Z</atom:updated>
        </item>
    </channel>
</rss>