Deep dive into Continue’s autocomplete functionality and configuration
If you want to have the best autocomplete experience, we recommend using Codestral, which is available through the Mistral API. To do this, obtain an API key and add it to your config:
Codestral API Key: The API keys for Codestral and the general Mistral APIs
are different. If you are using Codestral, you probably want a Codestral API
key, but if you are sharing the key as a team or otherwise want to use
api.mistral.ai
, then make sure to set "apiBase": "https://api.mistral.ai/v1"
in your tabAutocompleteModel
.
If 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. Then, run the following command to download our recommended model:
Then, add the model to your configuration:
Once the model has been downloaded, you should begin to see completions in VS Code.
NOTE: Typically, thinking-type models are not recommended as they generate more slowly and are not suitable for scenarios that require speed.
However, if you use any thinking-switchable models, you can configure these models for autocomplete functions by turning off the thinking mode.
For example:
Then, in the continue panel, select this model as the default model for autocomplete.
Explore autocomplete model configurations on the hub
The following settings can be configured for autocompletion in the IDE extension User Settings Page:
Multiline Autocompletions
: Controls multiline completions for autocomplete. Can be set to always
, never
, or auto
. Defaults to auto
Disable autocomplete in files
: List of comma-separated glob pattern to disable autocomplete in matching files. E.g., ”_/.md, */.txt”config.json
ConfigurationThe config.json
configuration format (deprecated) offers further configuration options through tabAutocompleteOptions
. See the JSON Reference for more details.
Perhaps 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). 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.
Follow these steps to ensure that everything is set up correctly:
ollama run qwen2.5-coder:1.5b
to verify that the model is downloaded."editor.inlineSuggest.enabled"
is set to true
(use cmd/ctrl + , then search for this and check the box)To 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.
Yes, in VS Code, if you don’t want to be shown suggestions automatically you can:
"editor.inlineSuggest.enabled": false
in VS Code settings to disable automatic suggestionseditor.action.inlineSuggest.trigger
This 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:
Preferences: Open Keyboard Shortcuts
, and enter the keyboard shortcuts settings page.editor.action.inlineSuggest.acceptNextLine
.inlineSuggestionVisible && !editorReadonly
.
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 Esc.
If you need to apply all the code, just press Tab multiple times.Click 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.
Alternatively, open VS Code settings, search for “Continue” and uncheck the box for “Enable Tab Autocomplete”.
You can also use the default shortcut to disable autocomplete directly using a chord: press and hold ctrl/cmd + K (continue holding ctrl/cmd) and press ctrl/cmd + A. This will turn off autocomplete without navigating through settings.
Open Settings -> Tools -> Continue and uncheck the box for “Enable Tab Autocomplete”.
If you’re turning off autocomplete, we’d love to hear how we can improve! Please let us know in our Discord or file an issue on GitHub.