π§ Module 2: Using AI Models in n8n
This module teaches how to use major AI models inside your n8n workflows. You'll learn how to install or register each one, get your API key, and connect them into your automation.
This module teaches how to use major AI models inside your n8n workflows. You'll learn how to install or register each one, get your API key, and connect them into your automation.
Ollama lets you run open-source AI models on your local computer β no internet or API key needed.
Steps:
Go to https://ollama.com
Download & install for Windows/macOS/Linux
Open Ollama App > Pull Model
In n8n, use Ollama node > add credentials
Base URL: http://localhost:11434
Select model to use
Steps:
Check if Docker Compose is installed by typing to your terminal
If version appears, you can continue, if not please proceed on installing your docker.
Β Click Here for the tutorial on how to install docker.
Download this YAML file: https://buymeacoffee.com/lakwatseros/e/441097
Paste in your project folder and run the terminal inside the project folder
Then run the command:
Open the docker desktop and look for the Ollama container inside the stack
Click Ollama > Exec then install your preferred Ollama Model with the sample command below:
β Pros:
Free, no API limits
Works offline
Fast responses
β οΈ Cons:
Needs 8GB+ RAM
Setup varies per OS
Used for: Chat, summarizing, coding, image generation (gpt-4o, dall-e)
Steps to get API key:
Register
Log in β Click the settings icon (top-right) β API Keys
Click Create new secret key β Copy it
How to add credits:
Go to Billing page
Add credit or debit card
Add at least 5USD credits
Verify account to us the Image API:
Got to Settings page then click verify
Use in n8n:
Use the OpenAI Node > Add Credentials
Just paste your API key
Select model to use
Used for: Text, code, and image generation by Google
Steps to get API key:
Click Get API Key (top-right)
Click Create API Key > Create API key in new project (if you do not have one yet) > copy the API key
Funding / Quotas:
Gemini API has Free Tier
Usage limits apply β View at https://ai.google.dev/gemini-api/docs/rate-limits
Use in n8n:
Use Gemini Node > Add Credentials
Just paste your API key
Select model to use