QWEN self-hosted models in N8N

Hello,
Is is possible to integrate QWEN self-hosted models in N8N and can QWEN work with other nodes in N8N, like Javascript Nodes or other. A company wants to use QWEN self-hosted model as AI Chat model (LLM).

It would help if there was a node for:

My use case:

Any resources to support this?

Are you willing to work on this?

Yes, of course.
This should be posted under Question category

Changed topic type to question like @kjooleng mentioned.

Yes it is possible just use the open AI standard and paste in the credentials there.

Yes, that works well. QWEN models are OpenAI API-compatible, so you can integrate them directly into n8n. There are two ways to do it:

The easiest: n8n has a native Ollama Model Node. Install Ollama, pull the QWEN model (ollama pull qwen2.5:7b), and point the Ollama Node in n8n to http://localhost:11434. Done. It works with the AI Agent Node, Chat Node, and in combination with JavaScript Nodes via standard item passing.

Just out of curiosity:
Which QWEN version are you planning to use and what hardware is the server running on?

Welcome @nino_kariauli!

Yes, Qwen is OpenAI API-compatible so you can connect it to n8n without any custom node. Two approaches depending on how you’re hosting it:

Option 1 - Ollama (simplest for local hosting):

  1. Install Ollama and run ollama pull qwen2.5:7b (or whichever size fits your hardware)
  2. In n8n, use the Ollama Chat Model node and point it to http://localhost:11434 (or your server IP if running remotely)
  3. Connect it to the AI Agent node as the model

Option 2 - OpenAI-compatible API (if using vLLM, LM Studio, or a hosted Qwen endpoint):

  1. In n8n, create an OpenAI API credential
  2. Set the Base URL to your endpoint (e.g. http://your-server:8000/v1)
  3. Set API Key to whatever your server requires (or any string if it has no auth)
  4. Use the OpenAI Chat Model node, set the model name to qwen2.5-7b-instruct (match whatever your server serves)

Both options work directly with the AI Agent node and pass context cleanly to/from JavaScript Code nodes via $input.first().json.

To be more specific in answering your question @nino_kariauli about JavaScript nodes, here’s the data flow

After running your AI Agent (or OpenAI Chat Model node), send the output to a Code node like this

const aiResponse = $input.first().json.output; // AI Agent node

One gotcha with the OpenAI-compatible credential setup, the model name you enter in n8n must exactly match what your server exposes. Ollama serves it as qwen2.5:7b, but vLLM typically serves it as Qwen/Qwen2.5-7B-Instruct. You can check what your server reports by hitting GET /v1/models on your endpoint.

For a company deployment, a few practical sizing notes:

Qwen2.5-7B → ~8GB VRAM (fine for a single GPU)

Qwen2.5-14B → ~16GB VRAM

Qwen2.5-72B → needs multi-GPU or quantization (GGUF Q4 cuts it to ~40GB)

If multiple people will use it concurrently, go with vLLM over Ollama — Ollama queues requests one at a time, while vLLM handles batching properly for production traffic.