← Back to library

Run n8n agents on a client's own model server

kartike, who builds n8n automations for clients, had a client whose documents could not leave the office. Their in-house GPU machine already hosted Qwen, so he pointed the ordinary OpenAI chat node at it. He shares the setting that blocked him and how quality and speed compared. We turned it into a checklist.

  • OutcomeWhen a client will not let documents leave their building, point your n8n agent at the language model they host themselves through the standard OpenAI chat node, match the endpoint type their server supports, get the real context size from them, compare answers against the hosted setup, and add an alert for when their server goes down.
  • SetupUnder an hour
  • LevelIntermediate
  • Creditkartike
View original
Works with
n8nCustom agent

Published Nov 26, 2026Updated Nov 26, 2026AI dry run on sample input: passed Nov 26, 2026Source verified Nov 26, 2026

When should you use it?

  • A client's policy says their files may not be sent to an outside AI provider
  • The client already runs, or is willing to run, a model on hardware they control
  • Your workflow uses n8n's OpenAI chat model node and you would rather not rebuild it

Not for: Tasks that need the strongest hosted models, such as complex reasoning over long documents; Clients with no one able to keep the model server patched and running; Treating a local model as automatically secure; network access and logging still need their own review

What do you need, and what do you get?

You need

  • The address of the client's model server and which API style it offers
  • The context size their model build is configured for, confirmed by their IT contact
  • A small set of real questions to compare hosted and local answers
  • A channel where failures should be reported

You get

  • A separate n8n credential pointing at the client's server, with endpoint options set to match it
  • A side-by-side comparison of answer quality and response time on the same questions
  • An error branch that alerts you and the client when the model server stops answering

How does it work, step by step?

  1. Ask what the server speaksFind out whether the client's server offers only classic chat completions or newer endpoints as well.
  2. Point the credential at itCreate a new OpenAI-type credential with the client's base address, and switch off the newer Responses API option if their server lacks it.
  3. Get the real context sizeAsk the client what context length their model build supports and enter that, rather than guessing a number.
  4. Compare before switchingRun the same handful of questions through hosted and local setups and let the client judge whether the answers are good enough.
  5. Alert on outagesAdd an error branch to the model call that messages you, so you hear about downtime before the client does.

The prompt

Our own prompt, inspired by kartike and written to work in n8n and Custom agent. Values in lime are placeholders.

Fill in the blanks (optional; the copied prompt uses your values)

Prompt5 variables
Help me move an n8n agent from a hosted model to a client's own model server.
Client rule: {data_rule}. Server: {server_address}, offering {api_style}. Workflow: {workflow}.
1. Tell me how to set up a separate OpenAI-type credential for this server and which endpoint options must match what it offers.
2. If the context size is not given, mark it unknown and write the question I should ask their IT contact. Do not guess a number.
3. Propose a short side-by-side test of hosted and local answers on the same real questions, with what to record.
4. Add an error branch that alerts {alert_channel} when the server does not answer.
5. List anything that could still send data outside, such as an old hosted credential left in the workflow.

Inspired by kartike: n8n Community: running client agents on a local Qwen server with n8n's OpenAI node. The prompt above is written by playbooks.bot in our own words; nothing from the original is quoted.

What can go wrong?

  • Leaving the newer API option switched on. In his case every call failed before a single prompt got through.
  • Guessing the context window. Too large and long requests fail; too small and the agent loses history it needs.
  • Keeping the hosted credential attached to the same workflow, where a fallback could send files outside by mistake.
  • Assuming local always means slower. In his test the office server answered faster because there was no long network trip.

Our take

Plenty of small firms, especially in accounting, legal and healthcare, would use AI agents tomorrow if their files never left the office. This post is a practical answer from someone who did the work for a real client: if their model server mimics OpenAI's API, the standard n8n chat node will talk to it once the credential points at the right address. The detail worth copying is the single setting that broke the first calls, an option that assumes a newer API style the client's server did not offer. That kind of gotcha costs an afternoon if you do not know about it. We also like two habits: asking the client for the real context size instead of guessing, and comparing answers on the same questions before declaring the local model good enough. Remember that local is not the same as secure; the server, its network access and its logs still need managing, and someone must keep it running. In our dry run on an invented accounting firm, the checklist produced a separate credential plan, marked the context size as unknown until IT confirmed it, proposed a ten-question comparison, and added a Teams alert for outages.

Where the time goes back: Instead of turning down AI work for privacy-strict clients or rebuilding workflows around a new node, you reuse what you have and change one credential, with a short comparison to prove it is good enough.

FAQ

Is a dedicated node required for a self-hosted model?
Not for servers that copy OpenAI's API. The post used the ordinary OpenAI chat model node with a custom base address on the credential.
Was the local model good enough?
For this client's internal question-and-answer agent, he found the quality close to the hosted setup. That will vary by model and task, so run your own comparison.
Is this an MSP or IT task?
Often, yes. The data rule, the server and the alerting all sit with whoever manages the client's systems, so it suits MSPs and IT consultants well.

Source and credit

Inspired by kartike. We describe the idea in our own words, link to the original, and wrote the prompt ourselves; nothing is quoted.

Inspired by
n8n Community: running client agents on a local Qwen server with n8n's OpenAI node
Creator
kartike
Published on
n8n Community
Original date
Nov 25, 2026
License
Not openly licensed (the poster keeps all rights), so we quote nothing and link to the original
Originally for
n8n
AI dry run
Nov 26, 2026: passed. Dry-run tested by our AI test agent on sample input. No invented context size, endpoint mismatch handled, comparison and outage alert included. Invented client only; no real server contacted.
AI dry run on sample data; not run with live connected accounts. The playbooks.bot test agent filled the prompt with synthetic inputs, produced the output and checked it against the page's stated outputs and guardrails.
Verified
Nov 26, 2026: source link resolves to the original, the credited creator published it, our excerpt or prompt matches it, and the license allows our use.

Are you the creator? Claim or correct this page.

More in IT & Security

All 82 IT & Security playbooks →

Related playbooks

IT & SecurityWorkflow✓ AI dry run

Distill agent sessions into shared memory every night

Save each completed agent session to its own transcript file, have one analyzer agent per transcript verify, enrich and organize small linked memory files, run an organizer once to merge duplicates and keep an index current, then attach the store to the agent's next session with read access only and repeat the pass nightly on new sessions.

Credit: Anthropic

An afternoon+
IT & SecurityPrompt✓ AI dry run

Plan a least-privilege move of your agent's Google access

Get a written, reviewable plan for moving an agent's Gmail, Calendar and Drive access onto Google's agent interfaces, with the current setup kept as a fallback, read-only grants first, proof that writes fail, and no cutover until a side-by-side run is clean.

Credit: u/rlnerd on r/hermesagent

An afternoon+
IT & SecurityWorkflow✓ AI dry run

Run a local folder agent that asks before every change

Point a desktop agent at one folder so it reads documents and drafts new files, with every change and shell command approved first.

Credit: u/DraftForsaken39 on r/ClaudeCowork

Under an hour
IT & SecurityWorkflow✓ AI dry run

Write the agent skill and its tests before the task

For each recurring job you hand an always-on agent, first create a skill with test cases, then run the real task through it.

Credit: u/xbxz on r/hermesagent

An afternoon+