Skip to content

How-ToGPU

How to Use Langflow With Ollama to Build Local AI Agents on Your PC

Langflow lets you build AI agents and workflows by wiring components together on a canvas. We show how to install it, connect it to a local Ollama model, build a simple agent with tools, call the flow from your own scripts and fix common problems.

By , Systems & Technical Editor

6 min read

How to Use Langflow With Ollama to Build Local AI Agents on Your PC

Langflow is a free, open-source app for building AI agents and workflows by dragging components onto a canvas and wiring them together, rather than writing everything in code. Its quick start assumes a cloud model, but it has built-in Ollama support, so the language model can run on your own graphics card and your prompts don't have to leave your PC. This guide covers installing Langflow, connecting it to Ollama, building a simple agent with tools, and calling the finished flow from your own scripts. 13.x (the latest release on GitHub is v1.13.5, published on 1 December 2026).

What you need

  • Ollama, installed and running, with at least one model downloaded. If you're new to it, our guide to setting Ollama environment variables on Windows explains where its settings live.

  • A model that fits your graphics card. Langflow itself is light: for the Python package, the docs list a dual-core CPU and 2GB of RAM as the minimum, and a multi-core CPU with at least 4GB as recommended. The model is what needs memory. Langflow's Ollama page warns that large models need significant system memory, and that an error such as "model requires more system memory than is available" means you should pick a smaller model. Our picks of the best local LLMs for 12GB of VRAM and for 16GB are a good starting point.

  • A model that supports tool calling if you want an agent that uses tools. Ollama's documentation describes tool calling (also called function calling) as letting a model invoke tools and use their results in its replies; its examples use Qwen 3.

Step 1: Install Langflow

Langflow's docs offer three main ways in:

  1. Langflow Desktop (the recommended option). A standalone app for Windows and macOS that manages dependencies and upgrades for you. On the Langflow Desktop page, click Download Langflow, enter your contact details, and run the downloaded .msi file on Windows. The docs note that Windows installs need a C++ compiler; if you see a "C++ Build Tools Required!" error, follow the prompt to install Microsoft C++ Build Tools (or install Visual Studio). Desktop lacks a couple of features, such as the Shareable Playground and Voice Mode.

  2. The Python package. This needs Python 3.10 to 3.14 and the uv package manager (see our guide to using uv for local AI). Create and activate a virtual environment with uv venv, then run uv pip install langflow. As of Langflow 1.13, release packages turn off automatic login, so create a .env file containing LANGFLOW_AUTO_LOGIN=false and LANGFLOW_SUPERUSER_PASSWORD= followed by a strong password, then start it with uv run langflow run --env-file .env. The docs warn that it can take a few minutes to start.

  3. Docker. Run the langflowai/langflow:latest image with port 7860 mapped and the same two variables set.

For the Python and Docker installs, open http://127.0.0.1:7860 (or http://localhost:7860) in a browser and sign in with the username langflow and the password you set. If you need a different port, the LANGFLOW_PORT variable or --port option changes it.

Step 2: Connect Langflow to Ollama

There are two ways to use an Ollama model, and both point Langflow at Ollama's default address, http://127.0.0.1:11434:

  • Globally. Click your profile icon, choose Settings, then Model Providers, and select Ollama. The quick start says this provider can connect to any model hosted on a local or remote Ollama instance. Enable the models you want; text models appear under Language Models and embedding models under Embedding Models. Once enabled, a model can be picked in any model-driven component.

  • Per flow, with the Ollama component. Add the Ollama component, enter the Base URL, click Refresh to load the list of models from the server, and choose one in the Model Name field (the docs use llama3.2:latest as the example). Temperature and maximum tokens are in the component's inspection panel.

The Ollama component has two outputs. Model Response returns the generated message, which suits a simple prompt-in, text-out flow. Language Model hands the model itself to another component, such as an Agent, so that component uses your local model as its brain. Ollama bundle components come with a standard uv pip install langflow install; basic Ollama support is part of the core Language Model component in every installation.

If Ollama runs on a different PC on your network, Ollama's FAQ explains that it only listens on 127.0.0.1 port 11434 by default. Set OLLAMA_HOST to 0.0.0.0:11434 on that machine, then use its network address as the Base URL in Langflow.

Step 3: Build a local agent

The quickest way to see Langflow working is its Simple Agent template:

  1. Click New Flow and choose Simple Agent. It connects an Agent component to Chat Input and Chat Output, with a URL component as a tool. A Calculator tool is built into the Agent and switched on by default.

  2. In the Agent component, select your Ollama model from the Language Model drop-down, or connect the Language Model output of an Ollama component to the Agent's Language Model port.

  3. Click Playground and ask a maths question such as "I want to add 4 and 4". The Playground shows the agent's reasoning and which tool it chose, which is useful for checking that your local model is calling tools rather than guessing.

