Nodes/ComfyUI-Ollama-ImageList/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 19 days ago·Updated 9 days ago· 2
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
    ngram_sync_check_tokens16
    CategoryOllama/llama_cpp/legacy

    Inputs (7)

    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.
    ngram_sync_check_tokensINT161–256Trailing tokens checked when synchronizing the incremental history index.

    Outputs (1)

    NameTypeDescription
    ngram speculativeOLLAMA_IMAGE_LIST_LLAMA_CPP_NGRAM_SPECULATIVE