<?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: Lorena Dávila Ermus</title>
    <description>The latest articles on DEV Community by Lorena Dávila Ermus (@lorena_dvila_5ab5ef35ec6).</description>
    <link>https://dev.to/lorena_dvila_5ab5ef35ec6</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.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F2889441%2F3e6e2ead-6203-45fa-b2f3-926a0eb4d1a9.png</url>
      <title>DEV Community: Lorena Dávila Ermus</title>
      <link>https://dev.to/lorena_dvila_5ab5ef35ec6</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/lorena_dvila_5ab5ef35ec6"/>
    <language>en</language>
    <item>
      <title>2.Self-Hosted AI: n8n + Ollama, local AI workflows on your Mac</title>
      <dc:creator>Lorena Dávila Ermus</dc:creator>
      <pubDate>Sat, 08 Aug 2026 03:38:53 +0000</pubDate>
      <link>https://dev.to/lorena_dvila_5ab5ef35ec6/2self-hosted-ai-n8n-ollama-local-ai-workflows-on-your-mac-239k</link>
      <guid>https://dev.to/lorena_dvila_5ab5ef35ec6/2self-hosted-ai-n8n-ollama-local-ai-workflows-on-your-mac-239k</guid>
      <description>&lt;p&gt;If you want AI agents running on your own machine, with your own models, and no data leaving your computer, this is the article :).&lt;/p&gt;

&lt;p&gt;This is part three of the series. In &lt;a href="https://dev.to/lorena_dvila_5ab5ef35ec6/1-quick-guide-to-setting-up-postgresql-on-mac-via-cli-with-homebrew-3548"&gt;part one&lt;/a&gt; we set up PostgreSQL, and in &lt;a href="https://dev.to/lorena_dvila_5ab5ef35ec6/2-self-hosted-ai-the-llm-concepts-you-need-to-run-models-effectively-1nl1"&gt;part two&lt;/a&gt; we covered the LLM concepts (models, parameter, quantization, context, capabilities, VRAM). Today we put them to work: n8n for the workflows and Ollama for the models.&lt;/p&gt;

&lt;p&gt;One prerequisite: Docker. If you do not have it yet, install Docker Desktop for Mac following the official guide [&lt;a href="https://docs.docker.com/get-started/get-docker/" rel="noopener noreferrer"&gt;Docker docs&lt;/a&gt;].&lt;/p&gt;

&lt;h2&gt;
  
  
  Quick setup: n8n
&lt;/h2&gt;

&lt;p&gt;The fastest path is n8n's official Self-hosted AI Starter Kit, a Docker Compose template that ships n8n, Ollama, Qdrant (a vector store) and PostgreSQL preconfigured to talk to each other [&lt;a href="https://docs.n8n.io/hosting/starter-kits/ai-starter-kit/" rel="noopener noreferrer"&gt;n8n docs&lt;/a&gt;].&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git clone https://github.com/n8n-io/self-hosted-ai-starter-kit.git
&lt;span class="nb"&gt;cd &lt;/span&gt;self-hosted-ai-starter-kit
&lt;span class="nb"&gt;cp&lt;/span&gt; .env.example .env   &lt;span class="c"&gt;# file where your passwords are stored&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The &lt;code&gt;.env&lt;/code&gt; file is hidden by default. In Finder, press Command + Shift + Period to show hidden files, or just edit it from the terminal. Update the credentials, for example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nv"&gt;POSTGRES_USER&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;admin
&lt;span class="nv"&gt;POSTGRES_PASSWORD&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;root
&lt;span class="nv"&gt;POSTGRES_DB&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;n8n
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Also replace the &lt;code&gt;N8N_ENCRYPTION_KEY&lt;/code&gt; and &lt;code&gt;N8N_USER_MANAGEMENT_JWT_SECRET&lt;/code&gt; values with your own random strings.&lt;/p&gt;

&lt;p&gt;Now one Mac-specific detail. Docker on Apple Silicon cannot use the Mac's GPU, so the kit's README recommends running Ollama natively on your Mac for speed and letting the containers connect to it [&lt;a href="https://github.com/n8n-io/self-hosted-ai-starter-kit" rel="noopener noreferrer"&gt;starter kit README&lt;/a&gt;]. That is what we'll do. Set this in your &lt;code&gt;.env&lt;/code&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nv"&gt;OLLAMA_HOST&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;host.docker.internal:11434
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Then start everything:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;docker compose up
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Open &lt;a href="http://localhost:5678" rel="noopener noreferrer"&gt;http://localhost:5678&lt;/a&gt; to create your n8n account (once), and &lt;a href="http://localhost:5678/home/workflows" rel="noopener noreferrer"&gt;http://localhost:5678/home/workflows&lt;/a&gt; is where your workflows and agents live.&lt;/p&gt;

