Short answer. Self-hosted AI agents run orchestration, tools, memory and model access inside a network you control. The trade-off is control versus operations: you own uptime, upgrades, secrets, evals and observability. Plugsky supports private VPC, on-premises and air-gapped deployment by contract, with 39 public model IDs available through one OpenAI-compatible API.
What “self-hosted” covers in an agent stack
An agent is a loop: the model reads a goal, chooses a tool, observes the result and decides what to do next. Teams searching for self hosted AI agents usually mean one of three very different things, and the difference decides the architecture. Being precise here avoids a procurement conversation that sounds aligned but is not.
- Self-hosted orchestration. The agent runtime, prompts, retry logic and state machine run on your infrastructure. The model may still be a hosted API.
- Self-hosted model. Inference runs on GPUs you operate or dedicate, so prompts do not leave your network. This is the strict interpretation and the most expensive one.
- Self-hosted tools and data. The agent calls internal APIs, databases and document stores inside your network, while orchestration or inference may be hosted elsewhere.
All three can be legitimate. They carry different data paths, different on-call burdens and different evidence requirements. A vendor page that says “self-hosted agents” without naming the layer is not yet a specification.
Reference architecture for a private agent
A production agent stack usually has six parts. The diagram is logical, not a product recommendation: each part can be bought, built or reused.
- Control plane. Defines which agents exist, which tools they may call, which model IDs they may use, and which humans can change those rules.
- Agent runtime. Executes the loop, enforces step and time limits, and decides when to stop or escalate. A runaway loop is a cost and safety incident, not just a bug.
- Tool gateway. Brokers every call to an internal or external tool, applies scopes, and writes an audit record. The model should never hold raw credentials for a production system.
- Model endpoint. An OpenAI-compatible API for chat, streaming, JSON mode, function calling and embeddings. It can be hosted, private or on-premises.
- State and memory. Stores conversation state, retrieved documents and task progress. This is often the most sensitive data in the system and the easiest to overlook in a residency review.
- Observability and evaluation. Traces every step, scores outputs, and alerts on cost, latency or tool failure. Without it, “the agent is wrong” is not debuggable.
| Layer | What it includes | Self-hosted option | Managed option | What you own if self-hosted |
|---|---|---|---|---|
| Orchestration | Agent definitions, prompts, retries, limits | Runtime on your infrastructure | Vendor-hosted agent builder | Upgrades, scaling, incident response |
| Model inference | Token generation, tools, embeddings | GPUs you operate or dedicate | Hosted OpenAI-compatible API | Capacity, patching, model refresh |
| Tools and connectors | Internal APIs, databases, SaaS actions | Tool gateway inside your network | Vendor-managed connectors | Scopes, secrets, audit logs |
| State and memory | Conversation history, retrieval, task state | Your database and vector store | Vendor-managed storage | Backup, retention, deletion, residency |
| Observability | Traces, evals, cost and quality metrics | Self-hosted tracing stack | Vendor dashboard | Retention, access, alerting |
| Identity and secrets | Agent identity, keys, approvals | Your IAM and vault | Vendor identity model | Rotation, least privilege, review |
Deployment patterns that actually ship
Private runtime, hosted model. The most common pattern. Tools, state and orchestration stay inside the network; prompts and tool results go to a hosted model endpoint over HTTPS. It is simpler to operate than full self-hosting and still keeps credentials and business logic private. It is not a no-egress design.
Private runtime, private model endpoint. The runtime and inference both sit inside an agreed boundary, usually a private VPC or a dedicated endpoint. This is the pattern most regulated buyers mean by “private agents”. The remaining questions are logs, backups and support access, not just the inference host.
Fully on-premises or air-gapped. The model, runtime, tools and state all run on hardware you control. This is the strongest isolation and the highest operational burden. Model updates become a change-management project, and GPU capacity planning becomes your problem. It is justified when the data cannot leave the facility at all, not merely when a policy prefers privacy.
The pattern should follow the obligation. A team that needs tool credentials to stay internal does not automatically need an air-gapped model. A team processing classified documents does not get a pass from a private VPC alone.
Security is mostly about tools, not prompts
Most agent incidents reported in the wild start with a tool call, not a rude answer. The model is asked to do something, and the surrounding system grants it more authority than the task requires. The controls that matter are ordinary access controls applied to a new kind of caller.
- Give the agent its own identity. Do not reuse a human admin account. Scope the identity to the tools and records the task actually needs.
- Put policy between the model and the tool. Validate arguments, allow-list operations, and require human approval for irreversible actions such as payments, deletions or external email.
- Treat retrieved text as untrusted input. A document can contain instructions. If the agent reads external content and then acts, prompt injection is a tool-permission problem, not a wording problem.
- Log every step. Record the agent, user, model, tool, arguments and result. Without that record, an audit cannot reconstruct why an action happened.
- Bound the loop. Set maximum steps, timeouts, spend caps and a kill switch. An agent that cannot be stopped is an availability risk.
- Rotate secrets outside the prompt. Never place long-lived credentials in context. Use short-lived tokens issued by the tool gateway.
The OWASP Top 10 for LLM Applications and the NIST AI Risk Management Framework are useful checklists here. Neither is a certification, and neither replaces a review of your own tool permissions.
Build versus buy: the real cost line
Building the loop is the easy part. A capable engineer can produce a working agent demo in a day. The cost arrives with the parts that make it operable: identity, secrets, retries, state, evals, tracing, cost attribution and on-call. Those are platform work, and they are the same work whether the model is hosted or local.
A managed agent platform bundles some of that work into a fee and a vendor relationship. Self-hosting trades the fee for staff time and control. Neither is universally cheaper. The decision usually turns on three questions: does the data have to stay inside a boundary, does the team already run the surrounding platform, and is the agent workload stable enough to justify dedicated capacity?
If the answer to the first question is no and the second is no, a managed platform is usually the faster route. If the data boundary is hard and the platform team exists, self-hosting is defensible. If the workload is a prototype, neither investment is justified yet.
Where Plugsky fits
Plugsky supplies the model endpoint, not the agent framework. The API is OpenAI-compatible at POST https://api.plugsky.com/v1/chat/completions and covers chat, streaming, JSON mode, function calling, embeddings and RAG. That means an existing agent runtime can point at Plugsky by changing the base URL, the key and the model ID, without adopting a new orchestration product.
The approved facts are specific. The catalogue has 39 public model IDs; main text models serve a 262,144-token context. Plans run from Free at $0 and Hobby at $8/month through Starter at $20, Builder at $60 and Scale at $120. Builder and Scale have no monthly token cap and no per-token overage, subject to fair-use concurrency and RPM limits. Live regions are EU Frankfurt, GCC UAE, APAC Singapore and US Virginia, with Riyadh on Enterprise only. Private VPC, on-premises and air-gapped deployment are contract-led and scoped in writing.
For agents, the practical points are context, tool calling and the data path. Long context matters because agents resend state every turn. Function calling matters because tools are the product. The data path matters because an agent can leak more than a chat prompt: it can send retrieved documents and tool results to the model. If that path is unacceptable, the model has to move, not just the runtime.
On compliance, Plugsky describes SOC 2 as readiness rather than certification. Request the current report under NDA and confirm its scope and period. The DPA includes GDPR Article 28 terms and EU SCCs, with PDPL, DIFC and NSD alignment documented; HIPAA and BAA terms are available by contract and subject to review.
When LangGraph, CrewAI or Dify is the better choice
LangGraph, CrewAI or Dify is the better choice when the missing piece is the agent framework itself: graph-based orchestration in code, role-based multi-agent patterns, or a low-code platform for teams that want to assemble and observe workflows without writing the runtime. Those projects are built for the orchestration layer, and a model API is not a substitute for them.
Conversely, if you already have an orchestration layer and the open question is which model endpoint sits behind it, adding another framework makes the stack harder to reason about. Plugsky’s fit is the endpoint and the deployment boundary, not the agent builder.
None of this is a ranking. Framework choice depends on language, team skills, state model and how much of the loop you want to own.
What we did not verify
- We did not build or benchmark an agent on Plugsky or on any framework named here. No latency, throughput or task-success number on this page is a test result.
- We did not review a SOC 2 report, penetration test, subprocessor list or signed DPA. SOC 2 is described as readiness only.
- We did not verify that a specific framework supports every Plugsky model, tool-call shape or streaming behaviour. Test with your own runtime and SDK version.
- We did not confirm commercial terms for private VPC, on-premises or air-gapped deployment; those are contract-led.
- We did not audit the security of any third-party tool, connector or vector store referenced in an agent design.
- We did not test prompt-injection defences or the enforcement of tool scopes in production.
Frequently asked questions
What counts as a self-hosted AI agent?
A self-hosted AI agent is one whose orchestration loop, tool access and state run on infrastructure you control. The model can be self-hosted too, or it can be a hosted API called from your network. “Self-hosted” describes where the agent runs, not automatically where inference happens.
Do I need to self-host the model to self-host an agent?
No. Many teams run the agent runtime and tools inside their own network while calling a hosted OpenAI-compatible model endpoint. That keeps tool credentials and business logic private, but prompts still leave the network. If prompts cannot leave, the model has to be deployed privately as well.
What is the hardest part of running agents yourself?
The operations around the loop: tool permissions, secret rotation, retries, long-running state, evaluation and tracing. A demo agent is a few hundred lines. A production agent needs an audit trail, a way to stop a runaway loop, and an owner who is paged when a tool starts failing.
Can self-hosted agents use hosted model APIs?
Yes. A common pattern is a private agent runtime with tool access inside the network and a hosted model endpoint over HTTPS. Review the data path carefully: prompts, tool results and retrieved documents may all leave the network even though the orchestration stays inside it.
How do I secure tool access for agents?
Give each agent its own identity, grant the minimum scopes, and put a policy layer between the agent and the tool. Log every call with the agent, user, tool and arguments. Do not let a model hold long-lived credentials, and do not let it approve its own high-risk action.
Is self-hosting cheaper than a managed agent platform?
Not automatically. A managed platform bundles hosting, upgrades and support into a fee. Self-hosting trades that fee for staff time, GPU capacity, monitoring and on-call. At low volume the managed option is often cheaper; at steady high volume or strict isolation, self-hosting can win.
Related pages
Keep the loop, move the endpoint
Start on the free plan with your existing runtime, then scope private deployment when the data path requires it.
Start Free → See pricingSources
The protocol and risk pages below are the primary sources, checked on 20 November 2026. They are not endorsements and they do not certify any vendor.
| Source | Page checked | Checked |
|---|---|---|
| Plugsky | plugsky.com/pricing, plugsky.com/facts and plugsky.com/security | 20 Nov 2026 |
| Model Context Protocol | modelcontextprotocol.io | 20 Nov 2026 |
| OWASP | OWASP Top 10 for LLM Applications | 20 Nov 2026 |
| NIST | AI Risk Management Framework | 20 Nov 2026 |
Last checked 20 November 2026. Deployment scope, contract terms and compliance evidence must be reconfirmed for a specific buyer; this page is a planning guide, not a security assessment.