* Add autocomplete gif * Add edit quickstart gif * Add chat gif * Add agent gif * Fix broken image path * Change Features to IDE Extensions * Moved install and quickstart to ext and created redirects * Move pages in docs.json * Move examples from overview to extensions * Remove the Overview and redirect to the index * Fix Redirect * Update docs/chat/how-to-use-it.mdx Co-authored-by: cubic-dev-ai[bot] <191113872+cubic-dev-ai[bot]@users.noreply.github.com> * Redirect model pages to customize --------- Co-authored-by: cubic-dev-ai[bot] <191113872+cubic-dev-ai[bot]@users.noreply.github.com>
48 lines
2.2 KiB
Plaintext
48 lines
2.2 KiB
Plaintext
---
|
|
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](../../ide-extensions/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|>
|
|
`
|
|
```
|