<?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"><channel><title><![CDATA[Local AI Notes]]></title><description><![CDATA[Local AI Notes]]></description><link>https://local-ai-notes.hashnode.dev</link><generator>RSS for Node</generator><lastBuildDate>Mon, 09 Nov 2026 11:58:35 GMT</lastBuildDate><atom:link href="https://local-ai-notes.hashnode.dev/rss.xml" rel="self" type="application/rss+xml"/><language><![CDATA[en]]></language><ttl>60</ttl><item><title><![CDATA[I built a small engine that gives local LLMs real tools]]></title><description><![CDATA[L.A.T.E. is a small open-source Node.js engine that gives Ollama and API models real tools: exact math, research with sources, memory and file search.]]></description><link>https://local-ai-notes.hashnode.dev/i-built-a-small-engine-that-gives-local-llms-real-tools</link><guid isPermaLink="true">https://local-ai-notes.hashnode.dev/i-built-a-small-engine-that-gives-local-llms-real-tools</guid><category><![CDATA[AI]]></category><category><![CDATA[JavaScript]]></category><category><![CDATA[Open Source]]></category><category><![CDATA[ollama]]></category><dc:creator><![CDATA[IshantKaushik]]></dc:creator><pubDate>Sun, 01 Nov 2026 04:56:47 GMT</pubDate><content:encoded><![CDATA[<p>Small local models are good at chatting and bad at the basics. They get math wrong, they forget everything between chats, and when they don't know something they make it up.</p>
<p>I got tired of that, so I built <strong>L.A.T.E.</strong> (Local AI Tool Engine), a small Node.js project that gives a model a few real tools. The idea is simple: the tools do the exact work, and the model only writes the answer.</p>
<p><a href="https://github.com/ikaushik817-art/local-ai-tool-engine">https://github.com/ikaushik817-art/local-ai-tool-engine</a></p>
<h2>What it does</h2>
<ul>
<li><strong>Exact math.</strong> The calculator does the maths, not the model. Divide by zero gives a proper error.</li>
<li><strong>Research with sources.</strong> It searches, opens the top few pages, picks the part that matches your question, and answers only from what it read, with links.</li>
<li><strong>Memory that survives a restart.</strong> Tell it what you're working on, close it, open it again, it still knows.</li>
<li><strong>Your files.</strong> Search inside a folder or read a text file.</li>
<li><strong>Dates.</strong> Exact date and time, and "how many days until X". Small models get this wrong a lot.</li>
</ul>
<img src="https://dev-to-uploads.s3.us-east-2.amazonaws.com/uploads/articles/8eob20rk7c1amwhmjeb7.png" alt="the research answer with sources" style="display:block;margin:0 auto" />

<img src="https://dev-to-uploads.s3.us-east-2.amazonaws.com/uploads/articles/rewyw0qhnya6gz2tuhaj.png" alt="memory after closing and reopening" style="display:block;margin:0 auto" />

<img src="https://dev-to-uploads.s3.us-east-2.amazonaws.com/uploads/articles/isxgnb2xnvlcasz84bac.png" alt="the same math question, plain model vs L.A.T.E." style="display:block;margin:0 auto" />

<h2>Setup is one command</h2>
<pre><code class="language-bash">npm start
</code></pre>
<p>The first time, it installs everything and looks for Ollama or LM Studio on your machine. If you'd rather use a cloud model, you can paste an API key (Groq, OpenRouter, OpenAI) and it checks the key for you. After that, <code>npm start</code> just opens the chat.</p>
<p>There's no LangChain and only two dependencies.</p>
<h2>How it decides what to do</h2>
<p>The obvious cases (a math question, a link, a file name, "remember this", "what time is it") go straight to the right tool, so there's no guessing. Small models are bad at picking tools on their own, so I didn't want to depend on that. For everything else, if you've added your own tools, the model picks one. It can use up to 5 tools per question and never runs the exact same call twice, so it can't get stuck in a loop.</p>
<h2>Adding your own tool</h2>
<pre><code class="language-js">ai.registerTool({
  name: "coin_flip",
  description: "Flips a coin and returns heads or tails.",
  parameters: {},
  execute: async () =&gt; (Math.random() &lt; 0.5 ? "heads" : "tails")
});

console.log(await ai.chat("Flip a coin for me"));
</code></pre>
<p>You can add a new model provider the same way, in about 15 lines.</p>
<h2>What I tested, and what I didn't</h2>
<p>I ran it with Ollama (qwen2.5:3b and dolphin-mistral:latest) and with Groq. LM Studio, Jan, OpenRouter and other OpenAI-compatible servers should work.</p>
<p>Some honest limits:</p>
<ul>
<li>Search scrapes DuckDuckGo, so it can get rate-limited if you hammer it.</li>
<li>Small models still make mistakes, even with the tools. The research tool is told to answer only from the pages, but a small model can still slip, so check anything important.</li>
<li>No streaming, and it can't read PDFs yet.</li>
</ul>
<h2>What's next</h2>
<p>I'm thinking PDF reading and a tool that can save files safely. If you try it and something breaks, or there's a tool you'd want, open an issue or tell me in the comments.<br /><br />Originally published on <a href="http://dev.to">dev.to</a>: <a href="https://dev.to/ishxkaushik/i-built-a-small-engine-that-gives-local-llms-real-tools-5hbf">https://dev.to/ishxkaushik/i-built-a-small-engine-that-gives-local-llms-real-tools-5hbf</a></p>
]]></content:encoded></item></channel></rss>