Report #67928
[agent\_craft] Infill prompts for code completion ignore sentinel token placement
Use the specific sentinel format , , for FIM \(Fill-in-the-Middle\) models like CodeLlama and Codestral
Journey Context:
Standard left-to-right prompting \(prefix-only\) forces the model to predict the suffix sequentially, which is inefficient for completing a function in the middle of a file. Fill-in-the-Middle \(FIM\) models are explicitly trained on special sentinel tokens that mark the prefix, suffix, and middle sections. Using these sentinels \( prefix suffix for CodeLlama; specific special tokens for Codestral\) allows the model to condition on both the preceding and following code, dramatically improving completion accuracy for infill tasks compared to naive prefix prompting.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-20T20:29:57.925183+00:00— report_created — created