<?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: Aniket Dhakane</title>
    <description>The latest articles on DEV Community by Aniket Dhakane (@hisukurifu).</description>
    <link>https://dev.to/hisukurifu</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%2F2494658%2F1281c2d7-45ea-4000-adc1-8bfe22cf9cbd.jpeg</url>
      <title>DEV Community: Aniket Dhakane</title>
      <link>https://dev.to/hisukurifu</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/hisukurifu"/>
    <language>en</language>
    <item>
      <title>So I built a Figma Design Agent for an Agentic AI Hackathon #kiro #figma #agents #geminicli</title>
      <dc:creator>Aniket Dhakane</dc:creator>
      <pubDate>Mon, 11 May 2026 16:10:37 +0000</pubDate>
      <link>https://dev.to/hisukurifu/so-we-built-a-figma-design-agent-for-an-agentic-ai-hackathon-kiro-figma-agents-geminicli-1dff</link>
      <guid>https://dev.to/hisukurifu/so-we-built-a-figma-design-agent-for-an-agentic-ai-hackathon-kiro-figma-agents-geminicli-1dff</guid>
      <description>&lt;p&gt;&lt;em&gt;Design-to-code handoffs are one of the biggest time sinks in frontend teams&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;I have been working as a UI developer lately at an organization where we are developing multiple &lt;code&gt;MFEs (Micro Frontends)&lt;/code&gt; which are interlinked with a main Dashboard (Can't go into too much details). &lt;/p&gt;

&lt;p&gt;All our products follow a same design library which is written in a separate NX repo, which is then imported as a package. This helps us keep a common Design System which boosts our development speed and reduce the feature development time. &lt;/p&gt;

&lt;p&gt;Till now the process of maintaining this Design System Repo was manual, a UX developer would build the design in Figma, then the developer would recreate it manually with the help of AI, but there was no one step agent to just paste the figma link and get a whole live storybook preview of built component with agent hooks to directly raise PRs using the &lt;code&gt;ADO (Azure Devops) MCP&lt;/code&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%2Fx4lm289bvyilm1lk93o2.jpg" 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%2Fx4lm289bvyilm1lk93o2.jpg" alt="ai-agents-everywhere" width="600" height="327"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;In this article I am going to show you how you can create your own design agent using gemini CLI (or claude code), Figma MCP and Vercel's &lt;code&gt;web-design-guidelines&lt;/code&gt; skills. (It won't contain the PR &amp;amp; ADO part)&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Here's how I set it up, and how you can too&lt;/p&gt;

&lt;h3&gt;
  
  
  Pre-Requisites
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Gemini CLI (or Claude Code)&lt;/li&gt;
&lt;li&gt;Figma MCP Extension&lt;/li&gt;
&lt;li&gt;web-design-guidelines SKILL.md&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;You can get gemini CLI using &lt;code&gt;npm install -g @google/gemini-cli&lt;/code&gt;, and steps to install the Figma MCP extension is given &lt;a href="https://help.figma.com/hc/en-us/articles/39889246888855-Gemini-CLI-and-Figma-Set-up-the-MCP-server" rel="noopener noreferrer"&gt;here&lt;/a&gt; &amp;amp; you can get the SKILL.md &lt;a href="https://github.com/vercel-labs/agent-skills/blob/main/skills/web-design-guidelines/SKILL.md" rel="noopener noreferrer"&gt;here&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Setup
&lt;/h3&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%2Frv8empz1lszwyvxz9vpl.jpg" 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%2Frv8empz1lszwyvxz9vpl.jpg" alt="setup-meme" width="301" height="167"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;First start up your gemini cli in the directory which you want to work on and prompt it to generate you an agent in global level&lt;/li&gt;
&lt;/ul&gt;