&lt;p&gt;If you only want n8n without the rest of the kit, this single command works too [&lt;a href="https://docs.n8n.io/hosting/installation/docker/" rel="noopener noreferrer"&gt;n8n docs&lt;/a&gt;]:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;docker run &lt;span class="nt"&gt;-it&lt;/span&gt; &lt;span class="nt"&gt;--rm&lt;/span&gt; &lt;span class="nt"&gt;--name&lt;/span&gt; n8n &lt;span class="nt"&gt;-p&lt;/span&gt; 5678:5678 &lt;span class="nt"&gt;-v&lt;/span&gt; n8n_data:/home/node/.n8n docker.n8n.io/n8nio/n8n
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Quick setup: Ollama
&lt;/h2&gt;

&lt;p&gt;On the Mac side (from part two, condensed):&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;brew &lt;span class="nb"&gt;install &lt;/span&gt;ollama
ollama pull gemma4   &lt;span class="c"&gt;# download a model&lt;/span&gt;
ollama run gemma4    &lt;span class="c"&gt;# chat with it in the terminal&lt;/span&gt;
ollama list          &lt;span class="c"&gt;# see all downloaded models&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Ollama serves an API at &lt;a href="http://localhost:11434" rel="noopener noreferrer"&gt;http://localhost:11434&lt;/a&gt;, and that address is what n8n will call. Not sure this model fits your machine or your task? Part two covers how to check with the &lt;a href="https://huggingface.co/spaces/NyxKrage/LLM-Model-VRAM-Calculator" rel="noopener noreferrer"&gt;VRAM calculator&lt;/a&gt; and when a task belongs on a local model versus a cloud one.&lt;/p&gt;

&lt;h2&gt;
  
  
  Connecting Ollama to n8n
&lt;/h2&gt;

&lt;p&gt;Now the fun part. In n8n, Ollama appears as a model node you can plug into chats and agents.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 1: create the credential.&lt;/strong&gt; In n8n go to Credentials, create an "Ollama" credential, and set the base URL. Because n8n runs inside Docker and Ollama runs on your Mac, &lt;code&gt;localhost&lt;/code&gt; will not work from inside the container. Use this instead [&lt;a href="https://docs.n8n.io/integrations/builtin/cluster-nodes/sub-nodes/n8n-nodes-langchain.lmchatollama/common-issues/" rel="noopener noreferrer"&gt;n8n docs&lt;/a&gt;]:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;http://host.docker.internal:11434
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The starter kit already includes a "Local Ollama service" credential. Edit it and set the same base URL [&lt;a href="https://github.com/n8n-io/self-hosted-ai-starter-kit" rel="noopener noreferrer"&gt;starter kit README&lt;/a&gt;]. No API key is needed, your local Ollama has no authentication.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 2: use it in a chat.&lt;/strong&gt; Create a workflow, add a Chat Trigger node, then an AI Agent (or Basic LLM Chain) node. In its model slot pick "Ollama Chat Model", select your credential, and choose &lt;code&gt;gemma4&lt;/code&gt; from the model dropdown. Hit the Chat button at the bottom of the canvas and you are talking to your local model inside n8n [&lt;a href="https://docs.ollama.com/integrations/n8n" rel="noopener noreferrer"&gt;Ollama docs&lt;/a&gt;].&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 3: give the agent tools.&lt;/strong&gt; The AI Agent node accepts tool sub-nodes (HTTP Request, Gmail, a Qdrant vector store, another workflow). The model decides when to call them. This only works well if the model supports tool use, which &lt;code&gt;llama3.1&lt;/code&gt; does. Check the model's page on &lt;a href="https://ollama.com/search?c=tools" rel="noopener noreferrer"&gt;ollama.com&lt;/a&gt; for the "tools" tag before relying on it.&lt;/p&gt;

