Private models only help if your automations can reach them. n8n’s verified generic path is its HTTP Request node. It can call a vLLM OpenAI-compatible server or another deployment that actually exposes and accepts POST /v1/chat/completions.
Use this operator guide to wire the HTTP call, authenticate it, set timeout budgets that reflect measured local inference, and keep the model service away from untrusted networks.
This path is useful when your existing workflow needs a narrow model call. An agent runtime is a separate choice; the lead-triage design shows how to keep routing and customer writes outside the model.
An OpenAI-compatible endpoint that is reachable from the public internet without authentication is an open inference proxy. Anyone who finds it can consume GPU time. With vLLM, attackers may also reach inference and operational routes that
--api-keydoes not protect. Prompt leakage is a separate logging and access-control risk, not an automatic property of the chat route. Bind to private networks. Require authentication at the gateway. Do not port-forward “just for a demo.”
What “OpenAI-compatible” means here
For n8n purposes, the contract is narrow:
- Base URL points at the server root or
/v1, depending on how the node expects it. - Chat calls hit
/v1/chat/completions(or the equivalent path your node appends). - Request body looks like a chat completion:
model,messages, optionaltemperature,max_tokens, and so on. - Response returns choices with message content the node can parse.
You do not need feature parity with every OpenAI product surface. You need a chat-completion route whose request, authentication, model identifier, and response shape you have tested from n8n.
vLLM documents this OpenAI-compatible server mode; other runtimes advertise similar shapes. Verify the route and a sample curl against your installation before you wire production workflows. The interface is common, but routes, model identifiers, authentication, and response compatibility can change between products and versions.
The verified n8n path: HTTP Request
This guide uses the HTTP Request node, which gives you explicit control over the method, URL, headers, body, authentication, and node retry settings.
Use a generic bearer or header credential rather than embedding a secret in the workflow. The credential must contain a value the inference service or its gateway actually validates. A placeholder key on a LAN-only endpoint is not authentication.
POST https://inference.example.invalid/v1/chat/completions
Content-Type: application/json
Authorization: Bearer <secret>
{
"model": "installer-recommended-local-model",
"messages": [
{ "role": "system", "content": "Classify the ticket. Reply with JSON only." },
{ "role": "user", "content": "Invented ticket: the public help page has a broken link." }
],
"temperature": 0,
"max_tokens": 200
}
Replace the example hostname with your approved private gateway and the model string with the exact served identifier from /v1/models. The 200-token output cap is an exercise value, not a production default. Start with this literal invented text. When mapping live n8n fields, construct the request as an object through the node’s expression/JSON mechanism; do not splice unescaped text into a JSON string. Test quotes, newlines and an empty field before enabling the trigger.
HTTP Request is also the right escape hatch when a vendor-specific AI node does not document a custom endpoint.
Authentication and network controls that actually hold
Local does not mean unauthenticated.
For vLLM, --api-key is not a security perimeter for the entire HTTP service. The official security page documents protected and unprotected endpoint sets and recommends network isolation plus a reverse proxy when exposure is necessary (vLLM security guidance). An API key on inference routes does not prove that every route rejects unauthenticated traffic.
Required baseline: bind vLLM only to loopback, a container/cluster network, or a private interface protected by firewall policy that permits only the proxy or n8n workload. Put Caddy, nginx, Traefik, or an equivalent controlled gateway in front when more than one host must connect. Terminate TLS where the path is not already a trusted encrypted overlay, authenticate every route you expose, rate-limit, cap request sizes, and allowlist only required paths. n8n talks to the proxy; clients do not reach vLLM directly.
Use vLLM’s --api-key as an additional control for supported inference endpoints, not as a replacement for the proxy/firewall. Store all credentials in n8n credentials or an approved secret store, not in plain workflow fields that export into Git.
Do not:
- Bind
0.0.0.0on a home or office WAN IP “temporarily.” - Share a tunnel URL in Slack.
- Reuse a personal OpenAI key as the “password” for a local server that never checks it. If the server ignores
Authorization, the key is theatre.
Prompts sent to a local endpoint still leave the n8n host and may be logged by the inference server, the proxy, and n8n execution history. Local hosting reduces third-party cloud retention; it does not remove logging, screenshots, or operator access. Classify customer text as potentially sensitive or personal data under your policy and applicable law, then verify retention and access controls.
For broader integration hygiene, including scoped credentials, service accounts, and audit trails, use the patterns in connecting AI safely.
Timeouts and slow inference
Local-model latency varies sharply with model, prompt length, hardware, concurrency, and cold-start state. An n8n node’s effective timeout also depends on the node and installed version. For the HTTP Request node, the documented timeout covers waiting for response headers or the beginning of the response body; it is not proof that a streamed or long-running generation is bounded end to end. A default copied from a tutorial can therefore fail a healthy job or leave another layer without a clear limit.
Set timeouts deliberately:
- Measure a cold and warm call with curl from the n8n host.
- Collect enough representative cold, warm and loaded observations to estimate the initial-response latency distribution. Report sample counts and conditions; one cold and one warm call cannot establish p95. Set a timeout from that evidence and the caller’s total deadline, with justified headroom.
- Align workflow, proxy, client, and inference-server limits with the full generation budget.
- Prefer shorter prompts and smaller
max_tokensfor classification or routing; reserve long generations for draft steps that can continue asynchronously.
If a step routinely exceeds a few minutes, that step may belong in a queue with async continuation, not a synchronous webhook response.
Smoke-test from the n8n process network namespace, not only from your laptop. Inside a Docker container,
localhostnormally identifies that container rather than a separate host model service. Use the Docker service name, host gateway IP, or a LAN address the container can route to.
Base URL hygiene checklist
Before you mark the credential production-ready:
| Check | Pass condition |
|---|---|
| Reachability | n8n runtime can reach the documented health route and authenticated /v1/models without leaving the private network |
| Path | /v1/chat/completions succeeds with a tiny payload |
| Auth | Unauthenticated inference is rejected; no unprotected vLLM route is reachable outside the intended private boundary |
| Model id | Exact string matches what the server advertises |
| TLS | Required if the path crosses untrusted networks |
| Logging | Prompt/response logging is intentional and retention-limited |
| Failover | Workflow has a clear behaviour when the endpoint is down |
| Timeout | Initial-response and end-to-end limits reflect measurements from the n8n runtime |
Failure mode for a down endpoint should be explicit: retry with backoff, route to a human queue, or fail the run loudly. Do not silently fall back to a public API with a different privacy posture unless that fallback is a documented, approved path.
Validate the result before routing
Here is an invented classification contract. A permitted answer to “the public help page has a broken link” is {"label":"documentation","needs_review":true}. That is an expected shape, not a measured model result. The gateway response may wrap the generated text in choices[0].message.content; parse that field and validate its contents separately from the HTTP envelope.
Allow only documented enum values, require the expected fields and reject extra action instructions. {"label":"refund","send_now":true} must not become a refund merely because it is valid JSON. Unknown labels, empty responses and invalid JSON go to a visible review queue. Even an accepted label is a routing proposal; it does not grant a tool permission.
Use the private endpoint acceptance record to retain the request version, served model ID, redacted response, schema result and failure behavior. Then connect the approved draft/review path described in idempotency and human gates.
What to verify on edit day
The HTTP Request and vLLM security references were checked on 28 September 2026. Match their contract to your installed versions before shipping or refreshing the workflow:
- Confirm the live docs for your inference server’s OpenAI-compatible route.
- Confirm the HTTP Request credential and node configuration still send the required authentication, headers, and raw JSON shape.
- Re-run curl and one n8n test execution with a non-production payload.
- Confirm the listener is still private (
ss/lsof, firewall rules, no surprise tunnel), an unauthenticated inference request fails, and vLLM’s documented unprotected endpoints are not reachable across the external boundary.
Local OpenAI-compatible endpoints let n8n use private inference without rewriting the automation graph. The work is not clever prompting. It is treating inference like any other internal API: authenticated at the exposed boundary, measured, deliberately logged, and unreachable from strangers.



