Sunday, 10 August 2025

Run AI Agents Locally with Ollama + n8n on Docker (Step-by-Step)

πŸš€ Want to run powerful AI right on your own computer — no cloud, no API keys, no extra costs?

Here’s how you can do it with Ollama, n8n, and Docker — all fully local!


πŸ’‘ Why this combo rocks
Ollama → run and manage open-source GPT-OSS models locally
n8n → automate AI workflows inside Docker
Docker → keeps everything clean, isolated, and persistent

⚡ Quick Setup Steps
1️⃣ Install Docker Desktop
Create a Docker volume for n8n data:
`docker volume create n8n_data`
Run n8n:
docker run -it --rm --name n8n -p 5678:5678 -v n8n_data:/home/node/.n8n n8nio/n8n
Open πŸ‘‰ http://localhost:5678 to start building workflows.

2️⃣ Install Ollama
Download from πŸ‘‰ https://ollama.com/search
Simple installer for managing local AI models.

3️⃣ Download LLMs & Run (Example: GPT-OSS)
In terminal, run:
ollama run gpt-oss:latest
Common commands:
ollama ps
ollama run <model>
ollama stop <model>
Local endpoint: πŸ‘‰ http://localhost:11434

Test the model fully offline — no internet needed.
4️⃣ Start Ollama Server & Connect to n8n
Run: ollama serve
In n8n, create an Ollama Chat Model credential with base URL:
πŸ‘‰ http://host.docker.internal:11434
πŸ’‘ Note: Inside Docker, localhost refers to the container, not your machine. Use http://host.docker.internal to connect Ollama to n8n.

✅ Why this matters
Full privacy → all data stays local
No cloud costs → GPT-OSS is free to run
Automation power → build workflows with n8n
Simple AI model management → thanks to Ollama

Monday, 28 July 2025

Best Local LLMs - Ollama

Best Local LLMs for n8n, Koog, and LangChain Workflows (via Ollama):

As a developer building local AI workflows, choosing the right LLM makes all the difference—especially when balancing performance, memory, and use case fit. 

Here are some top models that run smoothly on local hardware and integrate well with tools like n8n, LangChain, or Koog.

🧠 1. Mistral (7B)
Why: Solid balance of speed and reasoning capabilities.
Use Cases: General-purpose workflows, chatbots, moderate complexity logic.
RAM: 12–16 GB
Integration: Works great with LangChain prompts or n8n HTTP nodes.
Local Storage: 4.4 GB


⚡2. Phi-3 Medium (7B)
Why: Extremely fast and lightweight; great for tight memory environments.
Use Cases: Intent classification, fast user input handling, micro-services.
RAM: 8 GB
Integration: Ideal for high-frequency calls in low-latency automation.
Local Storage: 3.0 GB (mini), 7.0 GB (medium)

πŸš€3. Command-R+ (7B)
Why: Purpose-built for RAG (Retrieval-Augmented Generation).
Use Cases: Document Q&A, vector DB queries, contextual chat.
RAM: 16–20 GB
Integration: Perfect if your LangChain/Koog stack pulls context before generation.
Local Storage: 17 GB

🧠 4. GPT-OSS:20B

Why: High-quality open-weight model with chain-of-thought and tool usage support.
Use Cases: Advanced automation, agent-style pipelines, deep logic chains.
RAM: 16–18 GB (slower but more capable)
Integration: Ideal for mission-critical or complex decision-making workflows.
Local Storage: 13 GB

πŸ’‘These models are all available via Ollama, making local LLM workflows fast, private, and scalable. Whether you're automating business logic or prototyping AI agents, there's a model here that fits your stack and hardware.
hashtag