&lt;p&gt;If the connection refuses, the base URL is almost always the culprit. The rule: n8n in Docker and Ollama on the host means &lt;code&gt;host.docker.internal&lt;/code&gt;, both in the same compose network means the service name (&lt;code&gt;http://ollama:11434&lt;/code&gt;), n8n installed natively means plain &lt;code&gt;localhost&lt;/code&gt; [&lt;a href="https://docs.n8n.io/integrations/builtin/cluster-nodes/sub-nodes/n8n-nodes-langchain.lmchatollama/common-issues/" rel="noopener noreferrer"&gt;n8n docs&lt;/a&gt;].&lt;/p&gt;

&lt;h2&gt;
  
  
  What about the API keys page?
&lt;/h2&gt;

&lt;p&gt;You may have seen &lt;a href="https://ollama.com/settings/keys" rel="noopener noreferrer"&gt;https://ollama.com/settings/keys&lt;/a&gt; and wondered if you missed a step. You did not. Those keys are for Ollama's cloud, where ollama.com hosts large models and acts as a remote Ollama server [&lt;a href="https://docs.ollama.com/cloud" rel="noopener noreferrer"&gt;Ollama docs&lt;/a&gt;]. If you ever want to call a cloud model (for example when a task needs more power than your Mac has), you create a key there and add it to the n8n Ollama credential with the base URL &lt;code&gt;https://ollama.com&lt;/code&gt;. For everything local, no key, no account.&lt;/p&gt;

&lt;h2&gt;
  
  
  Wrapping up
&lt;/h2&gt;

&lt;p&gt;That is a complete private AI stack: n8n orchestrating, Ollama serving the model, and your data staying on your machine. Next I want to build a real workflow on top of this, a document assistant using the Qdrant vector store that came with the kit. See you there :).&lt;/p&gt;




&lt;p&gt;&lt;em&gt;Sources: &lt;a href="https://docs.docker.com/get-started/get-docker/" rel="noopener noreferrer"&gt;Docker: get Docker&lt;/a&gt;, &lt;a href="https://docs.n8n.io/hosting/starter-kits/ai-starter-kit/" rel="noopener noreferrer"&gt;n8n Self-hosted AI Starter Kit docs&lt;/a&gt;, &lt;a href="https://github.com/n8n-io/self-hosted-ai-starter-kit" rel="noopener noreferrer"&gt;starter kit README&lt;/a&gt;, &lt;a href="https://docs.n8n.io/hosting/installation/docker/" rel="noopener noreferrer"&gt;n8n Docker install&lt;/a&gt;, &lt;a href="https://docs.n8n.io/integrations/builtin/credentials/ollama/" rel="noopener noreferrer"&gt;n8n Ollama credentials&lt;/a&gt;, &lt;a href="https://docs.n8n.io/integrations/builtin/cluster-nodes/sub-nodes/n8n-nodes-langchain.lmchatollama/common-issues/" rel="noopener noreferrer"&gt;n8n Ollama common issues&lt;/a&gt;, &lt;a href="https://docs.ollama.com/integrations/n8n" rel="noopener noreferrer"&gt;Ollama n8n integration&lt;/a&gt;, &lt;a href="https://docs.ollama.com/cloud" rel="noopener noreferrer"&gt;Ollama cloud&lt;/a&gt;, &lt;a href="https://huggingface.co/spaces/NyxKrage/LLM-Model-VRAM-Calculator" rel="noopener noreferrer"&gt;LLM VRAM Calculator&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>ai</category>
      <category>automation</category>
      <category>docker</category>
      <category>llm</category>
    </item>
    <item>
      <title>1. Self-Hosted AI: the LLM concepts you need to run models effectively</title>
      <dc:creator>Lorena Dávila Ermus</dc:creator>
      <pubDate>Sat, 08 Aug 2026 03:02:43 +0000</pubDate>
      <link>https://dev.to/lorena_dvila_5ab5ef35ec6/2-self-hosted-ai-the-llm-concepts-you-need-to-run-models-effectively-1nl1</link>
      <guid>https://dev.to/lorena_dvila_5ab5ef35ec6/2-self-hosted-ai-the-llm-concepts-you-need-to-run-models-effectively-1nl1</guid>
      <description>&lt;p&gt;If you want to run AI models on your own machine and learn the basic concepts with me to do it effectively, then this is the right article :).&lt;/p&gt;

&lt;p&gt;This is part one of the series. In the next one we build local AI workflows with n8n and Ollama. This article is the vocabulary we need to pick a model, load it without crashing your machine, and know what each setting does.&lt;/p&gt;

&lt;h2&gt;
  
  
  The pieces
&lt;/h2&gt;

&lt;p&gt;Running a model locally involves a few separate things that people mix up all the time.&lt;/p&gt;

