EnableInfill

EnableInfill switches the sampler to the INFILL variant used for fill-in-the-middle code completion. Only useful for models trained for FIM (code-completion-oriented) workflows.

Quick reference

Type bool
Default false
Category Specialized sampling
Field on SamplerParameters.EnableInfill

What it does

When true, the engine uses a specialized sampler variant tuned for completing a gap between a prefix and a suffix. This is the FIM (Fill-in-the-Middle) pattern used by code models trained with FIM tokens (for example, some DeepSeek-Coder or StarCoder derivatives).

  • false (default) — standard chat sampler. Correct for all text presets and vision presets.
  • true — INFILL sampler. Only enables when the model supports FIM.

When to change it

Scenario Value
Standard chat, reasoning, or generation false
Code completion with FIM-trained model true

Most users will leave this false. Enable only when you explicitly use a FIM-trained code model and understand the prefix/suffix prompt format that model expects.

Example

var preset = new DeepSeekCoder2Preset();
preset.SamplerParameters.EnableInfill = true;

using var api = AsposeLLMApi.Create(preset);
// Use a prompt that follows the FIM template for your specific model.

Interactions

Independent of other sampler knobs. EnableInfill toggles which sampler implementation runs; all filter knobs still apply within the chosen sampler.

What’s next