Features
FIM Completion
Generate missing code between a prefix and suffix for inline editor completion and code repair.
Fill-in-the-Middle (FIM) generates missing content between a code prefix and suffix. It suits IDE inline completion, function-body generation, and localized code repair.
This is an interface template. FIM has no universal Chat Completions fields. Models may use dedicated endpoints, special tokens, or
prompt/suffixparameters. Follow the actual APIQIK implementation.
Request template
POST <FIM_COMPLETION_ENDPOINT>
{
"model": "<fim-capable-model-id>",
"prompt": "def normalize_name(value: str) -> str:\n ",
"suffix": "\n\nprint(normalize_name(' APIQIK '))",
"max_tokens": 128,
"temperature": 0.1
}Editor integration
- Capture bounded context before and after the cursor, prioritizing the current function, types, and imports.
- Wait tens to hundreds of milliseconds after typing stops rather than requesting on every keystroke.
- Cancel the previous request when a new one starts; show only results matching the current document version.
- Keep output short and hide stale suggestions as soon as typing resumes.
- Do not upload secrets, configuration files, customer data, or unrelated code.
Evaluation metrics
| Metric | Meaning |
|---|---|
| Acceptance rate | Proportion of suggestions accepted in full or in part. |
| Time to first token | Time from triggering a request to displaying the first suggestion segment. |
| Compile success rate | Proportion of completed code passing syntax or compilation checks. |
| Edit distance | Amount of user editing after accepting a suggestion. |
| Cost per useful acceptance | Total model cost divided by useful accepted suggestions. |