&lt;p&gt;The &lt;strong&gt;model&lt;/strong&gt; is a file on your disk. The &lt;strong&gt;server&lt;/strong&gt; (Ollama, LM Studio) loads that file and runs the math. The &lt;strong&gt;API&lt;/strong&gt; is a local address the server opens so other apps can reach it. The &lt;strong&gt;clients&lt;/strong&gt; are whatever you point at it: a chat window, your code editor, an n8n workflow. You never talk to the model directly, you always go through the server.&lt;/p&gt;

&lt;h2&gt;
  
  
  Model and inference
&lt;/h2&gt;

&lt;p&gt;The models we run are large language models (LLMs): machine learning models trained on massive text datasets to understand and generate language, built on a neural network type called a transformer[&lt;a href="https://www.cloudflare.com/learning/ai/what-is-large-language-model/" rel="noopener noreferrer"&gt;Cloudflare&lt;/a&gt;]. In practice a model is a file of learned numbers, called weights, and it works by predicting the next chunk of text over and over.&lt;/p&gt;

&lt;p&gt;Running a trained model to get answers is called inference, the step we do on our hardware, as opposed to training, which is how the model was built[&lt;a href="https://www.cloudflare.com/learning/ai/inference-vs-training/" rel="noopener noreferrer"&gt;Cloudflare&lt;/a&gt;]. Everything below is about making inference run well.&lt;/p&gt;

&lt;h2&gt;
  
  
  Server and API
&lt;/h2&gt;

&lt;p&gt;The server loads and runs the model, and it opens a local API. An API is a set of rules that lets two pieces of software communicate [&lt;a href="https://aws.amazon.com/what-is/api/" rel="noopener noreferrer"&gt;AWS&lt;/a&gt;]. Here it means an address on your own machine that apps send prompts to:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Ollama: &lt;code&gt;http://localhost:11434&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;LM Studio: &lt;code&gt;http://localhost:1234&lt;/code&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;code&gt;localhost&lt;/code&gt; means the request never leaves your computer. Both servers copy the OpenAI API format, so any tool built for ChatGPT's API can point at this address and work without changes. One running model can feed your editor, a chat app, and an n8n workflow at the same time.&lt;/p&gt;

&lt;h2&gt;
  
  
  GPU, VRAM, and RAM
&lt;/h2&gt;

&lt;p&gt;This trio decides whether a model runs fast, slow, or not at all.&lt;/p&gt;

&lt;p&gt;A GPU runs many calculations in parallel, which fits the matrix math LLMs depend on. VRAM is the fast memory built into the GPU, and the model's weights need to load into it, because the GPU reads them for every token it generates[&lt;a href="https://www.bentoml.com/blog/what-is-gpu-memory-and-why-it-matters-for-llm-inference" rel="noopener noreferrer"&gt;BentoML&lt;/a&gt;]. Whatever does not fit spills into system RAM and runs on the CPU, which works but is slower.&lt;/p&gt;

&lt;p&gt;On Apple Silicon Macs there is no separate VRAM. The CPU and GPU share one pool called unified memory, so your RAM is effectively your VRAM.&lt;/p&gt;

&lt;h2&gt;
  
  
  Parameters, and how to read a model name
&lt;/h2&gt;

&lt;p&gt;Parameters are the internal variables a model learns during training, and they store the patterns it uses to make predictions[&lt;a href="https://www.ibm.com/think/topics/llm-parameters" rel="noopener noreferrer"&gt;IBM&lt;/a&gt;]. More parameters generally means more capable, heavier, and slower. The count is written with a "B" for billions.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Size&lt;/th&gt;
&lt;th&gt;Runs on&lt;/th&gt;
&lt;th&gt;Good for&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;1 to 3B&lt;/td&gt;
&lt;td&gt;Any laptop&lt;/td&gt;
&lt;td&gt;Quick tasks, autocomplete&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;7 to 9B&lt;/td&gt;
&lt;td&gt;8 to 16 GB laptop&lt;/td&gt;
&lt;td&gt;A strong default for general use&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;13 to 32B&lt;/td&gt;
&lt;td&gt;16 to 24 GB GPU or Mac&lt;/td&gt;
&lt;td&gt;Stronger coding and reasoning&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;70B and up&lt;/td&gt;
&lt;td&gt;Workstation&lt;/td&gt;
&lt;td&gt;Top quality, heavy hardware&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Model names encode this. In &lt;code&gt;llama3.1:8b&lt;/code&gt;, the part before the colon is the family and version (Llama 3.1), and the tag after it is the variant, usually the size. Tags can also carry the quantization or the purpose, like &lt;code&gt;qwen2.5-coder:7b&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;One more naming detail worth knowing: a &lt;strong&gt;base&lt;/strong&gt; model is the raw next-word predictor straight out of training, while an &lt;strong&gt;instruct&lt;/strong&gt; model was further tuned to follow instructions and hold conversations. For chat and workflows you always want the instruct version. Ollama's library serves instruct variants by default, but on Hugging Face you will see both, so check the name.&lt;/p&gt;

