Elffuss BraidHub

kikocis/continue public

cd9781d18fda · 2.2 KiBRawPermalink
1---
2title: "Autocomplete Role in Continue Models"
3sidebarTitle: "Autocomplete Role"
4description: "Learn how the autocomplete role works in Continue, which models to use, and how to customize prompt templates for inline code suggestions."
5keywords: [autocomplete, model, role]
6sidebar_position: 2
7---
8
9An "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.
10
11In 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`.
12
13## Recommended Autocomplete models
14
15<Info>
16 See our [comprehensive model recommendations](/customization/models#recommended-models) for the best autocomplete models, including both open and closed options.
17</Info>
18
19Visit the [Autocomplete Deep Dive](../deep-dives/autocomplete) for detailed setup instructions and configuration options.
20
21## Prompt templating
22
23You 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.
24
25Available variables for the apply template:
26
27- `{{{prefix}}}` - the code before your cursor
28- `{{{suffix}}}` - the code after your cursor
29- `{{{filename}}}` - the name of the file your cursor currently is
30- `{{{reponame}}}` - the name of the folder where the codebase is
31- `{{{language}}}` - the name of the programming language in full (ex. Typescript)
32
33Example:
34
35```yaml
36models:
37 - name: My Custom Autocomplete Template
38 provider: ollama
39 model: qwen2.5-coder:1.5b
40 promptTemplates:
41 autocomplete: |
42 `
43 globalThis.importantFunc = importantFunc
44 <|fim_prefix|>{{{prefix}}}<|fim_suffix|>{{{suffix}}}<|fim_middle|>
45 `
46```