Elffuss BraidHub

kikocis/continue public

627d7d0d1f85 · 8.6 KiBRawPermalink
1---
2title: "Autocomplete"
3description: "Deep dive into Continue's autocomplete functionality and configuration"
4keywords: [autocomplete]
5---
6
7### Setting up with Codestral (recommended)
8
9If 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:
10
11<Tabs>
12 <Tab title="Hub">
13 [Mistral Codestral model block](https://hub.continue.dev/mistral/codestral)
14 </Tab>
15 <Tab title="YAML">
16 ```yaml title="config.yaml"
17 models:
18 - name: Codestral
19 provider: mistral
20 model: codestral-latest
21 apiKey: <YOUR_CODESTRAL_API_KEY>
22 roles:
23 - autocomplete
24 ```
25 </Tab>
26 <Tab title="JSON">
27 ```json title="config.json"
28 {
29 "tabAutocompleteModel": {
30 "title": "Codestral",
31 "provider": "mistral",
32 "model": "codestral-latest",
33 "apiKey": "<YOUR_CODESTRAL_API_KEY>"
34 }
35 }
36 ```
37 </Tab>
38</Tabs>
39
40<Tip>
41 **Codestral API Key**: The API keys for Codestral and the general Mistral APIs
42 are different. If you are using Codestral, you probably want a Codestral API
43 key, but if you are sharing the key as a team or otherwise want to use
44 `api.mistral.ai`, then make sure to set `"apiBase":
45 "https://api.mistral.ai/v1"` in your `tabAutocompleteModel`.
46</Tip>
47
48### Setting up with Ollama (default)
49
50If 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:
51
52```bash
53ollama run qwen2.5-coder:1.5b
54```
55
56Then, add the model to your configuration:
57
58<Tabs>
59 <Tab title="Hub">
60 [Ollama Qwen 2.5 Coder 1.5B model block](https://hub.continue.dev/ollama/qwen2.5-coder-1.5b)
61 </Tab>
62 <Tab title="YAML">
63 ```yaml title="config.yaml"
64 models:
65 - name: Qwen 1.5b Autocomplete Model
66 provider: ollama
67 model: qwen2.5-coder:1.5b
68 roles:
69 - autocomplete
70 ```
71 </Tab>
72 <Tab title="JSON">
73 ```json title="config.json"
74 {
75 "tabAutocompleteModel": {
76 "title": "Qwen 1.5b Autocomplete Model",
77 "provider": "ollama",
78 "model": "qwen2.5-coder:1.5b",
79 }
80 }
81 ```
82 </Tab>
83</Tabs>
84
85Once the model has been downloaded, you should begin to see completions in VS Code.
86
87NOTE: Typically, thinking-type models are not recommended as they generate more slowly and are not suitable for scenarios that require speed.
88
89However, if you use any thinking-switchable models, you can configure these models for autocomplete functions by turning off the thinking mode.
90
91For example:
92
93<Tabs>
94 <Tab title="YAML">
95 ```yaml title="config.yaml"
96 models:
97 - name: Qwen3 without Thinking for Autocomplete
98 provider: ollama
99 model: qwen3:4b # qwen3 is a thinking-switchable model
100 roles:
101 - autocomplete
102 requestOptions:
103 extraBodyProperties:
104 think: false # turning off the thinking
105 ```
106 </Tab>
107</Tabs>
108
109Then, in the continue panel, select this model as the default model for autocomplete.
110
111## Configuration Options
112
113### Hub Autocomplete models
114
115Explore autocomplete model configurations on [the hub](https://hub.continue.dev/explore/models?roles=autocomplete)
116
117### Autocomplete User Settings
118
119{/* - `Use autocomplete cache`: If on, caches completions */}
120The following settings can be configured for autocompletion in the IDE extension [User Settings Page](../settings.md):
121
122- `Multiline Autocompletions`: Controls multiline completions for autocomplete. Can be set to `always`, `never`, or `auto`. Defaults to `auto`
123- `Disable autocomplete in files`: List of comma-separated glob pattern to disable autocomplete in matching files. E.g., "\_/.md, \*/.txt"
124
125### `config.json` Configuration
126
127The `config.json` configuration format (deprecated) offers further configuration options through `tabAutocompleteOptions`. See the [JSON Reference](/reference) for more details.
128
129## FAQs
130
131### I want better completions, should I use GPT-4?
132
133Perhaps 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.
134
135### I'm not seeing any completions
136
137Follow these steps to ensure that everything is set up correctly:
138
1391. 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).
1402. Make sure you have downloaded Ollama.
1413. Run `ollama run qwen2.5-coder:1.5b` to verify that the model is downloaded.
1424. Make sure that any other completion providers are disabled (e.g. Copilot), as they may interfere.
1435. 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.
1446. 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)
1457. 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.
146
147### Completions are only ever single-line
148
149To 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.
150
151### Can I configure a "trigger key" for autocomplete?
152
153Yes, in VS Code, if you don't want to be shown suggestions automatically you can:
154
1551. Set `"editor.inlineSuggest.enabled": false` in VS Code settings to disable automatic suggestions
1562. Open "Keyboard Shortcuts" (cmd/ctrl+k, cmd/ctrl+s) and search for `editor.action.inlineSuggest.trigger`
1573. Click the "+" icon to add a new keybinding
1584. Press the key combination you want to use to trigger suggestions (e.g. <kbd>cmd/ctrl</kbd> + <kbd>space</kbd>)
1595. 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
160
161### Is there a shortcut to accept one line at a time?
162
163This 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:
164
1651. Press <kbd>Ctrl</kbd>+<kbd>Shift</kbd>+<kbd>P</kbd>, type the command: `Preferences: Open Keyboard Shortcuts`, and enter the keyboard shortcuts settings page.
1662. Search for `editor.action.inlineSuggest.acceptNextLine`.
1673. Set the key binding to <kbd>Tab</kbd>.
1684. Set the trigger condition (when) to `inlineSuggestionVisible && !editorReadonly`.
169 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>.
170 If you need to apply all the code, just press <kbd>Tab</kbd> multiple times.
171
172### How to turn off autocomplete
173
174#### VS Code
175
176Click 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.
177
178Alternatively, open VS Code settings, search for "Continue" and uncheck the box for "Enable Tab Autocomplete".
179
180You 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.
181
182#### JetBrains
183
184Open Settings -> Tools -> Continue and uncheck the box for "Enable Tab Autocomplete".
185
186#### Feedback
187
188If 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.