&lt;h2&gt;
  
  
  Quantization and formats
&lt;/h2&gt;

&lt;p&gt;Quantization converts a value from a high precision format to one that takes less space and is slightly less precise, so the model runs faster and on cheaper hardware while ideally giving up very little accuracy[&lt;a href="https://www.cloudflare.com/learning/ai/what-is-quantization/" rel="noopener noreferrer"&gt;Cloudflare&lt;/a&gt;]. For us it means the same model ships in smaller versions that need much less memory.&lt;/p&gt;

&lt;p&gt;Labels like &lt;code&gt;Q4_K_M&lt;/code&gt; or &lt;code&gt;Q8_0&lt;/code&gt; tell you how many bits each weight keeps. Fewer bits, smaller and faster file, slightly less accurate.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Quant&lt;/th&gt;
&lt;th&gt;Size vs full&lt;/th&gt;
&lt;th&gt;Quality&lt;/th&gt;
&lt;th&gt;Notes&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Q8_0&lt;/td&gt;
&lt;td&gt;~50%&lt;/td&gt;
&lt;td&gt;~99%&lt;/td&gt;
&lt;td&gt;High quality, still heavy&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Q5_K_M&lt;/td&gt;
&lt;td&gt;~35%&lt;/td&gt;
&lt;td&gt;~98%&lt;/td&gt;
&lt;td&gt;Good balance&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Q4_K_M&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;~29%&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;~96%&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;What I pick when unsure&lt;/strong&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Q3_K_M&lt;/td&gt;
&lt;td&gt;~22%&lt;/td&gt;
&lt;td&gt;~90%&lt;/td&gt;
&lt;td&gt;Only if memory is very tight&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Two file formats cover most of what you will meet. &lt;strong&gt;GGUF&lt;/strong&gt; packs a quantized model into a single file and is the native format of llama.cpp, the engine under Ollama and LM Studio. Ollama stores and runs its models as GGUF, and you can import any GGUF from Hugging Face with a one-line Modelfile[&lt;a href="https://docs.ollama.com/import" rel="noopener noreferrer"&gt;Ollama docs&lt;/a&gt;, &lt;a href="https://huggingface.co/docs/hub/ollama" rel="noopener noreferrer"&gt;Hugging Face&lt;/a&gt;]. &lt;strong&gt;Safetensors&lt;/strong&gt; is the format Hugging Face uses for full precision weights, which you will mostly meet when a model has not been quantized yet.&lt;/p&gt;

&lt;h2&gt;
  
  
  Tokens
&lt;/h2&gt;

&lt;p&gt;A token is the smallest unit of text a model processes, usually a word, part of a word, or punctuation[&lt;a href="https://blogs.nvidia.com/blog/ai-tokens-explained/" rel="noopener noreferrer"&gt;NVIDIA&lt;/a&gt;]. The model reads input as tokens and produces output one token at a time.&lt;/p&gt;

&lt;p&gt;A useful rule: one token is about four characters, or three quarters of a word. Tokens are the unit behind two numbers you will see constantly: speed in tokens per second (a 7 to 8B model does about 30 to 50 on a typical laptop GPU), and the context limit below.&lt;/p&gt;

&lt;h2&gt;
  
  
  Context window
&lt;/h2&gt;

&lt;p&gt;The context window is the amount of text, in tokens, the model can consider at once, its working memory[&lt;a href="https://www.ibm.com/think/topics/context-window" rel="noopener noreferrer"&gt;IBM&lt;/a&gt;]. It holds everything simultaneously: the system prompt, the conversation, pasted files, and the room left for the reply.&lt;/p&gt;

&lt;p&gt;When it fills up, the oldest tokens drop out and the model forgets the start of a long chat. And a bigger window costs more memory, since the model keeps a growing cache of the conversation. I keep it at 8K for chat and coding, and raise it only when feeding long documents.&lt;/p&gt;

