continue-custom/docs/customize/model-roles/autocomplete.mdx
BekahHW 8cedf06c1f
fix: Add ModelRecommendations component for central updating (#7457)
* Add model-recs yaml file for central updating

* feat: centralize model recommendations with React component

- Add ModelRecommendations.jsx component for dynamic table rendering
- Replace static markdown table in models.mdx with reusable component
- Update model recommendations with latest 2025 models
- Add support for role-based filtering and markdown link parsing
- Remove unused YAML data files to reduce duplication
- Implement centralized model management per Mintlify best practices

* Add recommended agent models to agent docs

* Add Autocomplete model recs

* Link to mercury coder

* Add Recommendations for chat models

* Add recommendation for edit

* Add Autocomplete recs

* Add chat model recs

* Add model recs to edit

* Run Prettier

* Fix merge conflicts

* Merge new files from main

* Add name to package.json
2025-08-29 11:11:43 -07:00

47 lines
2.2 KiB
Text

---
title: "Autocomplete Role in Continue Models"
sidebarTitle: "Autocomplete Role"
description: "Learn how the autocomplete role works in Continue, which models to use, and how to customize prompt templates for inline code suggestions."
keywords: [autocomplete, model, role]
sidebar_position: 2
---
import { ModelRecommendations } from '/snippets/ModelRecommendations.jsx'
An "autocomplete model" is an LLM that is trained on a special format called fill-in-the-middle (FIM). This format is designed to be given the prefix and suffix of a code file and predict what goes between. This task is very specific, which on one hand means that the models can be smaller (even a 3B parameter model can perform well). On the other hand, this means that Chat models, though larger, will often perform poorly even with extensive prompting.
In Continue, autocomplete models are used to display inline [Autocomplete](../../features/autocomplete/quick-start) suggestions as you type. Autocomplete models are designated by adding the `autocomplete` to the model's `roles` in `config.yaml`.
## Recommended Autocomplete models
<ModelRecommendations role="autocomplete" />
Visit the [Autocomplete Deep Dive](../deep-dives/autocomplete) for detailed setup instructions and configuration options.
## Prompt templating
You can customize the prompt template used when autocomplete happens by setting the `promptTemplates.autocomplete` property in your model configuration. Continue uses [Handlebars syntax](https://handlebarsjs.com/guide/) for templating.
Available variables for the apply template:
- `{{{prefix}}}` - the code before your cursor
- `{{{suffix}}}` - the code after your cursor
- `{{{filename}}}` - the name of the file your cursor currently is
- `{{{reponame}}}` - the name of the folder where the codebase is
- `{{{language}}}` - the name of the programming language in full (ex. Typescript)
Example:
```yaml
models:
- name: My Custom Autocomplete Template
provider: ollama
model: qwen2.5-coder:1.5b
promptTemplates:
autocomplete: |
`
globalThis.importantFunc = importantFunc
<|fim_prefix|>{{{prefix}}}<|fim_suffix|>{{{suffix}}}<|fim_middle|>
`
```