Open or Closed AI? A Friendly Map of the Four Layers Behind Every AI App
From the publisher’s feed, collected in the ZeroLabs newsroom.
Imagine you’ve decided to build an AI chatbot, or maybe a full AI agent. You’re excited. Then the questions hit you all at once. Which model should I use? Where does my data go? How do I wire it all together? Should I use open-source tools, or pay for a managed service?That moment of “where do I even start?” is something almost every builder feels. The good news is that the whole puzzle becomes much easier once you see it as four layers: the model, the data, the orchestration, and the application. At each layer, you can choose open-source or closed, and there’s no single right answer.Let’s walk through it together.Why open source deserves a seat at the tableBefore the layers, a quick note on why this matters. Researchers at Harvard Business School estimated what it would cost companies to rebuild the open-source software they use from scratch. Their estimate of that demand-side value was $8.8 trillion, and they found firms would need to spend 3.5 times more on software if open source didn’t exist.A fair caution: that number is an estimate built on assumptions, and some experts have questioned how it was calculated. One critic argued the headline figure may be off by an order of magnitude. So think of it less as an exact price tag and more as a sign of how much of the digital world rests on code that people share freely.In AI, that sharing is especially lively. Many features that appear first in commercial tools are soon recreated by the open-source community.One note on scope: this guide covers the software layers only. Hardware and infrastructure matter too, but they’re a separate conversation.Layer 1: The model, the brain of your systemThe model sits at the center of everything. Here’s how the two paths differ.The open path. You can choose from many open models: general-purpose language models, community fine-tuned versions built for tasks like question answering, or models specialized for a field such as law. There are even narrow tools, like a model that spots anomalies in biomedical images.The catch is that you have to run the model. That means picking an inference engine, the software that actually runs it. For your laptop, a popular option is Ollama. For servers, common choices include vLLM and TensorRT-LLM.The closed path. You call a model through an API. It’s simple, and the rest is handled for you: the inference engine, the speed optimizations, and the infrastructure underneath. You send a request and get an answer.How it feels: closed is like ordering food delivery. Open is like cooking in your own kitchen. One is faster, and the other gives you control over every ingredient.Layer 2: Data, the memory your AI draws fromMost useful AI apps need your own information, such as documents, notes, or company knowledge. Here’s something reassuring: this layer looks almost the same for open and closed systems. The pieces are:Data sources and connectors. Automated links that pull information in from your tools.Data conversion. Turning messy material, like a PDF, into structured text an AI can use.RAG pipelines and vector databases. This is where your data is turned into embeddings and stored, so the model can pull the right pieces into its context when needed.What changes is the nature of the tools. With open source, three differences stand out:Cost. Open tools are usually free to use, while closed ones are often part of a paid product.Customization. With the source code in hand, you can adapt it. With closed tools, you work with what’s built in, and if it’s missing, you can’t add it yourself.Control over where it runs. Open code can live on your own servers or any cloud you choose. Closed services are typically hosted for you, so you have less say over where your private data travels.That last point matters a lot if you handle sensitive information.Layer 3: Orchestration, how the work gets organizedOrchestration is how your AI system breaks a problem into smaller steps. It can include:Reasoning and planning: deciding how to tackle a task.Executing: calling tools or functions to actually do things.Review loops: checking and improving the answer before it reaches the user.On the open side, this depends on the agent framework you pick, and you control how it’s structured. On the closed side, some commercial platforms let you run agent-style tasks through an API.Here’s the tradeoff, and it’s a fair one. The closed route is simpler, since you just make a call that matches the platform’s format. But sometimes it can be too simple, because you can’t shape the exact structure of your agent the way you can with an open framework.Layer 4: The application, what your users actually touchThis is the part people see: the chat window, the buttons, the experience.On the open side, there are two flavors:Customization-first: tools like Open WebUI and AnythingLLM give you full control over the user experience.Speed-first: tools like Gradio and Streamlit let you build a web interface in minutes with minimal setup.On the closed side, the usual route is to build from scratch, embedding the AI directly into your web or mobile app.The four layers at a glanceLayer Open-source path Closed path Model Run it yourself with Ollama, vLLM, or TensorRT-LLM Call an API; inference is managed for you Data Connectors, conversion, RAG, and vector DBs: free, customizable, deployable anywhere Same building blocks, but part of paid products with less control Orchestration Choose an agent framework and control the structure Platform APIs; simpler, but less flexible Application Open WebUI, AnythingLLM, Gradio, Streamlit Build the interface inside your own appA few honest things to keep in mindI love the freedom open source offers, but I’d be doing you a disservice if I only talked about the upside.“Free” isn’t always cheap. The software may cost nothing, but running models takes hardware, time, and know-how.More control means more responsibility. Updates, security, and reliability become your job.“Open” can mean different things. Some models share their weights but have restrictive licenses. Always read the license before building a product on it.Tools change fast. This landscape moves quickly, so check each project’s current documentation before you commit.How to choose, without the stressYou don’t have to go all open or all closed. Many good systems mix both. A few questions can guide you:How sensitive is my data? If privacy and location matter, open and self-hosted options give you more control.How fast do I need to launch? For a quick start, closed APIs and tools like Gradio or Streamlit save time.Do I need to customize deeply? If yes, open source gives you room to adapt.What can my team maintain? Be honest about your time and skills.What will it cost at scale? Compare API fees with running your own setup.If you’re just beginning, here’s a gentle path: try a small open model on your laptop with Ollama, build a simple interface with Gradio or Streamlit, and see how it feels. You’ll learn more in an afternoon than in a week of reading.Understanding these four layers, model, data, orchestration, and application, turns a confusing pile of choices into something you can reason about. Sometimes the convenience of a closed solution is exactly right. Other times, the transparency and flexibility of open source will serve you better.Either way, it’s worth remembering that the open option exists, shaped by a community that keeps building and sharing. That’s a hopeful thing to build on.Open or Closed AI? A Friendly Map of the Four Layers Behind Every AI App was originally published in Towards AI on Medium, where people are continuing the conversation by highlighting and responding to this story.