AI Agent Hosting Models Explained: What Three Deployment Layers Take Off Your Plate

    This article breaks down what "hosting" means for AI agents and compares three deployment models—self-hosted, semi-hosted, and fully hosted—across the infrastructure, runtime, and governance layers. It explains the specific engineering burdens each model removes, such as elastic scaling, sandboxing, state management, observability, and cost or security governance, and offers a selection checklist for choosing the right fit. A sample agent definition shows how much can be left to the platform.

    1. First, Define What “Hosting” Actually Means

    In the context of AI agents, “hosting” does not refer to a single vendor’s bundled product. It describes a shift in the boundary of responsibility: the capabilities that developers would otherwise build, tune, scale, and monitor themselves are handed to a platform, while developers keep only their core assets—business logic, prompts, and tool definitions.

    Whether a solution counts as “hosted” depends on which layer it takes over. The industry usually splits the agent runtime stack into three layers: the infrastructure layer at the bottom (compute, storage, network), the runtime layer in the middle (process lifecycle, tool invocation, sandbox isolation, session state), and the governance and operations layer on top (logging, monitoring, evaluation, permissions, and quotas). The difference between “fully hosted,” “semi-hosted,” and “self-built” comes down to who is responsible for each of these three layers.

    2. Three Deployment Models and What Each One Hosts

    1. Self-Hosted: You Own All Three Layers

    Developers rent bare compute or a container platform and prepare everything else themselves: model access, vector retrieval, task queues, tool-call timeouts and retries, logging, and alerting. This offers the most flexibility, but the hidden costs are concentrated here. Agent workloads are “long-tail plus bursty”—a single task may occupy resources for several minutes straight, or hundreds of sessions may spike at once. Static resource planning almost inevitably ends up either wasteful or maxed out.

    2. Semi-Hosted: Infrastructure and Runtime Hosted, Governance Self-Managed

    The platform provides elastic compute, a sandbox execution environment, and basic session storage, while developers connect their own monitoring, build their own evaluation sets, and manage key rotation. This is currently the most common model for enterprise adoption, because it lets organizations keep their internal permission systems and audit requirements in their own hands.

    3. Fully Hosted: All Three Layers to the Platform, Only Business Definition Left

    Developers submit an agent “definition” rather than a “process”: a tool list, system instructions, the allowed model scope, and concurrency and budget limits. The platform handles scheduling, isolation, failure retries, log retention, and quota control. The savings are the most obvious, and the tradeoff is reduced control over runtime details.

    3. What Hosting Actually Takes Off Your Plate

    Elasticity and cold starts. With self-hosting, you must reserve redundancy to handle peaks. Hosting hands scaling decisions to the platform’s scheduler, which allocates resources at session granularity and reclaims them when idle.

    Sandboxing and isolation. Agents execute code, read and write files, and access the network—effectively steering untrusted input toward an executable environment. Hosting solutions typically include disposable execution environments, filesystem isolation, and network allowlists, avoiding the escape risks that arise when developers assemble isolation themselves.

    State and context management. Multi-turn tasks need to preserve intermediate artifacts and tool return values. The hosting layer generally combines session state with object storage, saving you from building your own state machine and garbage-collection logic.

    Observability. The hard part is not “whether logs exist” but whether you can stitch a single task’s model calls, tool calls, latency, and failure reasons into one trace. The tracing and metrics collection provided by the hosting layer is the part self-built solutions most often skimp on.

    Cost and security governance. Unified quotas, budget caps, key hosting, and audit trails prevent a single runaway loop from dragging down both the bill and permissions.

    A sample agent definition can be very concise, leaving operational details to the platform:

    1. agent = define_agent(
    2. instructions="You are an order troubleshooting assistant; check the logs before drawing conclusions",
    3. tools=[query_order, query_log], # declare capabilities only, not deployment
    4. model_policy={"max_steps": 12}, # step limit to prevent runaway loops
    5. runtime={"sandbox": True, "network": "allowlist"},
    6. budget={"max_tokens_per_task": 60000}
    7. )

    4. Selection Checklist: Which Model Fits Which Scenario

    • Need deep runtime customization, intranet isolation, or specialized hardware: lean toward self-hosted;
    • Already have mature monitoring and permission systems and only want to offload resources and sandboxing: semi-hosted is a better fit;
    • Business side only cares about results and time to launch, and the team has no dedicated platform engineering: fully hosted delivers the most value;
    • Regardless of the model, settle three things upfront: where data resides, how long logs are retained, and how failed tasks are compensated.

    In the general capability system of cloud platforms such as Baidu AI Cloud, container platforms, object storage, message queues, logging services, and monitoring and alerting can be combined into self-hosted or semi-hosted solutions, giving teams that need to retain governance sovereignty a place to land.

    5. Conclusion

    What hosting removes is not code, but the engineering debt that is unrelated to the business yet must be kept under watch: scaling, isolation, state, tracing, and quotas. Using the three-layer model to first confirm which control you actually want to give up, and then choosing a deployment model, is more effective than directly comparing feature lists.