Docs/Automation
Automation

n8n with a self-hosted LLM on a DGX Spark

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

By the end of this page, n8n's AI nodes call a model on your own DGX Spark instead of a public API. You add one OpenAI credential with your Spark's base URL, and a workflow that summarizes tickets, drafts replies or extracts invoice fields keeps the same nodes and prompts.

You need:

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

An AI node usually carries whatever triggered the workflow: a support email, a form submission, a row from a customer database. By default that data goes to a public model API, on infrastructure you do not control, under that provider's retention policy. n8n does not require this. Its AI nodes accept a custom base URL, so the same trigger, prompt template and downstream steps can run against a model on a Spark you rent, and no model provider sees the request.

Start with a running endpoint

  1. Pick the endpoint. With a console model preset, copy the HTTPS endpoint from the instance page (it looks like https://app-<instance-id>.gpuwerk.com) and add /v1; requests need your inference-scope API key. With your own vLLM server, <spark-host> below is your instance's hostname, <name>.gpuwerk.com. Start it with --api-key, because the instance's public IPv4 address makes an open port reachable from the internet. Put LiteLLM in front if several workflows or teams will share the model.
  2. Confirm it answers from the n8n host, not just from your laptop:
    curl http://<spark-host>:8000/v1/models
    For a preset, use its HTTPS URL and add -H "Authorization: Bearer $GPUWERK_API_KEY". You should see JSON listing the model ID, for example qwen3-coder-30b. If n8n runs in Docker, run the check from inside the n8n container.

Add the credential in n8n

n8n's built-in OpenAi credential takes a base URL as well as an API key, so you need no community node.

  1. In n8n, go to Credentials, New, OpenAi.
  2. Fill in the API key and base URL. For a preset, use your inference-scope key and the HTTPS endpoint plus /v1:
API Key: not-needed-unless-you-put-a-gateway-in-front
Base URL: http://<spark-host>:8000/v1
  1. Save the credential. n8n should report a successful connection test.

vLLM checks the key only if you started it with --api-key, but the form needs a non-empty value. With LiteLLM in front, use the gateway's URL and a virtual key per workflow; nothing else changes.

Which nodes to use

Three nodes use this credential:

To move an existing workflow from a public API to your Spark, switch the chat model node to the new credential. You do not rebuild the workflow.

A minimal workflow

  1. Add a Webhook or email trigger.
  2. Connect a Basic LLM Chain node with an OpenAI Chat Model sub-node that uses your new credential.
  3. Put the prompt in the chain node's text field:
Summarize the following support ticket in two sentences,
and flag the priority as low, medium, or high:

{{ $json.body }}
  1. Set the model to the ID your Spark reports at /v1/models (qwen3-coder-30b on that preset), or the alias from LiteLLM's config.
  2. Add the output node: a database row, a Slack message or a ticket field.
  3. Run the workflow with a test ticket. The chain node's output should show a two-sentence summary and a priority.

What actually breaks

See alsoPut a gateway in front for keys and budgets See alsoA private alternative to Zapier's AI features
First top-up: pay $20, get $30 in credit

Run your workflows against a dedicated Spark.

Deploy a dedicated DGX Spark in Europe, North America or East Asia and point n8n at it in the time it takes to read this page.

Create account