Docs/Automation
Automation

n8n with a self-hosted LLM on a DGX Spark

By Samuel Seidel · Updated September 9, 2026 · 6 min read

n8n's AI nodes talk to language models through the same OpenAI-compatible shape most self-hosted engines speak. That means a workflow that summarizes support tickets, drafts replies, or extracts fields from an invoice can call your own Spark instead of a public API, with the same node configuration either way.

On this page
  1. Why route n8n's AI nodes yourself
  2. Start with a running endpoint
  3. Add the credential in n8n
  4. Which nodes to use
  5. A minimal workflow
  6. What actually breaks

Why route n8n's AI nodes yourself

A workflow built around an AI node usually carries whatever triggered it: a support email, a form submission, a row from a customer database. Every one of those calls out to whichever model the node is configured to use, and by default that means a public API, running on infrastructure you don't control, under a provider's own retention policy. n8n itself doesn't require that. Its AI nodes accept a custom base URL, so the same trigger, the same prompt template, and the same downstream steps can run against a model on your own Spark, and the request never leaves your network.

Start with a running endpoint

Get an OpenAI-compatible endpoint running first, either vLLM or LiteLLM in front of it if more than one workflow or team will share the model. Confirm it answers before touching n8n:

curl http://<spark-host>:8000/v1/models

If n8n runs on a different machine or in its own container, make sure that host can actually reach the Spark. On Docker, a Spark endpoint reachable from the n8n host's network is enough; there is no special n8n-side networking beyond that.

Add the credential in n8n

n8n's built-in OpenAi credential type takes a base URL, not just an API key, which is what makes pointing it at a self-hosted model possible without a community node. In n8n, go to Credentials, New, OpenAi, and set:

API Key: not-needed-unless-you-put-a-gateway-in-front
Base URL: http://<spark-host>:8000/v1

vLLM does not check the API key field unless you started it with --api-key, but n8n's credential form requires something non-empty, so any placeholder string works. If you've put LiteLLM in front of the engine for per-workflow keys and budgets, use the gateway's URL and a real virtual key here instead, and the rest of the setup is unchanged.

Which nodes to use

n8n's AI functionality splits across a few nodes that all accept this same credential:

All three route through the same credential, so switching a workflow from a public API to your Spark is a matter of changing which OpenAi credential the chat model node uses, not rebuilding the workflow.

A minimal workflow

A common shape: a webhook or email trigger feeds a Basic LLM Chain node that summarizes the incoming text, then a downstream node writes the result somewhere, a database row, a Slack message, a ticket field. The chain node's prompt is just a text field:

Summarize the following support ticket in two sentences,
and flag the priority as low, medium, or high:

{{ $json.body }}

Set the chain's model to whatever --served-model-name your Spark reports at /v1/models, or the alias you gave it in LiteLLM's config. n8n sends the request to your Base URL exactly the way it would to a public API; nothing about the prompt template or the downstream nodes changes.

What actually breaks

See alsoPut a gateway in front for keys and budgets See alsoA private alternative to Zapier's AI features

Your own endpoint, not someone else's.

Deploy a dedicated DGX Spark in EU-Central and point n8n at it in the time it takes to read this page.

Deploy a Spark