Elffuss BraidHub

kikocis/continue public

8eb3ae7b8d16 · 9.7 KiBRawPermalink
1---
2title: "Continue Autocomplete Setup and Configuration Guide"
3description: "Step-by-step guide to setting up and configuring autocomplete in Continue, including Codestral, Ollama, and IDE settings."
4keywords: [autocomplete]
5sidebarTitle: Autocomplete
6---
7
8<Info>
9 For a comprehensive comparison of all autocomplete models, see our [model recommendations table](/customization/models#recommended-models).
10</Info>
11
12## How to Set Up Autocomplete in Continue with Codestral (Recommended)
13
14If you want to have the best autocomplete experience, we recommend using Codestral, which is available through the [Mistral API](https://console.mistral.ai/). To do this, obtain an API key and add it to your config:
15
16<Tabs>
17 <Tab title="Hub">
18 [Mistral Codestral model block](https://hub.continue.dev/mistral/codestral)
19 </Tab>
20 <Tab title="YAML">
21 ```yaml title="config.yaml"
22 models:
23 - name: Codestral
24 provider: mistral
25 model: codestral-latest
26 apiKey: <YOUR_CODESTRAL_API_KEY>
27 roles:
28 - autocomplete
29 ```
30 </Tab>
31 <Tab title="JSON">
32 ```json title="config.json"
33 {
34 "tabAutocompleteModel": {
35 "title": "Codestral",
36 "provider": "mistral",
37 "model": "codestral-latest",
38 "apiKey": "<YOUR_CODESTRAL_API_KEY>"
39 }
40 }
41 ```
42 </Tab>
43</Tabs>
44
45<Tip>
46 **Codestral API Key**: The API keys for Codestral and the general Mistral APIs
47 are different. If you are using Codestral, you probably want a Codestral API
48 key, but if you are sharing the key as a team or otherwise want to use
49 `api.mistral.ai`, then make sure to set `"apiBase":
50 "https://api.mistral.ai/v1"` in your `tabAutocompleteModel`.
51</Tip>
52
53## How to Set Up Autocomplete in Continue with Ollama (Local Model)
54
55If you'd like to run your autocomplete model locally, we recommend using Ollama. To do this, first download the latest version of Ollama from [here](https://ollama.ai). Then, run the following command to download our recommended model:
56
57```bash
58ollama run qwen2.5-coder:1.5b
59```
60
61Then, add the model to your configuration:
62
63<Tabs>
64 <Tab title="Hub">
65 [Ollama Qwen 2.5 Coder 1.5B model block](https://hub.continue.dev/ollama/qwen2.5-coder-1.5b)
66 </Tab>
67 <Tab title="YAML">
68 ```yaml title="config.yaml"
69 models:
70 - name: Qwen 1.5b Autocomplete Model
71 provider: ollama
72 model: qwen2.5-coder:1.5b
73 roles:
74 - autocomplete
75 ```
76 </Tab>
77 <Tab title="JSON">
78 ```json title="config.json"
79 {
80 "tabAutocompleteModel": {
81 "title": "Qwen 1.5b Autocomplete Model",
82 "provider": "ollama",
83 "model": "qwen2.5-coder:1.5b",
84 }
85 }
86 ```
87 </Tab>
88</Tabs>
89
90Once the model has been downloaded, you should begin to see completions in VS Code.
91
92<Note>
93 Typically, thinking-type models are not recommended as they generate more
94 slowly and are not suitable for scenarios that require speed.
95</Note>
96
97However, if you use any thinking-switchable models, you can configure these models for autocomplete functions by turning off the thinking mode.
98
99For example:
100
101<Tabs>
102<Tab title="YAML">
103
104```yaml title="config.yaml"
105models:
106 - name: Qwen3 without Thinking for Autocomplete
107 provider: ollama
108 model: qwen3:4b # qwen3 is a thinking-switchable model
109 roles:
110 - autocomplete
111 requestOptions:
112 extraBodyProperties:
113 think: false # turning off the thinking
114```
115
116</Tab>
117</Tabs>
118
119Then, in the continue panel, select this model as the default model for autocomplete.
120
121## Autocomplete Configuration Options in Continue
122
123### Autocomplete Models Available on the Continue Hub
124
125Explore autocomplete model configurations on [the hub](https://hub.continue.dev/explore/models?roles=autocomplete)
126
127### Customize Autocomplete User Settings in the Continue Extension
128
129{/* - `Use autocomplete cache`: If on, caches completions */}
130The following settings can be configured for autocompletion in the IDE extension [User Settings Page](../settings.md):
131
132- `Multiline Autocompletions`: Controls multiline completions for autocomplete. Can be set to `always`, `never`, or `auto`. Defaults to `auto`
133- `Disable autocomplete in files`: List of comma-separated glob pattern to disable autocomplete in matching files. E.g., "\_/.md, \*/.txt"
134
135### How to Configure Autocomplete with `config.json` (Deprecated Format)
136
137#### YAML Configuration
138
139The `config.yaml` format offers model-level configuration using the `autocompleteOptions` field. See the [YAML Reference](/reference#models) for more details.
140
141```yaml
142models:
143 - name: Codestral
144 provider: mistral
145 model: codestral-latest
146 roles:
147 - autocomplete
148 autocompleteOptions:
149 disable: false
150 maxPromptTokens: 1024
151 debounceDelay: 250
152 modelTimeout: 150
153 maxSuffixPercentage: 0.2
154 prefixPercentage: 0.3
155 onlyMyCode: true
156```
157
158#### JSON Configuration (Deprecated)
159
160The `config.json` configuration format offers configuration options through `tabAutocompleteOptions`. See the [JSON Reference](/reference/json-reference#tabautocomplete-options) for more details.
161
162## Autocomplete FAQs and Troubleshooting in Continue
163
164### I want better completions, should I use GPT-4?
165
166Perhaps surprisingly, the answer is no. The models that we suggest for autocomplete are trained with a highly specific prompt format, which allows them to respond to requests for completing code (see examples of these prompts [here](https://github.com/continuedev/continue/blob/main/core/autocomplete/templating/AutocompleteTemplate.ts)). Some of the best commercial models like GPT-4 or Claude are not trained with this prompt format, which means that they won't generate useful completions. Luckily, a huge model is not required for great autocomplete. Most of the state-of-the-art autocomplete models are no more than 10b parameters, and increasing beyond this does not significantly improve performance.
167
168### Autocomplete Not Working – How to Fix It
169
170Follow these steps to ensure that everything is set up correctly:
171
1721. Make sure you have the "Enable Tab Autocomplete" setting checked (in VS Code, you can toggle by clicking the "Continue" button in the status bar, and in JetBrains by going to Settings -> Tools -> Continue).
1732. Make sure you have downloaded Ollama.
1743. Run `ollama run qwen2.5-coder:1.5b` to verify that the model is downloaded.
1754. Make sure that any other completion providers are disabled (e.g. Copilot), as they may interfere.
1765. Check the output of the logs to find any potential errors: <kbd>cmd/ctrl</kbd> + <kbd>shift</kbd> + <kbd>P</kbd> -> "Toggle Developer Tools" -> "Console" tab in VS Code, ~/.continue/logs/core.log in JetBrains.
1776. Check VS Code settings to make sure that `"editor.inlineSuggest.enabled"` is set to `true` (use <kbd>cmd/ctrl</kbd> + <kbd>,</kbd> then search for this and check the box)
1787. If you are still having issues, please let us know in our [Discord](https://discord.gg/vapESyrFmJ) and we'll help as soon as possible.
179
180### Why Are My Completions Only Single-Line?
181
182To ensure that you receive multi-line completions, you can set `"multilineCompletions": "always"` in `tabAutocompleteOptions`. By default, it is `"auto"`. If you still find that you are only seeing single-line completions, this may be because some models tend to produce shorter completions when starting in the middle of a file. You can try temporarily moving text below your cursor out of your active file, or switching to a larger model.
183
184### How to Set a Trigger Key for Autocomplete Suggestions
185
186In VS Code, if you don't want to be shown suggestions automatically you can:
187
1881. Set `"editor.inlineSuggest.enabled": false` in VS Code settings to disable automatic suggestions
1892. Open "Keyboard Shortcuts" (cmd/ctrl+k, cmd/ctrl+s) and search for `editor.action.inlineSuggest.trigger`
1903. Click the "+" icon to add a new keybinding
1914. Press the key combination you want to use to trigger suggestions (e.g. <kbd>cmd/ctrl</kbd> + <kbd>space</kbd>)
1925. Now whenever you want to see a suggestion, you can press your key binding (e.g. <kbd>cmd/ctrl</kbd> + <kbd>space</kbd>) to trigger suggestions manually
193
194### Shortcut for Accepting One Line at a Time in Autocomplete
195
196This is a built-in feature of VS Code, but it's just a bit hidden. Follow these settings to reassign the keyboard shortcuts in VS Code:
197
1981. Press <kbd>Ctrl</kbd>+<kbd>Shift</kbd>+<kbd>P</kbd>, type the command: `Preferences: Open Keyboard Shortcuts`, and enter the keyboard shortcuts settings page.
1992. Search for `editor.action.inlineSuggest.acceptNextLine`.
2003. Set the key binding to <kbd>Tab</kbd>.
2014. Set the trigger condition (when) to `inlineSuggestionVisible && !editorReadonly`.
202 This will make multi-line completion (including continue and from VS Code built-in or other plugin snippets) still work, and you will see multi-line completion. However, Tab will only fill in one line at a time. Any unnecessary code can be canceled with <kbd>Esc</kbd>.
203 If you need to apply all the code, just press <kbd>Tab</kbd> multiple times.
204
205### How to Turn Off Autocomplete in Continue (VS Code and JetBrains)
206
207#### VS Code
208
209Click the "Continue" button in the status panel at the bottom right of the screen. The checkmark will become a "cancel" symbol and you will no longer see completions. You can click again to turn it back on.
210
211Alternatively, open VS Code settings, search for "Continue" and uncheck the box for "Enable Tab Autocomplete".
212
213You can also use the default shortcut to disable autocomplete directly using a chord: press and hold <kbd>ctrl/cmd</kbd> + <kbd>K</kbd> (continue holding <kbd>ctrl/cmd</kbd>) and press <kbd>ctrl/cmd</kbd> + <kbd>A</kbd>. This will turn off autocomplete without navigating through settings.
214
215#### JetBrains
216
217Open Settings -> Tools -> Continue and uncheck the box for "Enable Tab Autocomplete".
218
219#### Feedback
220
221If you're turning off autocomplete, we'd love to hear how we can improve! Please let us know in our [Discord](https://discord.gg/vapESyrFmJ) or file an issue on GitHub.