To give the agent more abilities, turn on Tool Mode in a component's header menu. That adds a Toolset port, which you connect to the Agent's Tools port. Langflow's agent guide uses Web Search and URL components this way, and suggests asking "What tools are you using to answer my questions?" to confirm the agent sees them. The tool's description is what the agent uses to decide whether it fits a request, so clear descriptions matter. Bear in mind that web tools fetch pages from the internet, so a flow that uses them isn't fully offline even if the model is.

For embeddings, the Ollama Embeddings component works the same way (the docs use all-minilm:latest as the example model) and can feed a vector store for document search. Note that Langflow's RAG tutorial says the Chroma components seen in older screenshots are retired in Langflow 1.13, so older guides may not match what you see.

Step 4: Call your flow from scripts and apps

Langflow is also a server. Every flow can be run through the /api/v1/run/FLOW_ID endpoint. Create a Langflow API key under your user icon > Settings > Langflow API Keys, then open a flow, click Share, then API access, for ready-made Python, JavaScript and curl snippets with your server address and flow ID filled in. Requests send the key in an x-api-key header, with input_value holding the message. That lets a home script, a Discord bot or a small web app reuse a flow you designed visually, all running on your own hardware. If you'd rather write the whole app yourself, our Gradio and Ollama chat app guide takes that route.

Langflow can also expose a project's flows as tools over the Model Context Protocol, which we cover in how to use Langflow as an MCP server.

Troubleshooting

  • No models in the list: check that Ollama is running, that the Base URL is right, and click Refresh. If Langflow runs in Docker and Ollama doesn't, 127.0.0.1 inside the container isn't your PC, so use an address the container can reach.

  • Out-of-memory error when the flow runs: choose a smaller model, as Langflow's docs suggest, or run Ollama on a PC with more memory.

  • The agent ignores its tools: use a model that supports tool calling in Ollama, and give each tool a clear name and description.

  • Can't sign in after upgrading: Langflow 1.13 turned off auto-login by default. The docs warn not to delete or reinstall Langflow to regain access, because that can permanently remove your flows; follow the Recover access steps in the installation guide instead.

How it compares

Langflow sits alongside other visual and agent tools covered on Forge PC. n8n with Ollama is more of a general automation tool, while our best local AI agent apps round-up covers ready-made agents. If you were weighing Flowise, read our Flowise vs Langflow comparison first: Flowise's developers archived the project in August 2026.

The bottom line

To build local AI agents in Langflow, install Langflow Desktop (or the Python package with uv), start Ollama, and either enable Ollama under Settings > Model Providers or add the Ollama component with the base URL http://127.0.0.1:11434. Then load the Simple Agent template, pick your local model and test it in the Playground. Choose a model that fits your VRAM and supports tool calling, and use the API access snippets to call your flow from your own scripts.

Sources

  1. 01Langflow documentation, Install Langflow
  2. 02Langflow documentation, Quickstart
  3. 03Langflow documentation, Ollama bundle
  4. 04Langflow documentation, Use Langflow agents
  5. 05Langflow documentation, Create a vector RAG chatbot
  6. 06Langflow documentation, Environment variables
  7. 07Langflow v1.13.5 release on GitHub
  8. 08Ollama documentation, FAQ
  9. 09Ollama documentation, Tool calling

About the author

Marcus Thorne

Systems & Technical Editor

Marcus writes Forge PC's step-by-step build, troubleshooting and system optimisation guides. His background spans Windows kernel and power-state diagnostics, UEFI/BIOS configuration, NVMe storage arrays, ATX 3.1 power delivery and running local AI and LLM workloads on consumer graphics cards.

More from Marcus Thorne

Read next

How to Use Langflow as an MCP Server for Local AI Tools

How-To

How to Use Langflow as an MCP Server for Local AI Tools

Langflow can turn the flows in a project into MCP tools that apps such as LM Studio and Cursor can call. We cover choosing which flows to expose, naming them so agents pick the right one, connecting a client with an API key, and setting timeouts.

Marcus Thorne5 min

How to Update Your Wi-Fi Driver in Windows 11

How-To

How to Update Your Wi-Fi Driver in Windows 11

Updating your Wi-Fi driver can fix dropouts and missing 6GHz or Wi-Fi 7 features. Using Microsoft's and Intel's own pages, we show how to find your adapter, use Windows Update, install Intel's latest Wi-Fi package, find drivers for older or non-Intel cards, and roll back a driver that makes things worse.

Marcus Thorne5 min

GSmartControl vs GNOME Disks: Which Linux Drive-Health Tool Should You Use?

Versus

GSmartControl vs GNOME Disks: Which Linux Drive-Health Tool Should You Use?

GSmartControl and GNOME Disks are the two free graphical ways to check drive health on Linux, but they're built for different jobs. Using the developers' own pages and GNOME's help, we compare SMART detail, self-tests, benchmarking, partitioning, NVMe notes, platforms and which one to reach for when a drive looks unwell.

Callum Reid4 min