&lt;h2&gt;
  
  
  Temperature
&lt;/h2&gt;

&lt;p&gt;Temperature controls the randomness of generated text[&lt;a href="https://www.ibm.com/think/topics/llm-temperature" rel="noopener noreferrer"&gt;IBM&lt;/a&gt;]. Lower values push the model toward the most likely next token, higher values spread the choice wider.&lt;/p&gt;

&lt;p&gt;In practice: 0.1 to 0.3 for code and facts, around 0.7 for chat, above 1.0 for creative variety at the cost of focus. If code answers feel vague, lower it. If writing feels flat, raise it.&lt;/p&gt;

&lt;h2&gt;
  
  
  GPU offload
&lt;/h2&gt;

&lt;p&gt;GPU offload is how many of the model's layers sit on the GPU versus the CPU. All layers on the GPU is fastest and happens automatically when the model fits in VRAM. When it does not fit, the leftover layers run on the CPU and everything slows down.&lt;/p&gt;

&lt;p&gt;Ollama decides this for you, and &lt;code&gt;ollama ps&lt;/code&gt; shows the resulting GPU/CPU split. LM Studio exposes a slider (&lt;code&gt;n_gpu_layers&lt;/code&gt;) to set it by hand. Short version: fit it all in VRAM and it is fast, spill over and it crawls.&lt;/p&gt;

&lt;h2&gt;
  
  
  Will it fit? Use a calculator
&lt;/h2&gt;

&lt;p&gt;Your real memory use is more than the model file:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Total ≈ weights + context + a bit of overhead&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;As a reference, an 8B model at Q4 takes about 4.6 GB of weights, context adds roughly 0.1 GB per 1,000 tokens, and overhead is 0.5 to 1 GB. Instead of doing this math per model, use the &lt;a href="https://huggingface.co/spaces/NyxKrage/LLM-Model-VRAM-Calculator" rel="noopener noreferrer"&gt;LLM Model VRAM Calculator&lt;/a&gt;: give it a model, a quant, and a context size, and it tells you whether your hardware can take it. When the total goes over your memory, the fix is a smaller quant, a smaller model, or a smaller context.&lt;/p&gt;

&lt;h2&gt;
  
  
  Capabilities: what a model can and cannot do
&lt;/h2&gt;

&lt;p&gt;Abilities are fixed during training, so check the model's page before relying on one. The tags on &lt;a href="https://ollama.com/search" rel="noopener noreferrer"&gt;ollama.com&lt;/a&gt; mark them.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Chat / text generation&lt;/strong&gt;: the baseline. Every instruct model does this.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Vision&lt;/strong&gt;: accepts images as input, so it can read screenshots, photos, and scanned PDFs. Needed for anything visual; a text-only model simply cannot see the file.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Tool use (function calling)&lt;/strong&gt;: the model can decide to call a function or API you describe to it, and return the arguments for the call. This is what makes agents possible, including n8n AI Agent workflows.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Reasoning&lt;/strong&gt;: the model works through a problem step by step before answering. Better at math, logic, and planning, but slower and more verbose.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Structured output&lt;/strong&gt;: the model is forced to answer in a strict format like JSON. Essential for automation, where the next node expects clean data instead of prose.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Code completion (fill-in-the-middle)&lt;/strong&gt;: completing code at the cursor given what is before and after it. This is what autocomplete models do, and it is a different job from explaining code in a chat.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Embeddings&lt;/strong&gt;: a separate model type. An embedding is a numeric vector representing text, which lets you measure similarity and search by meaning[&lt;a href="https://www.cloudflare.com/learning/ai/what-are-embeddings/" rel="noopener noreferrer"&gt;Cloudflare&lt;/a&gt;]. This powers RAG, the technique behind chatting with your own documents.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;A coding model usually cannot see images, and a vision model may be weak at tool use. Match the model to the task.&lt;/p&gt;

&lt;h2&gt;
  
  
  Knowledge cutoff and hallucination
&lt;/h2&gt;

&lt;p&gt;Two limits to keep in mind with any model, local or not.&lt;/p&gt;

&lt;p&gt;A model's knowledge freezes at its training cutoff date. Ask a local model about something from last month and it either does not know or, worse, guesses. Which leads to the second limit: models sometimes state wrong things fluently and confidently, called hallucination. It happens because the model predicts plausible text rather than checking facts. Lower temperature and giving the model the relevant documents (RAG) reduce it, but nothing removes it. Treat any factual claim from a model as a draft to verify.&lt;/p&gt;