&lt;blockquote&gt;
&lt;p&gt;~/.gemini/agents/.md&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;and paste the following Markdown file along with the prompt&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="nn"&gt;---&lt;/span&gt;
&lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;figma-design-agent&lt;/span&gt;
&lt;span class="na"&gt;description&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="s"&gt;A&lt;/span&gt;&lt;span class="nv"&gt; &lt;/span&gt;&lt;span class="s"&gt;specialist&lt;/span&gt;&lt;span class="nv"&gt; &lt;/span&gt;&lt;span class="s"&gt;in&lt;/span&gt;&lt;span class="nv"&gt; &lt;/span&gt;&lt;span class="s"&gt;translating&lt;/span&gt;&lt;span class="nv"&gt; &lt;/span&gt;&lt;span class="s"&gt;Figma&lt;/span&gt;&lt;span class="nv"&gt; &lt;/span&gt;&lt;span class="s"&gt;designs&lt;/span&gt;&lt;span class="nv"&gt; &lt;/span&gt;&lt;span class="s"&gt;into&lt;/span&gt;&lt;span class="nv"&gt; &lt;/span&gt;&lt;span class="s"&gt;production-ready&lt;/span&gt;&lt;span class="nv"&gt; &lt;/span&gt;&lt;span class="s"&gt;code&lt;/span&gt;&lt;span class="nv"&gt; &lt;/span&gt;&lt;span class="s"&gt;with&lt;/span&gt;&lt;span class="nv"&gt; &lt;/span&gt;&lt;span class="s"&gt;pixel-perfect&lt;/span&gt;&lt;span class="nv"&gt; &lt;/span&gt;&lt;span class="s"&gt;accuracy,&lt;/span&gt;&lt;span class="nv"&gt; &lt;/span&gt;&lt;span class="s"&gt;high&lt;/span&gt;&lt;span class="nv"&gt; &lt;/span&gt;&lt;span class="s"&gt;accessibility,&lt;/span&gt;&lt;span class="nv"&gt; &lt;/span&gt;&lt;span class="s"&gt;and&lt;/span&gt;&lt;span class="nv"&gt; &lt;/span&gt;&lt;span class="s"&gt;following&lt;/span&gt;&lt;span class="nv"&gt; &lt;/span&gt;&lt;span class="s"&gt;web&lt;/span&gt;&lt;span class="nv"&gt; &lt;/span&gt;&lt;span class="s"&gt;interface&lt;/span&gt;&lt;span class="nv"&gt; &lt;/span&gt;&lt;span class="s"&gt;guidelines."&lt;/span&gt;
&lt;span class="na"&gt;tools&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="pi"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="s"&gt;*"&lt;/span&gt;&lt;span class="pi"&gt;]&lt;/span&gt;
&lt;span class="na"&gt;model&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;gemini-3-flash-preview&lt;/span&gt;
&lt;span class="nn"&gt;---&lt;/span&gt;

&lt;span class="gh"&gt;# Figma Design Agent&lt;/span&gt;

You are a senior software engineer and UI/UX specialist. Your primary goal is to help users bridge the gap between Figma designs and production code.

&lt;span class="gu"&gt;## Core Expertise&lt;/span&gt;
&lt;span class="p"&gt;
-&lt;/span&gt; &lt;span class="gs"&gt;**Design Translation:**&lt;/span&gt; Implementing UI components and pages from Figma URLs with 1:1 visual fidelity.
&lt;span class="p"&gt;-&lt;/span&gt; &lt;span class="gs"&gt;**Accessibility &amp;amp; UX:**&lt;/span&gt; Ensuring all code follows the Vercel Web Interface Guidelines, prioritizing semantic HTML, focus states, and keyboard navigation.
&lt;span class="p"&gt;-&lt;/span&gt; &lt;span class="gs"&gt;**Design Systems:**&lt;/span&gt; Building and maintaining design systems, tokens, and reusable component libraries.
&lt;span class="p"&gt;-&lt;/span&gt; &lt;span class="gs"&gt;**Code Connect:**&lt;/span&gt; Mapping Figma components to source code for seamless developer handoffs.

