Show HN: Make small local LLMs reliable agents by moving planning into code A developer released L.A.T.E. (Local AI Tool Engine), an open-source agent framework that moves multi-step planning out of the language model and into plain code, so small local models can complete tasks reliably. L.A.T.E. runs with Ollama, LM Studio, or any OpenAI-compatible API (Groq, OpenAI, OpenRouter, Gemini), requires Node.js 18 or newer and two dependencies, and uses tools for exact maths, dates, unit conversion, counting and weather while the model only writes the answer. The project reports that the same words produce the same plan every time and that results list the steps that actually ran, marking partial or failed jobs as "Partly done" or "NOT a success" rather than claiming completion. Local AI Tool Engine L.A.T.E. takes a local model or an API model and turns it into an agent. You give it a goal, and it works through it: it picks a tool, runs it, reads what came back, and keeps going until the job is done. Search the web, read pages and files, do exact maths, save files, remember things between chats. I built it because models on their own are bad at the boring parts. They get maths wrong, forget everything when the chat ends, and make things up instead of looking them up. Small models are worse: they skip steps, count letters in their head and lose track halfway through a job. So here the tools do the exact work, plain code handles the order of the steps, and the model mostly writes the answer. It runs with Ollama, LM Studio, or an API key Groq, OpenAI, OpenRouter, Gemini, anything OpenAI-compatible . No LangChain, no paid API needed, two dependencies. - Exact answers. Maths, dates, unit conversion, counting, random numbers and weather come from real tools, not from the model's memory. - Multi-step jobs. "Create a file, read it back, count the characters, save the count, read that file too" runs as exact steps, in order, and the answer lists what really happened. Works even when the model is tiny. - Research with sources. It searches, opens the best pages, answers from what it read, and links them. - Your files. Read a file, search a folder, copy, merge, sort the lines, change case, append text. - Memory. Tell it something once, it remembers in later chats. forget really removes it. - Saving files. Only after you say yes, and only into an ai-output folder. - Terminal or browser. A terminal chat, or a small web page on your own computer. - Rules first, model last. The plan for a job is made by plain code the same words give the same plan every time . The model only writes text. A job is never answered with "here's how you could do it": it runs, or it says plainly that it couldn't. - It says what really happened. The answer lists the steps that ran and what the tools returned. If a step failed it says "Partly done" or "I stopped at step N because...". If the last check found a difference it says "NOT a success". It never says "Done" for work that wasn't done. You need Node.js https://nodejs.org/ 18 or newer I use 22 . Then, in the project folder, one command: npm start That's all. The first time it: 1. installs what it needs a minute, one time, you never type npm install , 2. finds your model : Ollama or LM Studio if one is running it can even download a small model for you , or you choose "API key" and pick OpenAI, Groq, OpenRouter, Gemini or any OpenAI-compatible URL and paste the key. It checks the key and lists the models, 3. asks if you want PDF reading adds one small library, about 1 MB , 4. sends a test message, and opens the chat. After that, npm start just opens the chat. If an update brings a new library, it installs it by itself on the next start. Prefer a browser? npm run ui and open the address it prints. Change the model later: npm run setup . Type exit to quit. npm test runs the tests no model needed . npm run eval tests how good your model is see below . No wizard? Set the variables yourself, e.g. AI PROVIDER=lmstudio npm start PowerShell: $env:AI PROVIDER="lmstudio" first . You don't need /agent for these. If one sentence asks for several things, L.A.T.E. splits it into steps by itself. Some examples that work: Create a file called test.txt with "hello123", read it back, count the characters, save the count to result.txt, then read result.txt. Remember that my favorite number is 777, tell me the number, forget it, then tell me the number again. Create 5 text files. Each file should contain a unique random number. Then search all files and tell me which file contains the largest number. Read notes.txt, sort the lines, then save it to sorted.txt Merge a.txt, b.txt and c.txt into all.txt Convert 10 km to miles, then save it to d.txt Create a.txt with HELLO, create b.txt with WORLD, read both files, save their contents into combined.txt, then read combined.txt. Create a.txt with AAA and b.txt with BBB and c.txt with CCC then merge them into merged.txt. Create a.txt with 10, create b.txt with 20, add the two numbers and save the sum to sum.txt. Create alpha.txt with FIRST, create beta.txt with SECOND, combine both contents into final.txt, then verify that FIRST and SECOND are both present in final.txt. Remember my favorite fruit is mango. Change my favorite fruit to apple. Recall my favorite fruit. Create s.txt with one two three, count the words, then verify the count is 3. Create 10 files containing random numbers, find the largest value, save a report, corrupt the report, detect the corruption, repair the report, verify the repair. What the rules understand is a list of shapes, not "anything you can say". See "Not done yet / known limits" below. How it works, in order: 1. Rules first. The request is cut into clauses and turned into tool calls by plain code. Values move from step to step the count from text stats is what gets saved, nobody guesses it . No model needed. 2. Model plan second. If the rules don't understand the request, the model writes a plan as JSON. It is only used if every step is valid real tool, right arguments, values that exist . Otherwise it's thrown away. 3. One tool at a time last. Anything else falls back to the model picking a tool, looking at the result, and picking the next one. It gets a second try if it breaks the JSON. What you get back is a report built from what actually ran: Done. All 5 steps worked: 1. Saved to ai-output/test.txt 8 bytes , containing: hello123 2. Read test.txt: hello123 3. Counted 8 characters in test.txt. 4. Saved to ai-output/result.txt 1 bytes , containing: 8 5. Read result.txt: 8 Checked: I read back 2 saved files and they match what I meant to write. If you say no to a save, or a step fails, it stops there and tells you what was done and what wasn't. It doesn't carry on with wrong data. If test.txt already exists and gets saved as test-2.txt , the next steps use the real name. When the job needs writing, the model writes only the text and everything around it stays exact: Write a two-line poem about the sea and save it to sea.txt Summarize notes.txt in one sentence Translate "good morning" to Spanish and save it to es.txt Research react hooks, then write a short report and save it to report.md Create a file called fruits.txt with a list of 3 fruits, then read it back The file text goes to the model as data, never as instructions. Every save is read back. In a research report the links come from the real search, so the model can't make them up. Quoted text is always saved exactly as you typed it. Want to see the steps first? /plan