Get LLM Response
Talk to the Local LLM You Actually Loaded
- model
- response_message
- full_response
The Sagado pack's LLM story is three nodes that work as a chain: Get LlamaCPP Model loads a GGUF, Get Llama VL Chat Handler optionally gives it eyes, and this one - Get LLM Response - is where you actually talk. You hand it the loaded model and a prompt, and it runs a chat completion with a system prompt and sampling controls, then hands you the reply as a string you can drop into a text encoder, a filename builder, or anything else that eats text.
How it works
It calls model.create_chat_completion() on the MODEL you wired in, with a system message plus your prompt, and passes through temperature, top_p, max_tokens, and seed straight to llama.cpp. The detail worth knowing is the output split: response_message is the cleaned-up answer, while full_response is the entire raw JSON the API returned (usage stats, finish reason, the lot). It also handles reasoning models by chopping off everything up to </think> - so if your model thinks out loud before answering, you get just the final answer on the response_message socket.
If you pass image_path or image_base64, it restructures the user content into a multimodal message (text + image) - that's the part that needs the vision chat handler wired into the loader, otherwise the text model has no idea what to do with an image.
Inputs and outputs
model(MODEL) - from Get LlamaCPP Model.prompt(STRING),system_prompt(STRING, default "You are a helpful assistant.").temperature(FLOAT, default 0.6),max_tokens(INT, default 2048),top_p(FLOAT, default 0.95),seed(INT, default 42).- Optional:
image_path/image_base64(STRING) for vision. - Outputs:
response_message(STRING) - the clean answer;full_response(STRING) - the raw JSON.
Install and gotchas
Pack install is the standard dance (ComfyUI Manager → "Sagado Nodes for ComfyUI", or clone + pip install -r requirements.txt). Like its siblings, this node indirectly depends on llama-cpp-python - it doesn't import it directly, but the model it calls comes from the loader that does, so you still need pip install llama-cpp-python or the whole chain dies upstream.
The errors you'll actually see: a ModuleNotFoundError from the loader node (missing llama-cpp-python), or "Error getting LLM response" from this one when the model's context is exhausted or max_tokens is negative (negative means "no limit," which can run away on a chatty model). If response_message comes back empty but full_response has content, your model is a thinking model and the </think> strip ate everything - check full_response for the real output. And remember this is fully local: same VRAM math as the rest of the llama.cpp chain, so keep the model sized for your card.
Inputs (9)
| Name | Type | Default | Description |
|---|---|---|---|
| model | MODEL | — | |
| prompt | STRING | — | |
| system_prompt | STRING | You are a helpful assistant. | — |
| temperature | FLOAT | 0.60–1 | — |
| max_tokens | INT | 2048-1–32000 | — |
| top_p | FLOAT | 0.950–1 | — |
| seed | INT | 42 | — |
| image_pathopt | STRING | — | |
| image_base64opt | STRING | — |
Outputs (2)
| Name | Type | Description |
|---|---|---|
| response_message | STRING | — |
| full_response | STRING | — |