&lt;h2&gt;
  
  
  Local or cloud?
&lt;/h2&gt;

&lt;p&gt;Not every task belongs on a local model. Local wins on privacy and cost, since your data never leaves the machine and tokens are free after download, while cloud models pull ahead on raw capability, huge contexts, and fresh information via web search[&lt;a href="https://webscraft.org/blog/ollama-vs-chatgpt-vs-claude-yaka-zadacha-vimagaye-hmari?lang=en" rel="noopener noreferrer"&gt;WebCraft&lt;/a&gt;]. My checklist:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Question&lt;/th&gt;
&lt;th&gt;Points to local&lt;/th&gt;
&lt;th&gt;Points to cloud&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Privacy, NDA, client data?&lt;/td&gt;
&lt;td&gt;Yes, nothing leaves your machine&lt;/td&gt;
&lt;td&gt;Only if provider terms allow it&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Context per request?&lt;/td&gt;
&lt;td&gt;Small to medium fits fine&lt;/td&gt;
&lt;td&gt;Very large documents&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Need info updated in 2026?&lt;/td&gt;
&lt;td&gt;No, cutoffs apply&lt;/td&gt;
&lt;td&gt;Yes, cloud adds web search&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Hardware?&lt;/td&gt;
&lt;td&gt;You have the memory for it&lt;/td&gt;
&lt;td&gt;You do not&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Cost at scale?&lt;/td&gt;
&lt;td&gt;Free after download&lt;/td&gt;
&lt;td&gt;Pay per token&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;h2&gt;
  
  
  Quick glossary
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;System prompt&lt;/strong&gt;: hidden instructions that set the model's behavior for the whole conversation.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Modelfile (Ollama) / Preset (LM Studio)&lt;/strong&gt;: a saved bundle of settings so you do not redo them.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;MoE (Mixture of Experts)&lt;/strong&gt;: a model that activates only part of itself per token, large but faster than its size suggests.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;RAG (retrieval augmented generation)&lt;/strong&gt;: fetching relevant documents (via embeddings) and giving them to the model with the question.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;top_p and repeat penalty&lt;/strong&gt;: finer randomness knobs, fine at their defaults.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  You are ready
&lt;/h2&gt;

&lt;p&gt;With PostgreSQL from part one and these concepts, you can set up a local model right now. On a Mac:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;brew &lt;span class="nb"&gt;install &lt;/span&gt;ollama
ollama pull gemma4   &lt;span class="c"&gt;# download a model&lt;/span&gt;
ollama run gemma4    &lt;span class="c"&gt;# chat with it in the terminal&lt;/span&gt;
ollama list          &lt;span class="c"&gt;# see all downloaded models&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;That model now sits behind &lt;code&gt;http://localhost:11434&lt;/code&gt;, waiting for clients. In the next article we connect it to n8n and build AI workflows on top. See you there :).&lt;/p&gt;




