Most guides to this comparison pretend to be neutral, and almost none of them are: they are written either by vendors selling hosting or by vendors selling the opposite. So let us be plain about where we stand. We build Gravity, a managed agent platform, which means we benefit when you pick the managed column, and we would rather argue that position openly than dress it up as referee commentary. The useful version of the question is not "which is better" but "which failure would hurt you more": losing control of where your data runs, or losing your evenings to infrastructure that was supposed to save you time. This guide works through both columns, the total cost of ownership that marketing pages skip, and a checklist that settles it in five minutes.

What actually separates a self-hosted AI agent from a managed one?
An agent is not one piece of software. It is a stack: the model that does the reasoning, the runtime that loops through planning and tool calls, the integrations that touch your email or database, and the operations layer that watches all of it, retries the failures, and rotates the credentials. "Self-hosted" means you run that stack on infrastructure you control, whether that is a laptop, a virtual private cloud, or a rack in your own building. "Managed" means a vendor runs the stack and you consume the results.
The two columns also blur in practice. Plenty of teams run an open model through Ollama while a hosted service handles orchestration, or self-host a framework while the model calls still go out to a commercial API. If your reason for self-hosting is privacy, that second setup quietly defeats the point, a trap we walked through in our guide to private AI agents. In that guide's terms, full self-hosting is level one, where data physically cannot leave, and managed platforms with no-training commitments are level three, where the guarantee is contractual rather than physical. Keeping those two questions separate, where the data goes and who does the operating, is most of what this decision requires.
| Dimension | Self-hosted | Managed |
|---|---|---|
| Where it runs | Your hardware or your cloud account | The vendor's servers |
| Data custody | Physical: it never leaves what you control | Contractual: governed by the vendor's terms |
| Setup time | Days to weeks before it is production-worthy | Minutes to a first result |
| Ongoing operations | Yours: patching, scaling, monitoring, retries, upgrades | The vendor's, covered by the subscription |
| Model control | Total: pin versions, fine-tune, swap weights | The vendor chooses and upgrades models |
| Cost shape | Free software plus compute plus engineer-hours | A flat, predictable subscription |
| Best for | Custody mandates, model control, teams with infra staff | Teams that want the outcome without the ops |
Read the ongoing-operations row twice. It decides most real cases, and it is the row comparison pages tend to leave out.
When does self-hosting win?
Self-hosting wins cleanly in four situations, and we say that as a company that sells the alternative. If any of them describes you, you should self-host, and the rest of this article will not try to talk you out of it.
A hard data-residency requirement. If regulation or a customer contract says the data must stay in a specific country or on specific systems, running your own stack is the most direct way to comply. Our guide to AI agent data residency works through the EU, India, and US patterns, including the cases where a managed vendor with in-region hosting still satisfies the rule and the cases where it does not.
A compliance mandate that requires physical custody. Some regimes do not care about vendor promises at all: the material may not leave machines your organization controls, full stop. Defense work, some health records, and air-gapped environments live here. No policy document from any vendor, ours included, substitutes for custody.
You need control of the model itself. Pinning an exact model version so outputs stay reproducible, running a fine-tune trained on your own data, or swapping weights on your own schedule all require owning the serving layer. Managed platforms choose models for you, which is a convenience right up until the day it is not.
You already employ an infrastructure team with capacity. This is the quiet prerequisite underneath the other three. Self-hosting is an operating commitment, not an installation. If people on staff already run production services, adding an agent stack is incremental work for them. If nobody does, the mandate cases above mean hiring, not downloading.
The tooling on this route is genuinely good now. Ollama serves open models locally behind a stable API, our comparison of open-source AI agent frameworks covers the orchestration layer, and connecting an agent to a private API shows the integration pattern for systems that never face the public internet. What none of the tooling removes is the operating burden, which is where the next two sections go.
When does a managed platform win?
Managed wins whenever the thing you want is the finished task rather than the system that produces it. That sounds like a slogan, so here is the concrete version: on a managed platform, someone else patches the dependencies, scales the workers, monitors the runs, retries the failures, upgrades the models when providers deprecate them, and answers the pager when any of that breaks at 2 a.m. You describe the task, and you judge the result.
The maintenance list deserves to be spelled out, because "no ops burden" reads as marketing until you enumerate it. A self-hosted agent stack needs security patching for its dependencies, capacity planning as usage grows, monitoring and alerting so silent failures get noticed, secrets rotation for every credential the agent touches, and a migration plan each time a model or framework ships a breaking change. None of that is exotic. All of it recurs weekly or monthly, indefinitely. Our rundown of AI agent security best practices doubles as a preview of the workload: everything on that list still applies when you self-host, except now you are the one applying it.
Managed also wins on time-to-first-result and on cost shape. A hosted platform takes you from task description to output in minutes, against days or weeks to stand up a self-hosted stack you would trust with real work. And a subscription is a flat, predictable line item, where self-hosted costs arrive as a mix of compute bills and unplanned engineering time. Predictability is underrated until the month a GPU price moves or the maintenance week lands in the middle of a launch.
What does each route really cost?
The self-hosted software is free, and the free part is the smallest line on the bill. Total cost of ownership has three lines, and they are not the same size.
Software: effectively $0. Ollama, open-source orchestration frameworks such as LangGraph, and self-hosted interfaces like Open WebUI cost nothing to run. This is the number the "self-hosting is free" argument is built on, and it is real.
Compute: small to serious. Personal experiments on a laptop you already own add roughly nothing. Serving open models good enough for team workloads means GPU hardware you buy or cloud GPUs you rent, and the rented version is a recurring bill that grows with usage rather than a one-time purchase.
People: the dominant line. Setup is measured in days, and upkeep in hours every week, for as long as the stack exists. In our experience running production infrastructure, the recurring hours go not to the model but to everything around it: failed-run cleanup, dependency updates, and noticing the thing that broke quietly. At any realistic engineering salary, a few hours of weekly upkeep costs more over a year than a platform subscription does, before counting the setup weeks.
For comparison, Gravity's pricing is a subscription: a free tier with one agent at $0 a month, paid plans from $20 a month with $20 of usage included, and the option to buy extra usage beyond your plan. The comparison that matters is not $20 against free software. It is $20 against the hourly value of whoever becomes your agent operator.
Honesty cuts the other way at scale. An enterprise with sustained heavy workloads and a platform team already on payroll can amortize those people across many services, and per-run costs on owned hardware can genuinely come in lower. That is the situation the self-hosted TCO case studies describe, and it is worth noticing how few teams it describes.
A decision checklist you can run in five minutes
Answer these in order and stop at the first clear result.
- Does a law, regulation, or signed contract require this data to stay on hardware you control? Yes: self-host. This answer overrides everything below it.
- Do you need residency in a specific region, rather than custody? Check managed vendors' hosting regions first. Self-host only if none fits the requirement.
- Do you need to pin, fine-tune, or swap the model itself? Yes: self-host at least the model layer, whatever you do with the rest.
- Is there a named person whose job includes operating this stack? No: go managed, whatever the earlier answers suggested. An unowned stack decays until the week it fails.
- Would the engineer-hours spent on upkeep this year cost more than a year of subscription? For most teams the honest answer is yes, and that answer means managed.
- Is this a learning project? Then self-host on your own machine and enjoy it. Learning is a good reason and needs no ROI defense.
Notice what the checklist never asks: which option is more serious, or more impressive. Running your own stack is not a merit badge, and paying a vendor is not a shortcut to feel sheepish about. They are different allocations of the same budget.
Where Gravity sits, stated plainly
Gravity is a managed platform. Your tasks run on our servers, your work is not training data, and in the privacy-levels framing above that places us at level three: a contractual guarantee, not physical custody. We do the patching, scaling, monitoring, and model upgrades, and the price is the subscription described in the cost section rather than an infrastructure project.
That also means we are the wrong choice for the custody and residency cases in this article, and we would rather say so here than have you discover it during a compliance review. If your requirement is that nothing leaves your machines, run Ollama with a framework from our open-source comparison and own the stack. If your requirement is that a growing pile of work gets done without your team becoming operators, that is the thing we build. And if you are still weighing what agents can usefully take off your plate at all, start with what an AI agent is before deciding where one should live.
Frequently asked questions
Is a self-hosted AI agent more private than a managed one?
Only if you self-host every layer. A model served locally through a tool like Ollama, with local orchestration, never sends data anywhere, and that is stronger than any vendor policy. But a self-hosted framework calling a commercial model API still sends your data out on every request. Managed platforms with no-training commitments offer a contractual guarantee instead of a physical one, which is a weaker kind of assurance and still sufficient for most ordinary business confidentiality.
What does it cost to self-host an AI agent?
The software is free. Compute ranges from nothing, on hardware you already own, to a recurring GPU bill for models capable enough for team workloads. The dominant cost is people: days of setup, then ongoing weekly hours for patching, monitoring, and fixing failed runs. For a team without an existing infrastructure function, that time usually costs more per year than a managed subscription would.
Can I move from managed to self-hosted later?
Yes, and starting managed is often the cheaper way to learn what you actually need. The task definitions, the integrations that matter, and your judgment about which agents earn their keep all transfer. The runtime does not, so plan to rebuild the stack itself with open-source tools when you switch. Moving the other way, from self-hosted to managed, is usually the easier migration of the two.
Is Gravity self-hosted or managed?
Managed. Gravity runs agents on our servers and hands back finished results; you do not install, patch, or scale anything. Your work is not used as training data, which places Gravity at level three in our privacy-levels framing: a contractual guarantee rather than physical custody. If a mandate requires your data to stay on your own hardware, Gravity is the wrong tool and a local stack is the right one.
What skills do I need to self-host agents?
Comfort with a command line is the floor for a personal setup: installing Ollama, pulling models, and wiring up a framework. Running agents for a team adds real infrastructure work: Linux administration, networking, monitoring, secrets management, and capacity planning, plus the security practices any production service needs. If nobody on your team does this work today, plan on hiring for it rather than absorbing it into someone's spare hours.
Sources
- Ollama. ollama.com, accessed 22 August 2026. Source for serving open models locally, the free-to-start position, and the local API that agent frameworks connect to.
- LangGraph, LangChain. github.com/langchain-ai/langgraph, accessed 22 August 2026. Source for an open-source agent orchestration framework that is free to run on your own infrastructure.
- Open WebUI. docs.openwebui.com, accessed 22 August 2026. Source for the self-hosted interface layer and its support for both local models and OpenAI-compatible cloud APIs.
- Gravity pricing: free tier with one agent at $0 per month; paid plans from $20 per month including $20 of usage, with extra usage available beyond the plan. Checked 22 August 2026.
- Related reading: private AI agents and the four levels of private, open-source AI agent frameworks, AI agent data residency, AI agent security best practices.
