CommonLLMChat(NYJY)
The bring-your-own-provider LLM node
- Answer
BailianChat locks you into Alibaba's platform. This node is the opposite: give it a base_url, a model, and an api_key, and it talks to any OpenAI-compatible chat API. That one sentence covers an enormous amount of ground, because "OpenAI-compatible" is the de facto standard of the entire LLM world - it's what OpenAI, every major hosted provider (Bailian/DashScope, DeepSeek, OpenRouter, Groq, and on) speak, and it's also what local servers like Ollama, LM Studio, vLLM, and llama.cpp expose. Point this node at http://localhost:11434/v1 with model: llama3 and you've got a local LLM in your graph. Point it at OpenRouter with any model slug and you've got everything else. This is the one LLM node in the pack I'd reach for first.
How it works
Under the hood it's the openai Python client pointed at whatever base_url you supply, sending your prompt (plus optional history messages) as a chat completion. The node has no idea or care which model is behind the URL - you type the model ID and it trusts you. That's both the power and the sharp edge.
The inputs and outputs that matter
- base_url - required. The
/v1-style endpoint root, e.g.https://api.openai.com/v1,https://dashscope.aliyuncs.com/compatible-mode/v1, orhttp://127.0.0.1:11434/v1for Ollama. Get this wrong and nothing works, so double-check the trailing/v1convention of your provider. - model - required. Any model ID your endpoint serves. This field is a plain STRING, so if you have a picker node elsewhere you can wire it in.
- api_key - required here (unlike the Bailian nodes, there's no config.json fallback). Any dummy string works for many local servers like Ollama, since they ignore it.
- prompt - multiline; the actual request.
- max_tokens - reply cap, default 1024, up to 8192.
- history - optional JSON array of
{role, content}messages for multi-turn conversations.
Output: a single Answer STRING.
Installing
Standard NYJY pack install: ComfyUI Manager → Install via Git URL → https://github.com/aidenli/ComfyUI_NYJY, restart. The openai pip dependency comes with the pack. Nothing else to configure - you bring all credentials to the node itself.
Where people get burned
Wrong base_url or missing /v1. The #1 failure. OpenAI-compatible APIs are finicky about the exact root; check your provider's docs.
Forgetting the model must exist on that endpoint. Pointing OpenRouter's base at a model ID only served elsewhere gives you a clean "model not found" error.
Confusing it with the Bailian nodes. If your key lives in config.json, this node won't pick it up - it reads nothing but its own api_key field. The tradeoff is exactly that: zero magic, zero convenience. You type everything. In exchange, you get one node that works with basically every LLM service on the planet, local or cloud, which is a fair swap for anyone who already uses more than one provider.
One more honest note: it's a single-shot chat with no built-in streaming. For prompt-rewriting, routing, and decision-making inside a workflow that's fine - the kind of "brain in the graph" jobs this pack is built for. If you need an interactive chat loop you're looking at the wrong node anyway.
Inputs (6)
| Name | Type | Default | Description |
|---|---|---|---|
| base_url | STRING | — | |
| model | STRING | — | |
| api_key | STRING | — | |
| prompt | STRING | — | |
| max_tokensopt | INT | 10241–8192 | — |
| historyopt | STRING | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| Answer | STRING | — |