Describe the problem/error/question
I want to access my local llm ( vllm gpt-oss-20b) with url( http://localhost:8000/v1). How can I connect ?
What is the error message (if any)?
Please share your workflow
(Select the nodes on your canvas and use the keyboard shortcuts CMD+C/CTRL+C and CMD+V/CTRL+V to copy and paste the workflow.)
Share the output returned by the last node
Information on your n8n setup
- **n8n version:**2.29.8
- **Database (default: SQLite):**default
- n8n EXECUTIONS_PROCESS setting (default: own, main):
- Running n8n via (Docker, npm, n8n cloud, desktop app):
- Operating system:
hello @doyoungim999
It depends on how your n8n is installed. If it’s a Docker container, then you’ll need to either move the LLM to another Docker container and access it by the container name (simplest), or allow access from the Docker container to the host service
Welcome @doyoungim999!
vLLM exposes an OpenAI-compatible API, so you can use the OpenAI Chat Model node in n8n to connect to it. In the OpenAI credential, set the Base URL to http://localhost:8000/v1 (or the actual host IP if n8n runs in Docker - use http://host.docker.internal:8000/v1 on Mac/Windows, or your machine’s LAN IP on Linux). Put any non-empty string as the API key since vLLM doesn’t require auth by default. Then in the OpenAI Chat Model node, type the model name manually - it should match the model ID vLLM is serving (check with curl ``http://localhost:8000/v1/models).
@nguyenthieutoan nailed it, Localhost is what’s hanging you up here. Change it to your LAN ip address:8080
vLLM already exposes an API compatible with OpenAI, so you don’t need a special node — just use OpenAI’s own node pointing to your local server.
Step by step:
- Create an “OpenAI” credential in n8n.
- In Base URL, enter your vLLM address ending with /v1 (in your case, localhost on port 8000 followed by /v1). The /v1 at the end is essential — it’s the path that vLLM serves.
- In the API Key field, vLLM normally doesn’t require a key, but n8n requires the field to be filled: put any value, e.g., sk-local.
- In the node, in Model, use exactly the name that vLLM is serving (the --served-model-name / --model, probably gpt-oss-20b). If the name doesn’t match, you’ll get a model not found error.
Most common gotcha: if n8n runs in Docker, localhost points to the container, not your machine. In that case, replace localhost with host.docker.internal (Mac/Windows) or your machine’s IP on the LAN, keeping port 8000 and /v1. To confirm the URL is correct before plugging it into n8n, do a curl to the /v1/models endpoint — if it lists gpt-oss-20b, just replicate the same address in the credential.
Hey, so: probably the problem is that your n8n runs inside Docker, and in there “localhost” isn’t your computer, it’s the container itself. So when you tell it to look for vLLM on localhost:8000, it’s looking inside itself, where there’s obviously nothing, and it throws the error.
The fix is to change the Base URL to this:
http://host.docker.internal:8000/v1
If you’re on Linux you also need to start n8n with --add-host host.docker.internal:host-gateway, otherwise it won’t recognize that address (or, simpler, just put your machine’s IP directly).
Then two quick things: make sure you started vLLM with --host 0.0.0.0 (otherwise it only listens to itself), and in the API Key field just type something random like dummy, because n8n requires it even though vLLM doesn’t use it.
The only case where localhost would’ve been fine is if n8n isn’t in Docker but installed directly on your machine — but that’s probably not your setup, so go with host.docker.internal and you should be good.
Sources (n8n docs — the Ollama pages, but the Docker localhost fix applies the same to vLLM since it uses the same OpenAI-compatible API):
@Michael_Frostbutter after I changed as ip ( http://x.x.x.x:8000/v1) I can accesss successfully. Thank you
thank you I tworks. I changed as x.x.x.x instead of localhost.
Happy to help, localhost will never resolve inside a docker container.