&lt;span class="gu"&gt;## Preferred Workflow&lt;/span&gt;
&lt;span class="p"&gt;
1.&lt;/span&gt; &lt;span class="gs"&gt;**Research:**&lt;/span&gt; Use &lt;span class="sb"&gt;`mcp_figma_get_design_context`&lt;/span&gt; and &lt;span class="sb"&gt;`mcp_figma_get_screenshot`&lt;/span&gt; to gather context.
&lt;span class="p"&gt;2.&lt;/span&gt; &lt;span class="gs"&gt;**Strategy:**&lt;/span&gt; Plan the component architecture and Tailwind/CSS strategy.
&lt;span class="p"&gt;3.&lt;/span&gt; &lt;span class="gs"&gt;**Execution:**&lt;/span&gt; Implement surgical, high-quality code changes.
&lt;span class="p"&gt;4.&lt;/span&gt; &lt;span class="gs"&gt;**Validation:**&lt;/span&gt; Use &lt;span class="sb"&gt;`web-design-guidelines`&lt;/span&gt; (via &lt;span class="sb"&gt;`web_fetch`&lt;/span&gt; from Vercel's guidelines URL) to audit the implementation.

&lt;span class="gu"&gt;## Mandates&lt;/span&gt;
&lt;span class="p"&gt;
-&lt;/span&gt; &lt;span class="gs"&gt;**Pixel Perfection:**&lt;/span&gt; Always match the design's spacing, typography, and color tokens exactly.
&lt;span class="p"&gt;-&lt;/span&gt; &lt;span class="gs"&gt;**Accessibility First:**&lt;/span&gt; Never compromise on semantic HTML or ARIA labels.
&lt;span class="p"&gt;-&lt;/span&gt; &lt;span class="gs"&gt;**Tailwind Native:**&lt;/span&gt; Use Tailwind CSS for styling unless the project dictates otherwise.
&lt;span class="p"&gt;-&lt;/span&gt; &lt;span class="gs"&gt;**Clean Code:**&lt;/span&gt; Use modern React/TypeScript patterns, avoiding unused imports and ensuring type safety.

&lt;span class="gu"&gt;## References&lt;/span&gt;
&lt;span class="p"&gt;
-&lt;/span&gt; &lt;span class="gs"&gt;**Figma Skills:**&lt;/span&gt; &lt;span class="sb"&gt;`figma-implement-design`&lt;/span&gt;, &lt;span class="sb"&gt;`figma-use`&lt;/span&gt;, &lt;span class="sb"&gt;`figma-code-connect`&lt;/span&gt;, &lt;span class="sb"&gt;`figma-generate-design`&lt;/span&gt;.
&lt;span class="p"&gt;-&lt;/span&gt; &lt;span class="gs"&gt;**UI Guidelines:**&lt;/span&gt; Vercel Web Interface Guidelines.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;Once done you can then paste the SKILL.md inside the skills folder &lt;/li&gt;
&lt;/ul&gt;

&lt;blockquote&gt;
&lt;p&gt;~/.gemini/skills//SKILL.md &lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;And you are done, type &lt;code&gt;/agents reload&lt;/code&gt; followed with &lt;code&gt;/agents list&lt;/code&gt; and you will see our newly created agent listed over the cli.&lt;/p&gt;

&lt;p&gt;Now just get the figma link of the component or page you want to create and paste it in the cli &lt;/p&gt;

&lt;p&gt;&lt;code&gt;@figma-generate-design &amp;lt;FIGMA_DESIGN_LINK&amp;gt;&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Wait for the model to generate the site and you are all set, now just iterate over the generated components or keep them as it is if satisfactory. &lt;/p&gt;

&lt;p&gt;Below is my experiment with gemini cli (for office we have access to claude opus and the generation from that along with custom steering files is a whole lot better)&lt;/p&gt;

&lt;p&gt;&lt;iframe class="tweet-embed" id="tweet-2050976596094505335-592" src="https://platform.twitter.com/embed/Tweet.html?id=2050976596094505335"&gt;
&lt;/iframe&gt;

  // Detect dark theme
  var iframe = document.getElementById('tweet-2050976596094505335-592');
  if (document.body.className.includes('dark-theme')) {
    iframe.src = "https://platform.twitter.com/embed/Tweet.html?id=2050976596094505335&amp;amp;theme=dark"
  }



&lt;/p&gt;

&lt;p&gt;Alright then people, keep building and keep experimenting with AI models, we are living in an era where you can build almost anything, all you need is alot of tokens xD&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%2Fepuygjp28timmkviqzzq.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%2Fepuygjp28timmkviqzzq.png" alt="we-require-more-tokens" width="334" height="212"&gt;&lt;/a&gt;&lt;/p&gt;

</description>
      <category>agents</category>
      <category>ai</category>
      <category>design</category>
      <category>frontend</category>
    </item>
    <item>
      <title>Running local LLM (Ollama) in your nodejs project.</title>
      <dc:creator>Aniket Dhakane</dc:creator>
      <pubDate>Thu, 28 Nov 2024 08:37:26 +0000</pubDate>
      <link>https://dev.to/hisukurifu/running-local-llm-ollama-from-api-in-node-2kk3</link>
      <guid>https://dev.to/hisukurifu/running-local-llm-ollama-from-api-in-node-2kk3</guid>
      <description>&lt;p&gt;We all love AI, and since recent years the boom in Artificial Intelligence has changed the world and is taking it into a new era. For any use problem there is a use case of AI, being it asking &lt;em&gt;&lt;a href="https://gemini.google.com/" rel="noopener noreferrer"&gt;Gemini&lt;/a&gt;&lt;/em&gt; about a cooking recipe, &lt;em&gt;&lt;a href="https://chatgpt.com" rel="noopener noreferrer"&gt;Chatgpt&lt;/a&gt;&lt;/em&gt; for assignments, &lt;em&gt;&lt;a href="https://claude.ai/" rel="noopener noreferrer"&gt;Claude&lt;/a&gt;&lt;/em&gt; for programming, &lt;em&gt;&lt;a href="https://v0.dev" rel="noopener noreferrer"&gt;V0&lt;/a&gt;&lt;/em&gt; for frontend design, devs and students are so much dependent on AI these days which leads to almost every new day a startup emerging featuring AI.&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%2Fglx8dahk28dvcn4x4uyh.jpg" 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%2Fglx8dahk28dvcn4x4uyh.jpg" alt="AI Startup meme" width="714" height="960"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This leads to aspiring developers like me question on how can I make something like this? The answer is in the picture above only. API call to these models. But, they are not cheap and an unemployed student like me has no means to purchase the subscription. This lead to the idea of running the AI locally and then serving it on port for api calls. This article would give you a step by step guide on how you can setup Ollama and access the LLMs through your nodejs code.&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;Installing Ollama&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;&lt;em&gt;This step is for windows users. If you are on other operating systems then follow &lt;a href="https://medium.com/@sridevi17j/step-by-step-guide-setting-up-and-running-ollama-in-windows-macos-linux-a00f21164bf3" rel="noopener noreferrer"&gt;this&lt;/a&gt; guide.&lt;/em&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Head over to &lt;a href="https://ollama.com" rel="noopener noreferrer"&gt;Ollama&lt;/a&gt;, and download their installer.&lt;/li&gt;
&lt;/ul&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%2Fz43fs82689vxe6yc5fes.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%2Fz43fs82689vxe6yc5fes.png" alt="Ollama download page" width="800" height="412"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Once done, fire up the setup and Install the application.&lt;/li&gt;
&lt;/ul&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%2Fg9k2az0j4y40sfalx08c.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%2Fg9k2az0j4y40sfalx08c.png" alt="Ollama installer" width="800" height="594"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;This will then install the client on your machine, and now you can head over to the &lt;a href="https://ollama.com/search" rel="noopener noreferrer"&gt;library&lt;/a&gt; section of ollama's official website to pick the model you want to use.&lt;/li&gt;
&lt;/ul&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%2F5cpy9vdpgxcd8dsysfvj.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%2F5cpy9vdpgxcd8dsysfvj.png" alt="Ollama Models to choose from" width="632" height="732"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Here, I'll be using codellama:7b for my machine.&lt;/li&gt;
&lt;li&gt;Open your CMD or Powershell and run the command &lt;code&gt;ollama run &amp;lt;model-name&amp;gt;&lt;/code&gt;, this will download the model on your machine if it already does not exist and then would run it.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;Serving LLM on Port&lt;/strong&gt;
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Now you have Ollama on your system and also have the required LLM, so the next step would be to serve it on your machine's port for your node app to access it.&lt;/li&gt;
&lt;li&gt;Before proceeding, close the Ollama from background and check if the default port assigned to ollama is empty or not by using this command
&lt;code&gt;ollama serve&lt;/code&gt;, if this throws an error then it means the port is occupied.&lt;/li&gt;
&lt;li&gt;You'll need to clear that port before proceeding, the default port for Ollama is &lt;code&gt;11434&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Use the following command to check what process is running on that port
&lt;code&gt;netstat -ano | findstr :11434&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Note down the PID from the above result and use this command to clear the port.
&lt;code&gt;taskkill /PID &amp;lt;PID&amp;gt; /F&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Once done open new cmd terminal and run the following command
&lt;code&gt;ollama serve&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Now you'll see something like this which means your LLMs are now accessible through API calls. &lt;/li&gt;
&lt;/ul&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%2Fvmp7u8p97gw4xwhtur0w.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%2Fvmp7u8p97gw4xwhtur0w.png" alt="Ollama server Stat" width="800" height="387"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;Using ollama npm package to for req response handling&lt;/strong&gt;
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Start your node project by following the commands
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;npm init -y
npm i typescript ollama
npx tsc --init
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;this will create a repo for you to start working, first head over to &lt;code&gt;tsconfig.json&lt;/code&gt; file, uncomment and set these values
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;"rootDir": "./src",
"outDir": "./dist",
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;Create a src folder and inside the folder create the &lt;code&gt;index.js&lt;/code&gt; file.
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;import ollama from 'ollama';

async function main() {
    const response = await ollama.chat({
        model: 'codellama:7b',
        messages: [
            {
                role: 'user', 
                content: 'What color is the sky?'
            }
        ],
    })
    console.log(response.message.content)

}

main()

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;Now before running the code, edit the scripts in &lt;code&gt;package.json&lt;/code&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;"scripts": {
    "dev": "tsc -b &amp;amp;&amp;amp; node dist/index.js"
  },
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;This would build the ts code into js code for running.&lt;/li&gt;
&lt;li&gt;Run the application by using the command
&lt;code&gt;npm run dev&lt;/code&gt; inside the terminal.&lt;/li&gt;
&lt;/ul&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%2Fm897q62ise1bu2bjv1k6.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%2Fm897q62ise1bu2bjv1k6.png" alt="VSCode SS" width="800" height="626"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;There you are. Finally being able to access your local LLM with nodejs. &lt;/li&gt;
&lt;li&gt;You can read more about the node package ollama &lt;a href="https://www.npmjs.com/package/ollama" rel="noopener noreferrer"&gt;here&lt;/a&gt;.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Thank you for reading, Hope this article could help you in any case and if it did then feel free to connect on my socials!&lt;/p&gt;

&lt;p&gt;&lt;a href="https://www.linkedin.com/in/aniket-dhakane-9b06a125b/" rel="noopener noreferrer"&gt;Linkedin&lt;/a&gt; | &lt;a href="https://github.com/watashiwaaniket" rel="noopener noreferrer"&gt;Github&lt;/a&gt;&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>javascript</category>
      <category>typescript</category>
      <category>node</category>
    </item>
  </channel>
</rss>
