Nodes/comfyui-llamacpp-plus/LlamaCPP Connectivity
ComfyUI Node

LlamaCPP Connectivity

No wheels, no VRAM math

By pointave·Created 6 months ago·Updated 3 months ago· 2
LlamaCPP Connectivity
    • connection
    urlhttp://127.0.0.1:8081
    model
    keep_alive0
    keep_alive_unit

    LlamaCPP Connectivity is the node that makes the rest of this pack work, and it's the easiest one to misunderstand. It does nothing by itself. It's a settings bundle - URL, model, keep-alive behavior - that gets handed to LlamaCPP Chat as a LLAMACPP_CONNECTIVITY object. Wire it, and the chat node knows where the model lives.

    The big architectural point, because it saves you a genuinely miserable afternoon: this pack does not install llama.cpp. There's no llama-cpp-python, no precompiled wheels to match against your Python and CUDA versions, no build flags. The llama.cpp install saga is a famous rabbit hole in the ComfyUI community - threads full of MSVC errors and cp312 wheel links that only work on one specific setup. This node sidesteps all of it by talking HTTP to a llama-server you run yourself. The model runs outside ComfyUI; ComfyUI just calls its OpenAI-compatible API.

    What you set

    • url - where the server listens. Default is http://127.0.0.1:8081. That's not llama.cpp's stock port (that's 8080), it's the author's own convention - their companion tool Togglellama, a Windows tray icon app that starts/stops the server and manages flag presets, is tuned for this setup. If you run llama-server yourself, set the port to match or change this field.
    • model - a dropdown of models deployed on the server. Here's the trick: it starts empty. The dropdown fills in when the node refreshes against the server's /v1/models endpoint, so the server has to be running first. "Refresh will populate dropdown with model deployed," as the README puts it.
    • keep_alive - the model-lifecycle knob. The range is only -1 to 0, which maps cleanly to two behaviors. -1 keeps the model loaded in VRAM between runs - the right choice when you're doing many runs back to back. 0 (the default) unloads the model from VRAM after every run - the README's headline tip, and the one to use if you share your VRAM with the image model on the same card.
    • keep_alive_unit - minutes or hours, used for positive keep-alive durations. Given the -1/0 range, it's effectively vestigial in the current UI, but it's what the server expects when positive values eventually make it through.

    How it works

    Under the hood the node registers a couple of tiny API routes on ComfyUI's own server. One fetches /v1/models from your llama.cpp server to populate the model dropdown. Another, for keep_alive=0, tries a handful of unload endpoints (/models/unload, etc.) until one returns a 200 - a best-effort "get this model out of VRAM" that tolerates the fact that different servers expose different unload routes.

    Setting it up

    Install the pack (ComfyUI Manager → search "comfyui-llamacpp-plus", or clone https://github.com/pointave/comfyui-llamacpp-plus into custom_nodes and restart), then make sure something is listening:

    llama-server -m path/to/model.gguf --jinja --port 8081
    

    --jinja matters if you'll ever use the chat node's think mode - without it the server won't produce reasoning output.

    Where people trip

    Empty model dropdown is the universal failure: either the server isn't up, or the URL/port is wrong, or you refreshed before the server finished loading. Check the server first, refresh second. And remember this node carries no model files and downloads nothing - the GGUF lives wherever the server loads it from. The node's whole job is a handshake, and a handshake that works is the difference between an afternoon in wheel hell and a chat node that just answers.

    CategoryLlamaCPP API

    Inputs (4)

    NameTypeDefaultDescription
    urlSTRINGhttp://127.0.0.1:8081
    modelCOMBO0 options:
    keep_aliveINT0-1–0
    keep_alive_unitCOMBO2 options: minutes, hours

    Outputs (1)

    NameTypeDescription
    connectionLLAMACPP_CONNECTIVITY