&lt;p&gt;&lt;em&gt;Sources: &lt;a href="https://www.cloudflare.com/learning/ai/what-is-large-language-model/" rel="noopener noreferrer"&gt;Cloudflare: LLMs&lt;/a&gt;, &lt;a href="https://www.cloudflare.com/learning/ai/inference-vs-training/" rel="noopener noreferrer"&gt;Cloudflare: inference vs training&lt;/a&gt;, &lt;a href="https://www.cloudflare.com/learning/ai/what-is-quantization/" rel="noopener noreferrer"&gt;Cloudflare: quantization&lt;/a&gt;, &lt;a href="https://www.cloudflare.com/learning/ai/what-are-embeddings/" rel="noopener noreferrer"&gt;Cloudflare: embeddings&lt;/a&gt;, &lt;a href="https://aws.amazon.com/what-is/api/" rel="noopener noreferrer"&gt;AWS: what is an API&lt;/a&gt;, &lt;a href="https://www.ibm.com/think/topics/llm-parameters" rel="noopener noreferrer"&gt;IBM: parameters&lt;/a&gt;, &lt;a href="https://www.ibm.com/think/topics/llm-temperature" rel="noopener noreferrer"&gt;IBM: temperature&lt;/a&gt;, &lt;a href="https://www.ibm.com/think/topics/context-window" rel="noopener noreferrer"&gt;IBM: context window&lt;/a&gt;, &lt;a href="https://blogs.nvidia.com/blog/ai-tokens-explained/" rel="noopener noreferrer"&gt;NVIDIA: tokens&lt;/a&gt;, &lt;a href="https://www.bentoml.com/blog/what-is-gpu-memory-and-why-it-matters-for-llm-inference" rel="noopener noreferrer"&gt;BentoML: GPU memory&lt;/a&gt;, &lt;a href="https://docs.ollama.com/import" rel="noopener noreferrer"&gt;Ollama: importing GGUF&lt;/a&gt;, &lt;a href="https://huggingface.co/docs/hub/ollama" rel="noopener noreferrer"&gt;Hugging Face: Ollama and GGUF&lt;/a&gt;, &lt;a href="https://huggingface.co/spaces/NyxKrage/LLM-Model-VRAM-Calculator" rel="noopener noreferrer"&gt;LLM VRAM Calculator&lt;/a&gt;, &lt;a href="https://webscraft.org/blog/ollama-vs-chatgpt-vs-claude-yaka-zadacha-vimagaye-hmari?lang=en" rel="noopener noreferrer"&gt;WebCraft: Ollama vs ChatGPT vs Claude&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>ai</category>
      <category>llm</category>
    </item>
    <item>
      <title>Quick Guide to Setting Up PostgreSQL on Mac via CLI with Homebrew</title>
      <dc:creator>Lorena Dávila Ermus</dc:creator>
      <pubDate>Thu, 14 May 2026 21:34:45 +0000</pubDate>
      <link>https://dev.to/lorena_dvila_5ab5ef35ec6/1-quick-guide-to-setting-up-postgresql-on-mac-via-cli-with-homebrew-3548</link>
      <guid>https://dev.to/lorena_dvila_5ab5ef35ec6/1-quick-guide-to-setting-up-postgresql-on-mac-via-cli-with-homebrew-3548</guid>
      <description>&lt;p&gt;Hey, I'm excited to do a series of short articles to set up Free AI tools such as n8n and Ollama on your local machine, or to setup the environment for your personal projects.&lt;/p&gt;

&lt;p&gt;One of the first issues you may encounter is that you may not have postgres running on local.&lt;/p&gt;

&lt;p&gt;To solve that with the minimal setup follow these exact steps.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 1: Install and Start the Service&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Open your Mac Terminal and run these commands to install Postgres and keep it running in the background&lt;/p&gt;

&lt;p&gt;&lt;code&gt;brew install postgresql    # Installs the latest version&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;code&gt;brew services start postgresql    # Keeps it running in the background&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;(Optional) You can check if it is running or stop it later using these commands:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;brew services list&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;code&gt;brew services stop postgresql&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 2: Connect for the First Time&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Homebrew automatically creates a default superuser matching your Mac username with a blank password. You do not need a password yet. &lt;em&gt;Connect directly to the default &lt;code&gt;postgres&lt;/code&gt; template database&lt;/em&gt; by running:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;psql -U $(whoami) -d postgres&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Your terminal prompt will change to &lt;code&gt;postgres=#&lt;/code&gt;. You are now inside the database engine.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 3: Useful Navigation Shortcuts&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Inside the Postgres prompt, use these quick slash commands to inspect your setup:&lt;br&gt;
&lt;code&gt;\du&lt;/code&gt; -&amp;gt; View all database users.&lt;br&gt;
&lt;code&gt;\l&lt;/code&gt; -&amp;gt; View all existing databases (including the default postgres).&lt;br&gt;
&lt;code&gt;\q&lt;/code&gt; -&amp;gt; Exit Postgres and return to your regular terminal.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 4: Create Your Project Database and User&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;It is best practice not to use your superuser account for applications. Instead, run these SQL commands inside the prompt to set up a clean environment. Remember the semicolons at the end of each line:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;CREATE USER my_project_user WITH PASSWORD 'my_secure_password';&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;code&gt;CREATE DATABASE my_project_db;&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;code&gt;GRANT ALL PRIVILEGES ON DATABASE my_project_db TO my_project_user;&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Note: If you are on Postgres 15 or higher, you might also need to grant schema permissions after connecting to the new DB:&lt;br&gt;
GRANT ALL ON SCHEMA public TO my_project_user;&lt;/p&gt;

&lt;p&gt;That’s it! Type &lt;code&gt;\q&lt;/code&gt; to exit. You can now connect your application to localhost using your new database, username, and password.&lt;/p&gt;

</description>
      <category>cli</category>
      <category>database</category>
      <category>postgres</category>
      <category>tutorial</category>
    </item>
  </channel>
</rss>
