Nodes/comfyui-llamacpp/Start llama.cpp Server
ComfyUI Node

Start llama.cpp Server

Launches and owns a local single-model llama-server process with capability-checked modern options.

By Setmaster·Created 7 months ago·Updated about a month ago· 4
Start llama.cpp Server
    • server_url
    • success
    modelNo models found - add .gguf files to models/LLM/gguf/
    context_size4096
    gpu_layers
    main_gpu0
    port8080
    threads
    batch_size512
    flash_attentionfalse
    timeout60
    binary_path
    host127.0.0.1
    tensor_split
    no_mmapfalse
    flash_attention_modelegacy
    mmproj(auto)
    sleep_idle_seconds0
    api_key_file
    api_key_envLLAMACPP_API_KEY
    media_path
    fit_modeupstream default
    unload_comfy_models_before_startfalse
    extra_args
    CategoryLlamaCpp

    Inputs (22)

    NameTypeDefaultDescription
    modelCOMBONo models found - add .gguf files to models/LLM/gguf/GGUF model file to serve from a configured Comfy model folder.
    context_sizeINT40960–1048576Maximum context size in tokens. 0 lets llama-server choose.
    gpu_layersSTRINGLayers to offload to GPU. Empty preserves legacy all-layers behavior; auto, all, or a number are also accepted.
    main_gpuINT00–31Primary GPU index used by llama-server.
    portoptINT80801–65535TCP port for the owned llama-server.
    threadsoptSTRINGCPU generation threads. Empty lets llama-server choose.
    batch_sizeoptINT5121–65536Logical prompt-processing batch size.
    flash_attentionoptBOOLEANfalseLegacy flash-attention toggle. Prefer flash_attention_mode for new workflows.
    timeoutoptSTRING60Startup readiness deadline in seconds. Empty has no limit.
    binary_pathoptSTRINGExplicit llama-server executable. Empty uses LLAMA_SERVER_BINARY, then PATH.
    hostoptSTRING127.0.0.1Network interface address to bind. Loopback is safest.
    tensor_splitoptSTRINGPer-GPU model proportions, for example 3,1.
    no_mmapoptBOOLEANfalseDisable memory-mapped model loading.
    flash_attention_modeoptCOMBOlegacyModern flash-attention mode. Legacy preserves the released flash_attention widget behavior.
    mmprojoptCOMBO(auto)Matching multimodal projector for local VLMs. (auto) leaves projector discovery to llama-server.
    sleep_idle_secondsoptINT00–864000 disables idle sleep. Positive values release model VRAM while idle.
    api_key_fileoptSTRINGPath to a llama-server API key file, one key per line.
    api_key_envoptSTRINGLLAMACPP_API_KEYEnvironment variable containing the matching client key. The secret is not serialized.
    media_pathoptSTRINGDirectory allowed for llama-server file:// media inputs.
    fit_modeoptCOMBOupstream defaultControl whether llama-server adjusts unset arguments to fit device memory.
    unload_comfy_models_before_startoptBOOLEANfalseEvict Comfy-managed models before llama-server allocates GPU memory.
    extra_argsoptSTRINGAdvanced llama-server arguments. No shell is used.

    Outputs (2)

    NameTypeDescription
    server_urlSTRINGURL of the running owned llama-server.
    successBOOLEANWhether server startup reached its ready state.