Elffuss BraidHub

kikocis/continue public

627d7d0d1f85 · 1.9 KiBRawPermalink
1---
2title: Autocomplete Role
3description: Autocomplete model role
4keywords: [autocomplete, model, role]
5sidebar_position: 2
6---
7
8An "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.
9
10In 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`.
11
12## Recommended Autocomplete models
13
14Visit the [Autocomplete Deep Dive](../deep-dives/autocomplete.mdx) for recommended models and more details.
15
16## Prompt templating
17
18You 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.
19
20Available variables for the apply template:
21
22- `{{{prefix}}}` - the code before your cursor
23- `{{{suffix}}}` - the code after your cursor
24- `{{{filename}}}` - the name of the file your cursor currently is
25- `{{{reponame}}}` - the name of the folder where the codebase is
26- `{{{language}}}` - the name of the programming language in full (ex. Typescript)
27
28Example:
29
30```yaml
31models:
32 - name: My Custom Autocomplete Template
33 provider: ollama
34 model: qwen2.5-coder:1.5b
35 promptTemplates:
36 autocomplete: |
37 `
38 globalThis.importantFunc = importantFunc
39 <|fim_prefix|>{{{prefix}}}<|fim_suffix|>{{{suffix}}}<|fim_middle|>
40 `
41```