Short answer. A self-hosted OpenAI-compatible API is a model server you run — Ollama, vLLM, llama.cpp, LocalAI or SGLang — that accepts OpenAI-style requests, usually behind your own gateway for keys, rate limits and logging. “Self-hosted” also describes a vendor deployment inside your VPC, data centre or air-gapped network, but that version is contract-led: processing location, support access, backups, subprocessors and updates must be written down. Running the model yourself removes the vendor inference path; it does not remove telemetry, update checks or the need for patching.
Why teams choose a self-hosted runtime
The reason to run your own endpoint is control over the serving stack, not a vague preference for on-premises. Four motives recur.
- Model and quantisation choice. You decide which weights, quantisation and context length serve the workload, and you can change them without waiting for a vendor release.
- Offline or isolated operation. Once the model is on the host, the inference path does not need the public internet. That suits disconnected environments, but it also means you own the update process.
- No per-token metering during development. Prompt iteration does not generate a usage bill, although the GPU, power and engineering time are still real costs.
- Direct control of latency and data path. You can place the server next to the data and tune the stack, at the cost of being the team that tunes it.
Those motives do not automatically justify self-hosting. If the requirement is only “do not send data to a shared endpoint”, a contract-led private VPC may deliver the boundary with less operational work. The rest of this page keeps that distinction visible.
Three different things called “self-hosted”
The phrase hides a commercial difference. A developer running Ollama on a laptop, a company operating vLLM on its own GPUs, and a buyer signing an air-gapped deployment with a vendor all describe themselves as self-hosting. The technical walk-through for the first case lives in the local self-hosted API guide. The technology overlaps; the responsibility does not.
- Self-managed runtime. You install and operate the model server. You own the hardware, the operating system, the model weights, the gateway and the on-call rota. No vendor sits in the inference path.
- Vendor-managed private deployment. The vendor operates its stack inside a boundary you agree — a private VPC, a dedicated endpoint, your data centre or an isolated network. You may own the contract and the network, but the vendor may still reach the environment for support and updates.
- Hybrid. Development or sensitive work runs locally, production runs on a managed endpoint, and the application selects a base URL by environment or data class. Both sides speak the same request shape.
Only the first is self-hosting in the strict sense. The second is private deployment, and its promises depend on the contract. The private AI boundary questions set out the four checks in more detail. A vendor page that says “your data never leaves” without naming support access, backups, monitoring and subprocessors is describing a diagram, not a data flow.
Deployment options and what each one actually moves
The table compares the options on the control that changes, not on a maturity ladder. A local runtime is not a worse version of an air-gapped cluster; it is a different answer to a different requirement.
| Option | Where inference runs | Who operates it | Contract boundary | Best fit |
|---|---|---|---|---|
| Local runtime | Developer laptop or workstation | The developer | None with a vendor; the runtime's own telemetry and update paths still apply | Prompt development, evaluation, offline experiments, small internal tools |
| Self-managed on-premises GPU server | Your data centre or colocation rack | Your platform team | Hardware, model licence and support contracts are separate purchases | Predictable demand, existing GPU operations, data that cannot use a shared control plane |
| Private VPC or dedicated endpoint | Vendor-operated infrastructure inside a network boundary you agree | Vendor, with your network and identity controls | Peering, ingress, admin access, capacity, SLA, incident contact, subprocessors | Regulated workloads that need isolation without owning the GPU estate |
| On-premises with a vendor stack | Your data centre, on hardware you provide or lease | You, with contracted vendor support | Supported hardware matrix, patch responsibility, support access, update cadence | Classified or regulated data that must stay in a controlled facility |
| Air-gapped | An isolated network with no outbound path | You, with an offline vendor process | Model artefact transfer, integrity checks, update cadence, support escalation, log export | Highest-classification or disconnected environments |
The honest comparison is not “cloud versus on-premises”. It is which boundary each option moves and which burden it transfers. A private VPC moves the network boundary and leaves the operating burden with the vendor. On-premises moves the hardware and the operating burden to you. Air-gapped moves both, and adds a slow update path that has to be designed rather than assumed.
What the contract has to say
Private deployment is contract-led. Plugsky states that explicitly because the alternative — inferring a boundary from a marketing page — is how procurement reviews fail. The same discipline applies to any vendor, including a self-managed stack with commercial support.
Put the boundary in writing. Name where processing, storage, backups and disaster recovery run. Name which subprocessors can access data and from which countries. State how vendor support access is approved, logged and time-limited. State who patches the runtime and who owns an upstream security fix. State the audit-log export format and retention. State the exit, export and deletion process. If a term is not in the contract, it is not a boundary.
Three phrases deserve particular care. “Data never leaves” is true only for the paths the contract covers; telemetry, crash reporting and support sessions are the usual exceptions. “Air-gapped” describes a network property, not a security outcome; an isolated system with stale models and no monitoring can be less secure than a well-run regional service. “Private” describes who can reach the environment, not where the company is incorporated or which law can compel it.
Plugsky offers private VPC or dedicated endpoint, on-premises and air-gapped deployment, but scope, hardware, update path, support access and commercial terms are agreed in writing rather than selected at checkout. A SOC 2 report can be requested under NDA; confirm the audit period, scope and any exceptions. The canonical facts page carries the current approved wording. No certification or government accreditation is claimed on this page.
Runtimes that speak the OpenAI format
Several open-source engines expose an OpenAI-compatible surface. They differ in setup effort, throughput, hardware requirements and how completely they implement the routes a client expects.
| Engine | Setup difficulty | Performance profile | GPU required | API compatibility |
|---|---|---|---|---|
| Ollama | Easy — single binary | Good for single-user and small teams | Optional; CPU works | Chat completions, embeddings and model listing |
| vLLM | Medium — pip install | Best for concurrent GPU throughput | Required for GPU serving | Broad OpenAI surface, continuous batching and PagedAttention |
| llama.cpp server | Medium — build from source | Best on CPU and Apple Silicon | No; CPU and Metal optimised | Chat and completion routes; tool support varies by build |
| LocalAI | Easy — container image | Moderate | Optional | Drop-in routes with multiple backend formats |
| SGLang | Medium — pip install | Strong for structured output and high concurrency | Required for GPU serving | Broad OpenAI surface plus constrained decoding |
Two compatibility traps are worth testing before a runtime is chosen. First, streaming is not one behaviour: some servers emit role-only chunks, some omit usage on the final chunk, and some close the connection differently. Second, tool calling is frequently partial. A client that only tested basic chat can pass a smoke test and still fail on a JSON-schema tool definition in production.
Quick start with Ollama
Ollama is the fastest way to get an OpenAI-compatible endpoint running on a workstation. It serves a local port and accepts OpenAI-style requests without an SDK wrapper.
# Install Ollama, then pull a model
curl -fsSL https://ollama.com/install.sh | sh
ollama pull llama3.2
# The server listens on localhost:11434 by default
curl http://localhost:11434/v1/chat/completions \
-H "Content-Type: application/json" \
-d '{
"model": "llama3.2",
"messages": [{"role": "user", "content": "Hello"}]
}'
The same endpoint works with the official OpenAI SDK. The key is a stand-in value because a local Ollama instance does not authenticate callers; that is exactly why it should not be exposed beyond localhost without a gateway.
from openai import OpenAI
client = OpenAI(
base_url="http://localhost:11434/v1",
api_key="ollama", # required by the SDK; Ollama ignores it
)
resp = client.chat.completions.create(
model="llama3.2",
messages=[{"role": "user", "content": "Write a haiku about local AI."}],
)
print(resp.choices[0].message.content)
Production with vLLM
vLLM is built for throughput. It manages the KV cache with PagedAttention and batches requests continuously, which matters when several applications share one GPU. The trade-off is operational: you own the CUDA stack, the model download, the memory tuning and the capacity plan.
pip install vllm
python -m vllm.entrypoints.openai.api_server \
--model mistralai/Mistral-7B-Instruct-v0.3 \
--host 127.0.0.1 \
--port 8000 \
--max-model-len 8192 \
--gpu-memory-utilization 0.90
curl http://127.0.0.1:8000/v1/chat/completions \
-H "Content-Type: application/json" \
-d '{
"model": "mistralai/Mistral-7B-Instruct-v0.3",
"messages": [{"role": "user", "content": "Hello"}]
}'
Bind the server to a private interface, not 0.0.0.0, unless a gateway sits in front of it. Add --tensor-parallel-size for multi-GPU nodes, and set a concurrency limit that matches the memory you actually have rather than the number the model card implies.
The bridge to Plugsky
Every runtime above speaks the same request shape, so code written against one can move to a managed endpoint with configuration rather than a rewrite. That is the practical benefit of standardising on the OpenAI format: the client library, the message schema and the streaming parser stay the same.
import os
from openai import OpenAI
# Local development
local = OpenAI(base_url="http://localhost:11434/v1", api_key="ollama")
# Production: one host, one key, same client
# Docs also show https://plugsky.com/v1 as an alias. Both resolve to the
# same API; use one host per environment and do not mix them in a snippet.
client = OpenAI(
base_url="https://api.plugsky.com/v1",
api_key=os.environ["PLUGSKY_API_KEY"],
)
resp = client.chat.completions.create(
model="plugsky-pro",
messages=[{"role": "user", "content": "Hello"}],
)
The same change applies across SDKs: baseURL in the Node and TypeScript clients, BaseURL in Go, base_url in the Rust client, and the host plus an auth header in curl. The model ID is the part that does not transfer automatically. A local llama3.2 tag has no meaning on Plugsky; map each workload to a public ID from GET /v1/models before cutover.
Plugsky serves 39 public model IDs from one API. Most text models serve a 262,144-token context; the Mistral-based model and the vision models serve 131,072; translation and the GPU Share route serve 32,768; and the embedding models accept 8,192 input tokens. Plan input ceilings are separate from model context, so a 64K plan input limit still applies on Hobby even when the model supports more.
Choosing between self-hosted and managed
The decision is usually about utilisation and operational capacity, not about model quality. A GPU that runs at a small fraction of capacity is an expensive way to avoid a subscription; a workload that needs a private network boundary is a poor fit for a shared public endpoint.
| Factor | Self-hosted runtime | Plugsky managed endpoint | Question to ask |
|---|---|---|---|
| Setup time | Hours to days, plus gateway work | Minutes to a first request | Is engineering time the constraint? |
| Capacity | Your GPU and your peak | Plan concurrency and RPM limits | What is the peak, not the average? |
| Model choice | Whatever you can host and license | 39 public model IDs | Does the workload need a model you cannot host? |
| Team access | You build auth and sharing | Keys, SSO and admin controls | How many teams need separate keys? |
| Uptime | You own redundancy | 99.9% uptime target; plan terms and exclusions apply | What does an hour of downtime cost? |
| Deployment boundary | Wherever you put the hardware | Regional cloud, private VPC, on-premises or air-gapped by contract | Is the requirement isolation, residency or both? |
| Cost shape | Hardware, power, staff, idle capacity | Published plan fee plus plan limits | What is the fully loaded cost at your utilisation? |
Plugsky's self-serve plans are published: Free at $0, Hobby at $8/month, Starter at $20/month, Builder at $60/month and Scale at $120/month, with 20% off annual billing and a 7-day money-back guarantee on paid plans. Builder and Scale carry no monthly token cap and no per-token overage, subject to fair-use concurrency and RPM limits. That is a different cost shape from owning a GPU, not automatically a cheaper one.
Hybrid routing without a second codebase
The most common production pattern keeps both paths. Development and evaluation run locally; production traffic goes to a managed endpoint; a small router chooses by environment or by an explicit data class. The important design rule is that the choice is configuration, not a fork of the application.
import os
from openai import OpenAI
def client_for(data_class: str) -> OpenAI:
if data_class == "restricted":
return OpenAI(base_url="http://localhost:11434/v1", api_key="ollama")
return OpenAI(
base_url="https://api.plugsky.com/v1",
api_key=os.environ["PLUGSKY_API_KEY"],
)
# The caller passes a classification, not a keyword guess.
client = client_for("internal")
resp = client.chat.completions.create(
model="plugsky-pro",
messages=[{"role": "user", "content": "Summarise this ticket."}],
)
Do not route on keywords found in the prompt. It looks clever in a demo and fails in production: the same sentence can contain sensitive data in one context and public data in another. Classify the workload, the tenant or the data store, then enforce the route in one place.
Cost and operations: what to count
A self-hosted deployment is not free because the hardware is already owned. The costs that matter are the GPU or CPU capacity, the electricity and cooling, the rack space, the replacement cycle, the model download and storage, the gateway and observability stack, the security patching, and the engineer who answers the page when inference fails at night.
Utilisation decides the comparison. A dedicated GPU that serves one internal tool at 5% utilisation is subsidising spare capacity; a GPU that runs batch and interactive traffic at high utilisation can beat a per-request price. Managed plans convert capital and operations into a fee with published limits, which is easier to budget but not automatically lower. Model the comparison with your own token counts and peak concurrency; a generic “self-hosting is cheaper after X tokens” rule is not evidence.
Operational readiness is the other half. Before cutover, confirm that you can patch the runtime, rotate keys, export logs, restore a backup, drain a node and roll back a model. A local demo that has never been through an incident is not a production deployment.
What we did not verify
- We did not benchmark Ollama, vLLM, llama.cpp, LocalAI or SGLang on identical hardware. The performance column describes each project's stated design goal, not a measured comparison.
- We did not test a Plugsky private VPC, on-premises or air-gapped deployment. The contract questions on this page are the ones to ask, not a description of a delivered environment.
- We did not review a SOC 2 report, penetration test, subprocessor list, DPA or executed SCC. Public wording describes NDA access and readiness only; confirm the period, scope and exceptions.
- We did not verify hardware prices, electricity costs or a break-even point. Any cost comparison depends on your utilisation, contract and region.
Frequently asked questions
What does self-hosted mean for an OpenAI-compatible API?
It can mean two different things. A developer can run a local runtime such as Ollama, vLLM or llama.cpp on their own hardware, or a vendor can deploy its stack inside a private VPC, the buyer's data centre or an air-gapped network. The first is self-managed by definition. The second is contract-led private deployment, and the operating boundary has to be agreed in writing.
Do prompts stay inside my network when I self-host?
Only for the paths you control. If the model runs on your hardware, there is no vendor inference path, but the runtime can still send telemetry, crash reports, model downloads and update checks. Audit those paths and disable them where required. In a vendor-managed private deployment, support access, monitoring, backups and subprocessors can cross the boundary unless the contract says otherwise.
Which self-hosted runtimes expose an OpenAI-compatible API?
Ollama, vLLM, llama.cpp server, LocalAI and SGLang all expose OpenAI-style routes. Chat completions, streaming and model listing are the common surface. Tool calling, structured output and embedding dimensions vary, so test the exact routes your client uses rather than assuming full parity.
Can I move code from a self-hosted runtime to Plugsky?
For the Chat Completions surface, usually yes: change the base URL, the API key and the model ID. Use https://api.plugsky.com/v1 as the base URL. Plugsky's public docs also show https://plugsky.com/v1 as an alias; pick one host and keep it consistent. Test streaming, tool calling and error handling before cutover.
Is self-hosting cheaper than a managed API?
Not by default. A self-hosted deployment carries hardware, power, rack space, replacement capacity, patching and staff time, and those costs accrue whether the GPU is busy or idle. A managed plan converts much of that into a predictable fee. Model both against your own token volume and utilisation; no generic percentage is reliable.
What should a private deployment contract state?
At minimum: where processing, storage, backups and disaster recovery run; which subprocessors can access data and from where; how vendor support access is approved, logged and time-limited; the model update and patching path; the audit-log export format; the SLA and its exclusions; and the exit, export and deletion process. If a term is not in the contract, it is not a boundary.
Start on the runtime, then choose the boundary
Build against an OpenAI-compatible endpoint today. When the requirement becomes a private VPC, on-premises or air-gapped deployment, ask for the scope in writing.
Start freeSources
Each project or standards claim below was checked on the linked official page on 20 November 2026. Runtime behaviour can change between releases; test the exact version you deploy.
- Ollama: OpenAI compatibility — the compatible routes, base URL and authentication behaviour. Checked 20 November 2026.
- vLLM: OpenAI-compatible server — server flags, supported routes and deployment guidance. Checked 20 November 2026.
- llama.cpp: server documentation — the HTTP server, OpenAI-style routes and build options. Checked 20 November 2026.
- OpenAI API reference — the request and response shapes that “OpenAI-compatible” refers to. Checked 20 November 2026.
Last checked 20 November 2026. Plugsky's current plans are at /pricing; the deployment and residency position is at /private-ai.