Elffuss BraidHub

kikocis/continue public

Merge pull request #6594 from NGC13009/qwen3supportINautocomplete

Qwen3 support for autocomplete function
Changeset5e02d6a50c37f9727e3f21f47ab6b1d9e877c6302d56d5448965c6ef81874fab
AuthorDallin Romney <dallinromney@gmail.com> · 2025-07-13 15:15 -04:00
CommitterGitHub <noreply@github.com> · 2025-07-13 15:15 -04:00
Parentsd30610f7e942, 6c4de4429ace

Browse the files at this changeset

7 files changed

modified core/autocomplete/postprocessing/index.ts +10 −0
@@ -103,6 +103,16 @@
103103 }
104104 }
105105
106+ if (llm.model.includes("qwen3")) {
107+ // Qwen3 always starts from special thinking markers, and we don't want them to output these contents
108+ // Remove all content from "
109+ completion = completion.replace(/<think>.*?<\/think>/s, "");
110+ completion = completion.replace(/<\/think>/, "");
111+
112+ // Remove any number of newline characters at the beginning and end
113+ completion = completion.replace(/^\n+|\n+$/g, "");
114+ }
115+
106116 if (llm.model.includes("mercury") || llm.model.includes("granite")) {
107117 // Granite tends to repeat the start of the line in the completion output
108118 let prefixEnd = prefix.split("\n").pop();
modified core/package-lock.json +0 −0

Not shown: the file is larger than the hub shows, or this page holds as much as it shows. View the file.

modified docs/customize/deep-dives/autocomplete.mdx +28 −4
@@ -84,6 +84,30 @@
8484
8585 Once the model has been downloaded, you should begin to see completions in VS Code.
8686
87+NOTE: Typically, thinking-type models are not recommended as they generate more slowly and are not suitable for scenarios that require speed.
88+
89+However, if you use any thinking-switchable models, you can configure these models for autocomplete functions by turning off the thinking mode.
90+
91+For 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+
109+Then, in the continue panel, select this model as the default model for autocomplete.
110+
87111 ## Configuration Options
88112
89113 ### Hub Autocomplete models
@@ -138,12 +162,12 @@
138162
139163 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:
140164
141-1. Press `Ctrl+Shift+P`, type the command: `Preferences: Open Keyboard Shortcuts`, and enter the keyboard shortcuts settings page.
165+1. Press <kbd>Ctrl</kbd>+<kbd>Shift</kbd>+<kbd>P</kbd>, type the command: `Preferences: Open Keyboard Shortcuts`, and enter the keyboard shortcuts settings page.
142166 2. Search for `editor.action.inlineSuggest.acceptNextLine`.
143-3. Set the key binding to `Tab`.
167+3. Set the key binding to <kbd>Tab</kbd>.
144168 4. Set the trigger condition (when) to `inlineSuggestionVisible && !editorReadonly`.
145- 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`.
146- If you need to apply all the code, just press `Tab` multiple times.
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.
147171
148172 ### How to turn off autocomplete
149173
modified extensions/vscode/package-lock.json +0 −0

Not shown: the file is larger than the hub shows, or this page holds as much as it shows. View the file.

modified gui/package-lock.json +0 −0

Not shown: the file is larger than the hub shows, or this page holds as much as it shows. View the file.

modified packages/config-yaml/package-lock.json +0 −0

Not shown: the file is larger than the hub shows, or this page holds as much as it shows. View the file.

modified packages/openai-adapters/package-lock.json +2 −2
@@ -1,12 +1,12 @@
11 {
22 "name": "@continuedev/openai-adapters",
3- "version": "1.0.44",
3+ "version": "1.0.45",
44 "lockfileVersion": 3,
55 "requires": true,
66 "packages": {
77 "": {
88 "name": "@continuedev/openai-adapters",
9- "version": "1.0.44",
9+ "version": "1.0.45",
1010 "license": "Apache-2.0",
1111 "dependencies": {
1212 "@aws-sdk/client-bedrock-runtime": "^3.842.0",