Nodes/ComfyUI-llama-multimodal/[llama.cpp] N-gram Speculative Preset
ComfyUI Node

[llama.cpp] N-gram Speculative Preset

Configures optional model-free n-gram speculative decoding for the normal Llama.cpp Generate node. It does not use a draft GGUF or the Experimental native DFlash/DSpark API.

By craftingmod·Created 2 months ago·Updated 5 days ago· 3
[llama.cpp] N-gram Speculative Preset
    • ngram speculative
    ◄speculative_modeoff►
    ◄ngram_size3►
    ◄num_pred_tokens10►
    ◄ngram_modek►
    ◄ngram_min_hits2►
    ◄ngram_max_entries_per_key8►
    Categoryllama_cpp/legacy

    Inputs (6)

    NameTypeDefaultDescription
    speculative_modeCOMBOoffoff preserves normal generation. ngram predicts candidates from repeated token patterns already in the current context.
    ngram_sizeINT31–8Number of verified context tokens used as each lookup key.
    num_pred_tokensINT101–32Maximum candidate tokens proposed per draft call.
    ngram_modeCOMBOkk stores historical positions and uses less memory. k4v caches continuations for cheaper lookup and should use a memory cap.
    ngram_min_hitsINT21–16Minimum historical matches required before proposing tokens.
    ngram_max_entries_per_keyINT80–1024Maximum stored entries per key. 0 passes None for no explicit cap; a cap is recommended for k4v.

    Outputs (1)

    NameTypeDescription
    ngram speculativeOLLAMA_IMAGE_LIST_LLAMA_CPP_NGRAM_SPECULATIVE—