Langflow or LangChain: a visual builder versus code
Langflow builds an app on a canvas, LangChain is written in code. Who each approach suits, and how to connect the gateway in both.
6 min · · сравнение · автоматизация
Langflow vs LangChain: this question comes up often from people choosing how to build a model-driven app, a chatbot or RAG, who aren't sure whether to write code. In short, they aren't direct competitors. LangChain is a library you write a program with. Langflow is an application with a visual editor where the same logic is assembled from blocks on a canvas. Below we compare the approaches, show how to connect a model through the Zukko gateway in each, and look at neighboring tools.
What they are
LangChain is a set of libraries for Python and JavaScript. You import model classes, describe chains and agents, and run it like ordinary code. Everything lives in the repository and goes through review and tests.
Langflow, as its documentation describes it, is an open-source, customizable Python framework for building AI applications. The main interface is a visual editor: you drag components (model, prompt, chat input, document search, agent) and connect them with lines. A finished flow can be run from the editor and called through an API. Langflow also has a set of components based on LangChain, so the tools are related but not interchangeable.
Langflow vs LangChain: comparison by criteria
| Criterion | Langflow | LangChain (code) |
|---|---|---|
| Entry barrier | Low: you can build a prototype without code | You need to program |
| Prototype speed | High, every block is visible | Depends on experience |
| Versioning and review | A flow is stored as configuration, review is harder | Normal git and code review |
| Tests | Manual runs in the editor or via the API | Familiar unit and integration tests |
| Unusual custom logic | Via your own Python components | Full freedom |
| Deployment | You need to run the Langflow server itself | Part of your application |
| Who can edit | Analyst, product person, engineer | Developer |
The table doesn't say one approach is better. It shows what costs come with each choice.
When each fits
Choose Langflow when you need a quick prototype, when people without development experience work on the flow, or when you need to show the scheme to colleagues or a client: lines on a canvas read better than a 300-line module. It is also good for learning, since you can see how data moves from input to model.
Choose LangChain when the logic is embedded in a large application, and you need unit tests, strict version control, unusual branching and your CI. If the flow must be part of a microservice rather than a separate server, code is simpler.
Projects often take a combined path: a prototype is built in the visual editor, then rewritten as code once the logic settles. Decide based on your team, not fashion.
Connecting the gateway in Langflow
For a local run, the Langflow documentation gives the command uv run langflow run; by default the editor opens at http://127.0.0.1:7860. There are also Langflow Desktop and a Docker image. Python installation: uv pip install langflow.
In the version 1.12 documentation, third-party OpenAI-compatible servers are supported through the OpenAI Compatible provider. Step by step:
- Click the profile icon, open Settings, then Model Providers.
- Choose the OpenAI Compatible provider.
- In the Base URL field enter
https://api.zukko.pro/v1. - In the API Key field paste your
fetch_...key from the dashboard. - Click Save.
The same values can be passed through environment variables: OPENAI_COMPATIBLE_BASE_URL and OPENAI_COMPATIBLE_API_KEY. After saving, Langflow checks the connection and discovers models through the /v1/models endpoint, which Zukko serves at GET https://api.zukko.pro/v1/models. Discovered models appear in the language model list; enable the ones you need, then select them in the Language Model or Agent components by choosing the OpenAI Compatible provider.
Menu item names may differ in your version. If you don't have the OpenAI Compatible provider, update Langflow first; as a last resort use a custom Python component (the documentation has a section on them) and check the documentation for your version at docs.langflow.org.
Connecting the gateway in LangChain
In code it's a couple of lines. In Python:
import os
from langchain_openai import ChatOpenAI
llm = ChatOpenAI(
model="gpt-6.1-sol",
base_url="https://api.zukko.pro/v1",
api_key=os.environ["ZUKKO_API_KEY"],
)
print(llm.invoke("Name three pros of visual builders").content)In JavaScript the address goes into configuration.baseURL. Detailed examples for both are in the article on connecting LangChain to the gateway. The address ends in /v1 in both cases, and request parameters are described in the Chat Completions reference.
Does the choice affect cost
The choice between a builder and code does not change the token price: you pay for model tokens. What changes is how visible spending is. In a visual flow it is easy to add an extra model block and not notice it is called on every message.
An example. A flow makes three gpt-6.1-sol calls per user message, each with 1,200 input and 200 output tokens. Prices as of October 18, 2026: input 0.27, output 1.32 per 1M tokens.
- input: 3,600 × 0.27 / 1,000,000 = $0.000972;
- output: 600 × 1.32 / 1,000,000 = $0.000792;
- total $0.001764 per message, or about $1.76 per 1,000 messages.
If one of the three calls can go to a cheaper model, spending drops. Actual charges are visible in the Usage section of the dashboard, and it is wise to give the key a daily limit during experiments.
Alternatives and neighboring tools
If you are looking for what else can replace LangChain, look at other libraries: LlamaIndex (focus on data and retrieval), Vercel AI SDK (for TypeScript and web apps), Semantic Kernel (the .NET and Java ecosystem) and CrewAI (teams of agents). Among visual tools, Flowise, Dify and n8n sit nearby. Flowise and n8n are often compared with each other: Flowise is closer to assembling LLM apps from blocks, n8n to automating processes between services. Which one suits you is best decided from each one's documentation and a small trial project.
FAQ
Can I start in Langflow and later move to LangChain?
Yes, it's a common path: the flow's logic (which blocks, in what order) is carried over to code by hand. Think ahead about which parts of the flow you'll want covered by tests.
Do I need a separate key or a paid Zukko subscription for Langflow?
No subscription: Zukko has a single dollar balance and pay-per-token billing. The fetch_... key goes into the provider settings like any other API key.
What if Langflow doesn't find any models?
Check that the Base URL ends in /v1 and that the Langflow server can reach the internet: the gateway serves the model list without checking the key, so an empty list almost always points to the address or the network. The key and balance are checked on the first model call: a 401 means a wrong key, a 402 means not enough balance.
Does this work from Russia?
Yes: both Langflow and a LangChain script call the Zukko gateway with one key, and the balance is topped up via SBP, MasterCard or crypto. The Langflow settings and the LangChain code do not depend on the payment method.
If you want to try both approaches, create a key in the dashboard and connect it first in Langflow, then in a short Python script.
zukko
Pay 25×
less
for Claude Code & ChatGPT
One fetch_* key and base URL api.zukko.pro — for Cursor, Claude Code, Codex, and any SDK.
Related articles
- Dify vs n8n: LLM apps versus process automationDify and n8n are often placed side by side though they solve different problems. We cover when you need an LLM app builder and when you need integration flows.
- GPT-6 Astra or Claude Fable 5.1: Two Top Models by Price and IndexTwo premium models with the same intelligence index and different Zukko prices. We price a single request and an agent session with cache, and explain how to choose on your own data.
- Qwen or DeepSeek via API: Price, Context and Intelligence IndexFour models, one task and an honest calculation: what a run costs on Qwen 3.8 Max and Flash versus DeepSeek V4 Pro and V4.1 Flash.
- Gemini API vs Vertex API: the difference and which one to pickGoogle offers two doors to Gemini: an AI Studio key or a Google Cloud project. We compare them and show a third route through a gateway.