From df6dc81b69fb5596c7eab96c25bc4e685398ec7c Mon Sep 17 00:00:00 2001 From: Nate Sesti Date: Fri, 1 Mar 2024 10:33:05 -0500 Subject: [PATCH 01/15] =?UTF-8?q?=F0=9F=93=9D=20note=20about=20limitations?= =?UTF-8?q?=20of=20crawler?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/docs/customization/context-providers.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/docs/docs/customization/context-providers.md b/docs/docs/customization/context-providers.md index 77c54fb97..e4ce6c35b 100644 --- a/docs/docs/customization/context-providers.md +++ b/docs/docs/customization/context-providers.md @@ -36,6 +36,8 @@ Type '@terminal' to reference the contents of your IDE's terminal. Type `@docs` to index and retrieve snippets from any documentation site. You can add any site by selecting "Add Docs" in the dropdown, then entering the root URL of the documentation site and a title to remember it by. After the site has been indexed, you can type `@docs`, select your documentation from the dropdown, and Continue will use similarity search to automatically find important sections when answering your question. +> The crawler currently works only on static sites that don't require Javascript to load. An example of a page that won't be correctly indexed is [the OpenAI documentation](https://platform.openai.com/docs/overview) + ```json { "name": "docs" } ``` From b50a55c6ed2c70717395d30b3d3b18b7cda67bb5 Mon Sep 17 00:00:00 2001 From: Nate Sesti Date: Sat, 2 Mar 2024 09:25:44 -0500 Subject: [PATCH 02/15] =?UTF-8?q?=F0=9F=93=9D=20improve=20troubleshooting?= =?UTF-8?q?=20docs?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/docs/troubleshooting.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/docs/docs/troubleshooting.md b/docs/docs/troubleshooting.md index a733ec327..bc3196aaa 100644 --- a/docs/docs/troubleshooting.md +++ b/docs/docs/troubleshooting.md @@ -39,6 +39,14 @@ If you're seeing a `fetch failed` error and your network requires custom certifi You may also set `requestOptions.caBundlePath` to an array of paths to multiple certificates. +## Upgrade VS Code Version + +Continue is built against Node.js version 19.0.0 and may not be compatible with older versions of Node. If the extension completely fails to load (e.g. pressing ctrl/cmd+L causes a warning that the command does not exist, and the sidebar does not load), you may want to try upgrading VS Code to the latest version. + +## Android Studio - JCEF Not Supported + +Certain versions of Android Studio, unlike other JetBrains IDEs, do not by default support the Java Chromium Embedded Framework, which is required for Continue's web-based sidebar. If you see an error saying that JCEF failed to initialize, you may be able to solve the problem by [changing your boot runtime](https://github.com/continuedev/continue/issues/596#issuecomment-1789327178). + ## Download a Newer Version If you are using an older version of the Continue extension, particularly one which depends on the separate Python server, we would recommend downloading the latest version of the extension, as we are constantly making bug fixes and are likely to have solved any major issues. From 8bc6280c10120df98d658dd0822b90dcf2cafe4c Mon Sep 17 00:00:00 2001 From: yuiseki Date: Sun, 3 Mar 2024 02:41:50 +0900 Subject: [PATCH 03/15] tweak: Update docs and messages about ollama (#914) * Update docs and messages about ollama * remove `ollama serve` * remove `ollama serve` --- docs/docs/walkthroughs/codellama.md | 4 ++-- docs/docs/walkthroughs/tab-autocomplete.md | 4 ++-- extensions/vscode/src/loadConfig.ts | 6 +++--- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/docs/docs/walkthroughs/codellama.md b/docs/docs/walkthroughs/codellama.md index 961788cc6..89177abf9 100644 --- a/docs/docs/walkthroughs/codellama.md +++ b/docs/docs/walkthroughs/codellama.md @@ -32,7 +32,7 @@ If you haven't already installed Continue, you can do that [here](https://market ## Ollama 1. Download Ollama [here](https://ollama.ai/) (it should walk you through the rest of these steps) -2. Open a terminal and run `ollama run codellama` +2. Open a terminal and run `ollama pull codellama` 3. Change your Continue config file like this: ```json title="~/.continue/config.json" @@ -41,7 +41,7 @@ If you haven't already installed Continue, you can do that [here](https://market { "title": "Code Llama", "provider": "ollama", - "model": "codellama-7b" + "model": "codellama:7b" } ] } diff --git a/docs/docs/walkthroughs/tab-autocomplete.md b/docs/docs/walkthroughs/tab-autocomplete.md index aa1a024ab..3fca6d906 100644 --- a/docs/docs/walkthroughs/tab-autocomplete.md +++ b/docs/docs/walkthroughs/tab-autocomplete.md @@ -7,7 +7,7 @@ Continue now provides support for tab autocomplete in [the VS Code extension](ht We recommend setting up tab-autocomplete with a local Ollama instance. 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: ```bash -ollama run starcoder:3b +ollama pull starcoder:3b ``` Once it has been downloaded, you should begin to see completions in VS Code. @@ -78,7 +78,7 @@ Follow these steps to ensure that everything is set up correctly: 1. Make sure you have the pre-release version of the extension installed. 2. Make sure you have the "Enable Tab Autocomplete" setting checked (can toggle by clicking the "Continue" button in the status bar). 3. Make sure you have downloaded Ollama. -4. Run `ollama run starcoder:3b` to verify that the model is downloaded. +4. Run `ollama pull starcoder:3b` to verify that the model is downloaded. 5. Make sure that any other completion providers are disabled (e.g. Copilot), as they may interfere. 6. Make sure that you aren't also using another Ollama model for chat. This will cause Ollama to constantly load and unload the models from memory, resulting in slow responses (or none at all) for both. 7. Check the output of the logs to find any potential errors (cmd/ctrl+shift+p -> "Toggle Developer Tools" -> "Console" tab). diff --git a/extensions/vscode/src/loadConfig.ts b/extensions/vscode/src/loadConfig.ts index 4f2ddc502..267c8a8be 100644 --- a/extensions/vscode/src/loadConfig.ts +++ b/extensions/vscode/src/loadConfig.ts @@ -159,7 +159,7 @@ function setupLlm(llm: ILLM): ILLM { if (resp.status === 404 && !resp.url.includes("/v1")) { if (text.includes("try pulling it first")) { const model = JSON.parse(text).error.split(" ")[1].slice(1, -1); - text = `The model "${model}" was not found. To download it, run \`ollama run ${model}\`.`; + text = `The model "${model}" was not found. To download it, run \`ollama pull ${model}\`.`; } else if (text.includes("/api/chat")) { text = "The /api/chat endpoint was not found. This may mean that you are using an older version of Ollama that does not support /api/chat. Upgrading to the latest version will solve the issue."; @@ -239,7 +239,7 @@ export class TabAutocompleteModel { if (!TabAutocompleteModel.shownDeepseekWarning) { vscode.window .showWarningMessage( - `Your local Ollama instance doesn't yet have DeepSeek Coder. To download this model, run \`ollama run deepseek-coder:1.3b-base\` (recommended). If you'd like to use a custom model for tab autocomplete, learn more in the docs`, + `Your local Ollama instance doesn't yet have DeepSeek Coder. To download this model, run \`ollama pull deepseek-coder:1.3b-base\` (recommended). If you'd like to use a custom model for tab autocomplete, learn more in the docs`, "Documentation", "Copy Command" ) @@ -252,7 +252,7 @@ export class TabAutocompleteModel { ); } else if (value === "Copy Command") { vscode.env.clipboard.writeText( - "ollama run deepseek-coder:1.3b-base" + "ollama pull deepseek-coder:1.3b-base" ); } }); From 752a2dffa9be59e2934a8574235518126fa7add2 Mon Sep 17 00:00:00 2001 From: Nate Sesti Date: Tue, 5 Mar 2024 22:19:34 -0800 Subject: [PATCH 04/15] =?UTF-8?q?=E2=9C=A8=20release=20tab-autocomplete=20?= =?UTF-8?q?in=20main?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .changes/extensions/vscode/0.8.15.md | 3 +++ .../unreleased/Added-20240303-190039.yaml | 4 --- core/llm/llms/FreeTrial.ts | 4 +-- core/llm/llms/Ollama.ts | 2 +- extensions/vscode/media/welcome.md | 2 +- extensions/vscode/package.json | 2 +- .../vscode/src/extension/vscodeExtension.ts | 27 ++++++++----------- .../vscode/src/util/loadAutocompleteModel.ts | 4 +-- 8 files changed, 21 insertions(+), 27 deletions(-) create mode 100644 .changes/extensions/vscode/0.8.15.md delete mode 100644 .changes/unreleased/Added-20240303-190039.yaml diff --git a/.changes/extensions/vscode/0.8.15.md b/.changes/extensions/vscode/0.8.15.md new file mode 100644 index 000000000..0bee662f3 --- /dev/null +++ b/.changes/extensions/vscode/0.8.15.md @@ -0,0 +1,3 @@ +## 0.8.15 - 2024-03-05 +### Added +* Tab-autocomplete in beta diff --git a/.changes/unreleased/Added-20240303-190039.yaml b/.changes/unreleased/Added-20240303-190039.yaml deleted file mode 100644 index 1c9937e1e..000000000 --- a/.changes/unreleased/Added-20240303-190039.yaml +++ /dev/null @@ -1,4 +0,0 @@ -project: extensions/vscode -kind: Added -body: Tab-autocomplete in beta -time: 2024-03-03T19:00:39.909292-05:00 diff --git a/core/llm/llms/FreeTrial.ts b/core/llm/llms/FreeTrial.ts index 463f41cc0..709fe2f2f 100644 --- a/core/llm/llms/FreeTrial.ts +++ b/core/llm/llms/FreeTrial.ts @@ -3,7 +3,7 @@ import { ChatMessage, CompletionOptions, ModelProvider } from "../.."; import { streamResponse } from "../stream"; // const SERVER_URL = "http://localhost:3000"; -const SERVER_URL = "https://node-proxy-server-green-l6vsfbzhba-uw.a.run.app"; +const SERVER_URL = "https://node-proxy-server-blue-l6vsfbzhba-uw.a.run.app"; class FreeTrial extends BaseLLM { static providerName: ModelProvider = "free-trial"; @@ -21,7 +21,7 @@ class FreeTrial extends BaseLLM { frequency_penalty: options.frequencyPenalty, presence_penalty: options.presencePenalty, max_tokens: options.maxTokens, - stop: options.stop?.slice(0, 4), + stop: options.stop?.slice(0, 2), temperature: options.temperature, top_p: options.topP, }; diff --git a/core/llm/llms/Ollama.ts b/core/llm/llms/Ollama.ts index 1f273560d..cc9795c7e 100644 --- a/core/llm/llms/Ollama.ts +++ b/core/llm/llms/Ollama.ts @@ -88,7 +88,7 @@ class Ollama extends BaseLLM { "deepseek-33b": "deepseek-coder:33b", "neural-chat-7b": "neural-chat:7b-v3.3", "starcoder-1b": "starcoder:1b", - "starcoder-3b": "starcoder:3b", + "starcoder-3b": "starcoder2:3b", "stable-code-3b": "stable-code:3b", }[this.model] || this.model ); diff --git a/extensions/vscode/media/welcome.md b/extensions/vscode/media/welcome.md index d407ba29f..969305dbc 100644 --- a/extensions/vscode/media/welcome.md +++ b/extensions/vscode/media/welcome.md @@ -21,7 +21,7 @@ Continue is currently in the left sidebar, but we recommend moving it to the rig ## ⚡️ Setting up tab autocomplete 1. Download [Ollama](https://ollama.ai) -2. Download starcoder:3b by running `ollama run starcoder:3b` in the terminal +2. Download starcoder2:3b by running `ollama run starcoder2:3b` in the terminal 3. That's it! You can disable autocomplete at any time by clicking the `Continue` button in the status bar (bottom right of the VS Code window) > Learn how to customize your autocomplete experience in [our walkthrough](https://continue.dev/docs/walkthroughs/tab-autocomplete) diff --git a/extensions/vscode/package.json b/extensions/vscode/package.json index df902ec6d..41af37d1d 100644 --- a/extensions/vscode/package.json +++ b/extensions/vscode/package.json @@ -1,7 +1,7 @@ { "name": "continue", "icon": "media/icon.png", - "version": "0.9.80", + "version": "0.8.14", "repository": { "type": "git", "url": "https://github.com/continuedev/continue" diff --git a/extensions/vscode/src/extension/vscodeExtension.ts b/extensions/vscode/src/extension/vscodeExtension.ts index 00521d338..73d2809d5 100644 --- a/extensions/vscode/src/extension/vscodeExtension.ts +++ b/extensions/vscode/src/extension/vscodeExtension.ts @@ -116,23 +116,18 @@ export class VsCodeExtension { const config = vscode.workspace.getConfiguration("continue"); const enabled = config.get("enableTabAutocomplete"); - // Register inline completion provider (odd versions are pre-release) - if ( - parseInt(context.extension.packageJSON.version.split(".")[1]) % 2 !== - 0 - ) { - setupStatusBar(enabled); - context.subscriptions.push( - vscode.languages.registerInlineCompletionItemProvider( - [{ pattern: "**" }], - new ContinueCompletionProvider( - this.configHandler, - this.ide, - this.tabAutocompleteModel, - ), + // Register inline completion provider + setupStatusBar(enabled); + context.subscriptions.push( + vscode.languages.registerInlineCompletionItemProvider( + [{ pattern: "**" }], + new ContinueCompletionProvider( + this.configHandler, + this.ide, + this.tabAutocompleteModel, ), - ); - } + ), + ); // Commands registerAllCommands( diff --git a/extensions/vscode/src/util/loadAutocompleteModel.ts b/extensions/vscode/src/util/loadAutocompleteModel.ts index 41fd7f886..fbb0fc322 100644 --- a/extensions/vscode/src/util/loadAutocompleteModel.ts +++ b/extensions/vscode/src/util/loadAutocompleteModel.ts @@ -5,8 +5,8 @@ import * as vscode from "vscode"; export class TabAutocompleteModel { private _llm: ILLM | undefined; - private defaultTag: string = "starcoder:3b"; - private defaultTagName: string = "Starcoder 3b"; + private defaultTag: string = "starcoder2:3b"; + private defaultTagName: string = "Starcoder 2 3b"; private shownOllamaWarning: boolean = false; private shownDeepseekWarning: boolean = false; From 55b34c13703f8b3ddd0ebc3e4ad40e4ac08f0c1f Mon Sep 17 00:00:00 2001 From: Nate Sesti Date: Tue, 5 Mar 2024 22:22:14 -0800 Subject: [PATCH 05/15] =?UTF-8?q?=F0=9F=93=9D=20update=20ollama=20pull=20-?= =?UTF-8?q?>=20run?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/docs/walkthroughs/codellama.md | 2 +- docs/docs/walkthroughs/tab-autocomplete.md | 8 ++++---- extensions/vscode/config_schema.json | 4 ++-- gui/src/util/modelData.ts | 2 +- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/docs/docs/walkthroughs/codellama.md b/docs/docs/walkthroughs/codellama.md index 89177abf9..b5d245abb 100644 --- a/docs/docs/walkthroughs/codellama.md +++ b/docs/docs/walkthroughs/codellama.md @@ -32,7 +32,7 @@ If you haven't already installed Continue, you can do that [here](https://market ## Ollama 1. Download Ollama [here](https://ollama.ai/) (it should walk you through the rest of these steps) -2. Open a terminal and run `ollama pull codellama` +2. Open a terminal and run `ollama run codellama` 3. Change your Continue config file like this: ```json title="~/.continue/config.json" diff --git a/docs/docs/walkthroughs/tab-autocomplete.md b/docs/docs/walkthroughs/tab-autocomplete.md index 3fca6d906..82d415389 100644 --- a/docs/docs/walkthroughs/tab-autocomplete.md +++ b/docs/docs/walkthroughs/tab-autocomplete.md @@ -7,7 +7,7 @@ Continue now provides support for tab autocomplete in [the VS Code extension](ht We recommend setting up tab-autocomplete with a local Ollama instance. 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: ```bash -ollama pull starcoder:3b +ollama run starcoder2:3b ``` Once it has been downloaded, you should begin to see completions in VS Code. @@ -21,7 +21,7 @@ All of the configuration options available for chat models are available to use "tabAutocompleteModel": { "title": "Tab Autocomplete Model", "provider": "ollama", - "model": "starcoder:3b", + "model": "starcoder2:3b", "apiBase": "https://" }, ... @@ -58,7 +58,7 @@ This object allows you to customize the behavior of tab-autocomplete. The availa "tabAutocompleteModel": { "title": "Tab Autocomplete Model", "provider": "ollama", - "model": "starcoder:3b", + "model": "starcoder2:3b", "apiBase": "https://" }, "tabAutocompleteOptions": { @@ -78,7 +78,7 @@ Follow these steps to ensure that everything is set up correctly: 1. Make sure you have the pre-release version of the extension installed. 2. Make sure you have the "Enable Tab Autocomplete" setting checked (can toggle by clicking the "Continue" button in the status bar). 3. Make sure you have downloaded Ollama. -4. Run `ollama pull starcoder:3b` to verify that the model is downloaded. +4. Run `ollama run starcoder2:3b` to verify that the model is downloaded. 5. Make sure that any other completion providers are disabled (e.g. Copilot), as they may interfere. 6. Make sure that you aren't also using another Ollama model for chat. This will cause Ollama to constantly load and unload the models from memory, resulting in slow responses (or none at all) for both. 7. Check the output of the logs to find any potential errors (cmd/ctrl+shift+p -> "Toggle Developer Tools" -> "Console" tab). diff --git a/extensions/vscode/config_schema.json b/extensions/vscode/config_schema.json index 6bdcb3e82..663c9e52f 100644 --- a/extensions/vscode/config_schema.json +++ b/extensions/vscode/config_schema.json @@ -141,7 +141,7 @@ "### Free Trial\nNew users can try out Continue for free using a proxy server that securely makes calls to OpenAI using our API key. If you are ready to use your own API key or have used all 250 free uses, you can enter your API key in config.py where it says `apiKey=\"\"` or select another model provider.\n> [Reference](https://continue.dev/docs/reference/Model%20Providers/freetrial)", "### Anthropic\nTo get started with Anthropic models, you first need to sign up for the open beta [here](https://claude.ai/login) to obtain an API key.\n> [Reference](https://continue.dev/docs/reference/Model%20Providers/anthropicllm)", "### Together\nTogether is a hosted service that provides extremely fast streaming of open-source language models. To get started with Together:\n1. Obtain an API key from [here](https://together.ai)\n2. Paste below\n3. Select a model preset\n> [Reference](https://continue.dev/docs/reference/Model%20Providers/togetherllm)", - "### Ollama\nTo get started with Ollama, follow these steps:\n1. Download from [ollama.ai](https://ollama.ai/) and open the application\n2. Open a terminal and run `ollama pull `. Example model names are `codellama:7b-instruct` or `llama2:7b-text`. You can find the full list [here](https://ollama.ai/library).\n3. Make sure that the model name used in step 2 is the same as the one in config.py (e.g. `model=\"codellama:7b-instruct\"`)\n4. Once the model has finished downloading, you can start asking questions through Continue.\n> [Reference](https://continue.dev/docs/reference/Model%20Providers/ollama)", + "### Ollama\nTo get started with Ollama, follow these steps:\n1. Download from [ollama.ai](https://ollama.ai/) and open the application\n2. Open a terminal and run `ollama run `. Example model names are `codellama:7b-instruct` or `llama2:7b-text`. You can find the full list [here](https://ollama.ai/library).\n3. Make sure that the model name used in step 2 is the same as the one in config.py (e.g. `model=\"codellama:7b-instruct\"`)\n4. Once the model has finished downloading, you can start asking questions through Continue.\n> [Reference](https://continue.dev/docs/reference/Model%20Providers/ollama)", "### Huggingface TGI\n\n> [Reference](https://continue.dev/docs/reference/Model%20Providers/huggingfacetgi)", "### Huggingface Inference API\n\n> [Reference](https://continue.dev/docs/reference/Model%20Providers/huggingfaceinferenceapi)", "### Llama.cpp\nllama.cpp comes with a [built-in server](https://github.com/ggerganov/llama.cpp/tree/master/examples/server#llamacppexampleserver) that can be run from source. To do this:\n\n1. Clone the repository with `git clone https://github.com/ggerganov/llama.cpp`.\n2. `cd llama.cpp`\n3. Run `make` to build the server.\n4. Download the model you'd like to use and place it in the `llama.cpp/models` directory (the best place to find models is [The Bloke on HuggingFace](https://huggingface.co/TheBloke))\n5. Run the llama.cpp server with the command below (replacing with the model you downloaded):\n\n```shell\n.\\server.exe -c 4096 --host 0.0.0.0 -t 16 --mlock -m models/codellama-7b-instruct.Q8_0.gguf\n```\n\nAfter it's up and running, you can start using Continue.\n> [Reference](https://continue.dev/docs/reference/Model%20Providers/llamacpp)", @@ -1528,7 +1528,7 @@ }, "tabAutocompleteModel": { "title": "Tab Autocomplete Model", - "markdownDescription": "The model used for tab autocompletion. If undefined, Continue will default to using starcoder:3b on a local Ollama instance.\n\n*IMPORTANT*:\n\nIf you use a custom model, ensure that it is one trained for fill-in-the-middle completions. An instruct model is typically not well-suited to autocomplete and you may receive unsatisfactory completions.", + "markdownDescription": "The model used for tab autocompletion. If undefined, Continue will default to using starcoder2:3b on a local Ollama instance.\n\n*IMPORTANT*:\n\nIf you use a custom model, ensure that it is one trained for fill-in-the-middle completions. An instruct model is typically not well-suited to autocomplete and you may receive unsatisfactory completions.", "default": { "title": "Tab Autocomplete Model", "provider": "ollama", diff --git a/gui/src/util/modelData.ts b/gui/src/util/modelData.ts index 40a823634..52a316840 100644 --- a/gui/src/util/modelData.ts +++ b/gui/src/util/modelData.ts @@ -687,7 +687,7 @@ export const PROVIDER_INFO: { [key: string]: ModelInfo } = { description: "One of the fastest ways to get started with local models on Mac, Linux, or Windows", longDescription: - 'To get started with Ollama, follow these steps:\n1. Download from [ollama.ai](https://ollama.ai/) and open the application\n2. Open a terminal and run `ollama pull `. Example model names are `codellama:7b-instruct` or `llama2:7b-text`. You can find the full list [here](https://ollama.ai/library).\n3. Make sure that the model name used in step 2 is the same as the one in config.py (e.g. `model="codellama:7b-instruct"`)\n4. Once the model has finished downloading, you can start asking questions through Continue.', + 'To get started with Ollama, follow these steps:\n1. Download from [ollama.ai](https://ollama.ai/) and open the application\n2. Open a terminal and run `ollama run `. Example model names are `codellama:7b-instruct` or `llama2:7b-text`. You can find the full list [here](https://ollama.ai/library).\n3. Make sure that the model name used in step 2 is the same as the one in config.py (e.g. `model="codellama:7b-instruct"`)\n4. Once the model has finished downloading, you can start asking questions through Continue.', icon: "ollama.png", tags: [ModelProviderTag["Local"], ModelProviderTag["Open-Source"]], packages: [ From e090f1f7d8c3407e0c29a60107145832dd9ef78c Mon Sep 17 00:00:00 2001 From: Nate Sesti Date: Wed, 6 Mar 2024 14:29:14 -0800 Subject: [PATCH 06/15] =?UTF-8?q?=F0=9F=90=9B=20filter=20out=20trailing=20?= =?UTF-8?q?EOT=20token=20from=20Together?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- core/llm/llms/OpenAI.ts | 2 +- docs/static/schemas/config.json | 4 ++-- extensions/intellij/src/main/resources/config_schema.json | 4 ++-- extensions/vscode/continue_rc_schema.json | 4 ++-- extensions/vscode/manual-testing-sandbox/example.ts | 3 +-- extensions/vscode/package-lock.json | 4 ++-- 6 files changed, 10 insertions(+), 11 deletions(-) diff --git a/core/llm/llms/OpenAI.ts b/core/llm/llms/OpenAI.ts index 56271632a..86961ea85 100644 --- a/core/llm/llms/OpenAI.ts +++ b/core/llm/llms/OpenAI.ts @@ -148,7 +148,7 @@ class OpenAI extends BaseLLM { }); for await (const value of streamSse(response)) { - if (value.choices?.[0]?.text) { + if (value.choices?.[0]?.text && value.finish_reason !== "eos") { yield value.choices[0].text; } } diff --git a/docs/static/schemas/config.json b/docs/static/schemas/config.json index 6bdcb3e82..663c9e52f 100644 --- a/docs/static/schemas/config.json +++ b/docs/static/schemas/config.json @@ -141,7 +141,7 @@ "### Free Trial\nNew users can try out Continue for free using a proxy server that securely makes calls to OpenAI using our API key. If you are ready to use your own API key or have used all 250 free uses, you can enter your API key in config.py where it says `apiKey=\"\"` or select another model provider.\n> [Reference](https://continue.dev/docs/reference/Model%20Providers/freetrial)", "### Anthropic\nTo get started with Anthropic models, you first need to sign up for the open beta [here](https://claude.ai/login) to obtain an API key.\n> [Reference](https://continue.dev/docs/reference/Model%20Providers/anthropicllm)", "### Together\nTogether is a hosted service that provides extremely fast streaming of open-source language models. To get started with Together:\n1. Obtain an API key from [here](https://together.ai)\n2. Paste below\n3. Select a model preset\n> [Reference](https://continue.dev/docs/reference/Model%20Providers/togetherllm)", - "### Ollama\nTo get started with Ollama, follow these steps:\n1. Download from [ollama.ai](https://ollama.ai/) and open the application\n2. Open a terminal and run `ollama pull `. Example model names are `codellama:7b-instruct` or `llama2:7b-text`. You can find the full list [here](https://ollama.ai/library).\n3. Make sure that the model name used in step 2 is the same as the one in config.py (e.g. `model=\"codellama:7b-instruct\"`)\n4. Once the model has finished downloading, you can start asking questions through Continue.\n> [Reference](https://continue.dev/docs/reference/Model%20Providers/ollama)", + "### Ollama\nTo get started with Ollama, follow these steps:\n1. Download from [ollama.ai](https://ollama.ai/) and open the application\n2. Open a terminal and run `ollama run `. Example model names are `codellama:7b-instruct` or `llama2:7b-text`. You can find the full list [here](https://ollama.ai/library).\n3. Make sure that the model name used in step 2 is the same as the one in config.py (e.g. `model=\"codellama:7b-instruct\"`)\n4. Once the model has finished downloading, you can start asking questions through Continue.\n> [Reference](https://continue.dev/docs/reference/Model%20Providers/ollama)", "### Huggingface TGI\n\n> [Reference](https://continue.dev/docs/reference/Model%20Providers/huggingfacetgi)", "### Huggingface Inference API\n\n> [Reference](https://continue.dev/docs/reference/Model%20Providers/huggingfaceinferenceapi)", "### Llama.cpp\nllama.cpp comes with a [built-in server](https://github.com/ggerganov/llama.cpp/tree/master/examples/server#llamacppexampleserver) that can be run from source. To do this:\n\n1. Clone the repository with `git clone https://github.com/ggerganov/llama.cpp`.\n2. `cd llama.cpp`\n3. Run `make` to build the server.\n4. Download the model you'd like to use and place it in the `llama.cpp/models` directory (the best place to find models is [The Bloke on HuggingFace](https://huggingface.co/TheBloke))\n5. Run the llama.cpp server with the command below (replacing with the model you downloaded):\n\n```shell\n.\\server.exe -c 4096 --host 0.0.0.0 -t 16 --mlock -m models/codellama-7b-instruct.Q8_0.gguf\n```\n\nAfter it's up and running, you can start using Continue.\n> [Reference](https://continue.dev/docs/reference/Model%20Providers/llamacpp)", @@ -1528,7 +1528,7 @@ }, "tabAutocompleteModel": { "title": "Tab Autocomplete Model", - "markdownDescription": "The model used for tab autocompletion. If undefined, Continue will default to using starcoder:3b on a local Ollama instance.\n\n*IMPORTANT*:\n\nIf you use a custom model, ensure that it is one trained for fill-in-the-middle completions. An instruct model is typically not well-suited to autocomplete and you may receive unsatisfactory completions.", + "markdownDescription": "The model used for tab autocompletion. If undefined, Continue will default to using starcoder2:3b on a local Ollama instance.\n\n*IMPORTANT*:\n\nIf you use a custom model, ensure that it is one trained for fill-in-the-middle completions. An instruct model is typically not well-suited to autocomplete and you may receive unsatisfactory completions.", "default": { "title": "Tab Autocomplete Model", "provider": "ollama", diff --git a/extensions/intellij/src/main/resources/config_schema.json b/extensions/intellij/src/main/resources/config_schema.json index 6bdcb3e82..663c9e52f 100644 --- a/extensions/intellij/src/main/resources/config_schema.json +++ b/extensions/intellij/src/main/resources/config_schema.json @@ -141,7 +141,7 @@ "### Free Trial\nNew users can try out Continue for free using a proxy server that securely makes calls to OpenAI using our API key. If you are ready to use your own API key or have used all 250 free uses, you can enter your API key in config.py where it says `apiKey=\"\"` or select another model provider.\n> [Reference](https://continue.dev/docs/reference/Model%20Providers/freetrial)", "### Anthropic\nTo get started with Anthropic models, you first need to sign up for the open beta [here](https://claude.ai/login) to obtain an API key.\n> [Reference](https://continue.dev/docs/reference/Model%20Providers/anthropicllm)", "### Together\nTogether is a hosted service that provides extremely fast streaming of open-source language models. To get started with Together:\n1. Obtain an API key from [here](https://together.ai)\n2. Paste below\n3. Select a model preset\n> [Reference](https://continue.dev/docs/reference/Model%20Providers/togetherllm)", - "### Ollama\nTo get started with Ollama, follow these steps:\n1. Download from [ollama.ai](https://ollama.ai/) and open the application\n2. Open a terminal and run `ollama pull `. Example model names are `codellama:7b-instruct` or `llama2:7b-text`. You can find the full list [here](https://ollama.ai/library).\n3. Make sure that the model name used in step 2 is the same as the one in config.py (e.g. `model=\"codellama:7b-instruct\"`)\n4. Once the model has finished downloading, you can start asking questions through Continue.\n> [Reference](https://continue.dev/docs/reference/Model%20Providers/ollama)", + "### Ollama\nTo get started with Ollama, follow these steps:\n1. Download from [ollama.ai](https://ollama.ai/) and open the application\n2. Open a terminal and run `ollama run `. Example model names are `codellama:7b-instruct` or `llama2:7b-text`. You can find the full list [here](https://ollama.ai/library).\n3. Make sure that the model name used in step 2 is the same as the one in config.py (e.g. `model=\"codellama:7b-instruct\"`)\n4. Once the model has finished downloading, you can start asking questions through Continue.\n> [Reference](https://continue.dev/docs/reference/Model%20Providers/ollama)", "### Huggingface TGI\n\n> [Reference](https://continue.dev/docs/reference/Model%20Providers/huggingfacetgi)", "### Huggingface Inference API\n\n> [Reference](https://continue.dev/docs/reference/Model%20Providers/huggingfaceinferenceapi)", "### Llama.cpp\nllama.cpp comes with a [built-in server](https://github.com/ggerganov/llama.cpp/tree/master/examples/server#llamacppexampleserver) that can be run from source. To do this:\n\n1. Clone the repository with `git clone https://github.com/ggerganov/llama.cpp`.\n2. `cd llama.cpp`\n3. Run `make` to build the server.\n4. Download the model you'd like to use and place it in the `llama.cpp/models` directory (the best place to find models is [The Bloke on HuggingFace](https://huggingface.co/TheBloke))\n5. Run the llama.cpp server with the command below (replacing with the model you downloaded):\n\n```shell\n.\\server.exe -c 4096 --host 0.0.0.0 -t 16 --mlock -m models/codellama-7b-instruct.Q8_0.gguf\n```\n\nAfter it's up and running, you can start using Continue.\n> [Reference](https://continue.dev/docs/reference/Model%20Providers/llamacpp)", @@ -1528,7 +1528,7 @@ }, "tabAutocompleteModel": { "title": "Tab Autocomplete Model", - "markdownDescription": "The model used for tab autocompletion. If undefined, Continue will default to using starcoder:3b on a local Ollama instance.\n\n*IMPORTANT*:\n\nIf you use a custom model, ensure that it is one trained for fill-in-the-middle completions. An instruct model is typically not well-suited to autocomplete and you may receive unsatisfactory completions.", + "markdownDescription": "The model used for tab autocompletion. If undefined, Continue will default to using starcoder2:3b on a local Ollama instance.\n\n*IMPORTANT*:\n\nIf you use a custom model, ensure that it is one trained for fill-in-the-middle completions. An instruct model is typically not well-suited to autocomplete and you may receive unsatisfactory completions.", "default": { "title": "Tab Autocomplete Model", "provider": "ollama", diff --git a/extensions/vscode/continue_rc_schema.json b/extensions/vscode/continue_rc_schema.json index 2687899f9..a722c32f5 100644 --- a/extensions/vscode/continue_rc_schema.json +++ b/extensions/vscode/continue_rc_schema.json @@ -141,7 +141,7 @@ "### Free Trial\nNew users can try out Continue for free using a proxy server that securely makes calls to OpenAI using our API key. If you are ready to use your own API key or have used all 250 free uses, you can enter your API key in config.py where it says `apiKey=\"\"` or select another model provider.\n> [Reference](https://continue.dev/docs/reference/Model%20Providers/freetrial)", "### Anthropic\nTo get started with Anthropic models, you first need to sign up for the open beta [here](https://claude.ai/login) to obtain an API key.\n> [Reference](https://continue.dev/docs/reference/Model%20Providers/anthropicllm)", "### Together\nTogether is a hosted service that provides extremely fast streaming of open-source language models. To get started with Together:\n1. Obtain an API key from [here](https://together.ai)\n2. Paste below\n3. Select a model preset\n> [Reference](https://continue.dev/docs/reference/Model%20Providers/togetherllm)", - "### Ollama\nTo get started with Ollama, follow these steps:\n1. Download from [ollama.ai](https://ollama.ai/) and open the application\n2. Open a terminal and run `ollama pull `. Example model names are `codellama:7b-instruct` or `llama2:7b-text`. You can find the full list [here](https://ollama.ai/library).\n3. Make sure that the model name used in step 2 is the same as the one in config.py (e.g. `model=\"codellama:7b-instruct\"`)\n4. Once the model has finished downloading, you can start asking questions through Continue.\n> [Reference](https://continue.dev/docs/reference/Model%20Providers/ollama)", + "### Ollama\nTo get started with Ollama, follow these steps:\n1. Download from [ollama.ai](https://ollama.ai/) and open the application\n2. Open a terminal and run `ollama run `. Example model names are `codellama:7b-instruct` or `llama2:7b-text`. You can find the full list [here](https://ollama.ai/library).\n3. Make sure that the model name used in step 2 is the same as the one in config.py (e.g. `model=\"codellama:7b-instruct\"`)\n4. Once the model has finished downloading, you can start asking questions through Continue.\n> [Reference](https://continue.dev/docs/reference/Model%20Providers/ollama)", "### Huggingface TGI\n\n> [Reference](https://continue.dev/docs/reference/Model%20Providers/huggingfacetgi)", "### Huggingface Inference API\n\n> [Reference](https://continue.dev/docs/reference/Model%20Providers/huggingfaceinferenceapi)", "### Llama.cpp\nllama.cpp comes with a [built-in server](https://github.com/ggerganov/llama.cpp/tree/master/examples/server#llamacppexampleserver) that can be run from source. To do this:\n\n1. Clone the repository with `git clone https://github.com/ggerganov/llama.cpp`.\n2. `cd llama.cpp`\n3. Run `make` to build the server.\n4. Download the model you'd like to use and place it in the `llama.cpp/models` directory (the best place to find models is [The Bloke on HuggingFace](https://huggingface.co/TheBloke))\n5. Run the llama.cpp server with the command below (replacing with the model you downloaded):\n\n```shell\n.\\server.exe -c 4096 --host 0.0.0.0 -t 16 --mlock -m models/codellama-7b-instruct.Q8_0.gguf\n```\n\nAfter it's up and running, you can start using Continue.\n> [Reference](https://continue.dev/docs/reference/Model%20Providers/llamacpp)", @@ -1716,7 +1716,7 @@ }, "tabAutocompleteModel": { "title": "Tab Autocomplete Model", - "markdownDescription": "The model used for tab autocompletion. If undefined, Continue will default to using starcoder:3b on a local Ollama instance.\n\n*IMPORTANT*:\n\nIf you use a custom model, ensure that it is one trained for fill-in-the-middle completions. An instruct model is typically not well-suited to autocomplete and you may receive unsatisfactory completions.", + "markdownDescription": "The model used for tab autocompletion. If undefined, Continue will default to using starcoder2:3b on a local Ollama instance.\n\n*IMPORTANT*:\n\nIf you use a custom model, ensure that it is one trained for fill-in-the-middle completions. An instruct model is typically not well-suited to autocomplete and you may receive unsatisfactory completions.", "default": { "title": "Tab Autocomplete Model", "provider": "ollama", diff --git a/extensions/vscode/manual-testing-sandbox/example.ts b/extensions/vscode/manual-testing-sandbox/example.ts index 5622d7172..07bec826c 100644 --- a/extensions/vscode/manual-testing-sandbox/example.ts +++ b/extensions/vscode/manual-testing-sandbox/example.ts @@ -9,5 +9,4 @@ let d = repeat(5, "a"); console.log(d); let e = factorial(3); -console.log(e); - +console.log(e); \ No newline at end of file diff --git a/extensions/vscode/package-lock.json b/extensions/vscode/package-lock.json index 4727ff71c..905761ca0 100644 --- a/extensions/vscode/package-lock.json +++ b/extensions/vscode/package-lock.json @@ -1,12 +1,12 @@ { "name": "continue", - "version": "0.9.80", + "version": "0.8.14", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "continue", - "version": "0.9.80", + "version": "0.8.14", "license": "Apache-2.0", "dependencies": { "@electron/rebuild": "^3.2.10", From 9f255845d45c4c47df3d73de4aca575cb1ef19f7 Mon Sep 17 00:00:00 2001 From: Nate Sesti Date: Wed, 6 Mar 2024 14:39:05 -0800 Subject: [PATCH 07/15] =?UTF-8?q?=F0=9F=93=9D=20reference=20.continuerc.js?= =?UTF-8?q?on=20more=20clearly=20in=20docs?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/docs/customization/overview.md | 2 ++ docs/docs/intro.md | 3 ++- docs/docs/reference/config.mdx | 3 +-- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/docs/docs/customization/overview.md b/docs/docs/customization/overview.md index 7e33a5cb4..8581225b8 100644 --- a/docs/docs/customization/overview.md +++ b/docs/docs/customization/overview.md @@ -14,3 +14,5 @@ Currently, you can customize the following: - [Context Providers](./context-providers.md) - Type '@' to easily add attachments to your prompt. Define which sources you want to reference, including GitHub Issues, terminal output, or automatically retrieved snippets from your codebase. - [Slash Commands](./slash-commands.md) - Call custom prompts or programs written with our SDK by typing `/`. - [Other Configuration](../reference/config.mdx) - Configure other settings like the system message and temperature. + +If you'd like to share Continue configuration with others, you can add a `.continuerc.json` to the root of your project. It has the same JSON Schema definition as `config.json`, and will automatically be applied on top of the local `config.json`. diff --git a/docs/docs/intro.md b/docs/docs/intro.md index 9cbca1e72..3a6a627c5 100644 --- a/docs/docs/intro.md +++ b/docs/docs/intro.md @@ -14,7 +14,8 @@ Many developers have begun to use ChatGPT while coding; however, the experience Some examples of what you can achieve are: -- Use cmd/ctrl + shift + L to generate boilerplate code from natural language +- Use cmd/ctrl + I to generate boilerplate code from natural language +- Use our local tab-autocomplete to get inline suggestions and write boilerplate code quickly - Highlight code, describe how to refactor it, and have changes streamed into your editor - Ask high-level questions about your codebase, with Continue automatically finding relevant files - Quickly generate unit tests for any function or class diff --git a/docs/docs/reference/config.mdx b/docs/docs/reference/config.mdx index 608072369..53f02b2be 100644 --- a/docs/docs/reference/config.mdx +++ b/docs/docs/reference/config.mdx @@ -8,8 +8,7 @@ The following shows the JSON Schema definition for `config.json`. You can also d From f3b0dbc9539ae169ed52bf1cbe11e0b31ae0ad70 Mon Sep 17 00:00:00 2001 From: Nate Sesti Date: Wed, 6 Mar 2024 16:34:17 -0800 Subject: [PATCH 08/15] =?UTF-8?q?=E2=9C=A8=20starcoder2=20FIM=20prompt=20f?= =?UTF-8?q?ormatting?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- core/autocomplete/charStream.ts | 11 ++ core/autocomplete/constructPrompt.ts | 168 ++++++++---------- core/autocomplete/lineStream.ts | 3 +- core/autocomplete/parameters.ts | 1 + core/autocomplete/templates.ts | 51 +++++- core/index.d.ts | 1 + extensions/vscode/.continuerc.json | 16 +- extensions/vscode/config_schema.json | 4 + .../src/autocomplete/completionProvider.ts | 2 +- .../src/autocomplete/getTabCompletion.ts | 58 +++++- .../markdown/CodeSnippetPreview.tsx | 6 +- 11 files changed, 211 insertions(+), 110 deletions(-) diff --git a/core/autocomplete/charStream.ts b/core/autocomplete/charStream.ts index eb912cb57..58f88bb88 100644 --- a/core/autocomplete/charStream.ts +++ b/core/autocomplete/charStream.ts @@ -24,3 +24,14 @@ export async function* onlyWhitespaceAfterEndOfLine( } yield pending; } + +export async function* noFirstCharNewline(stream: AsyncGenerator) { + let first = true; + for await (let char of stream) { + if (first) { + first = false; + if (char === "\n") return; + } + yield char; + } +} diff --git a/core/autocomplete/constructPrompt.ts b/core/autocomplete/constructPrompt.ts index 85bd3c54a..3e3f00b01 100644 --- a/core/autocomplete/constructPrompt.ts +++ b/core/autocomplete/constructPrompt.ts @@ -1,13 +1,12 @@ import Parser from "web-tree-sitter"; import { TabAutocompleteOptions } from ".."; import { RangeInFileWithContents } from "../commands/util"; + import { countTokens, pruneLinesFromBottom, pruneLinesFromTop, } from "../llm/countTokens"; -import { getBasename } from "../util"; - import { getAst, getTreePathAtCursor } from "./ast"; import { AutocompleteLanguageInfo, LANGUAGES, Typescript } from "./languages"; import { @@ -24,23 +23,6 @@ export function languageForFilepath( return LANGUAGES[filepath.split(".").slice(-1)[0]] || Typescript; } -function formatExternalSnippet( - filepath: string, - snippet: string, - language: AutocompleteLanguageInfo, -) { - const comment = language.comment; - const lines = [ - comment + " Path: " + getBasename(filepath), - ...snippet - .trim() - .split("\n") - .map((line) => comment + " " + line), - comment, - ]; - return lines.join("\n"); -} - const BLOCK_TYPES = ["body", "statement_block"]; function shouldCompleteMultilineAst( @@ -113,43 +95,8 @@ export async function constructAutocompletePrompt( suffix: string; useFim: boolean; completeMultiline: boolean; + snippets: AutocompleteSnippet[]; }> { - // Find external snippets - let snippets: RangeInFileWithContents[] = extraSnippets; - - const windowAroundCursor = - fullPrefix.slice( - -options.slidingWindowSize * options.slidingWindowPrefixPercentage, - ) + - fullSuffix.slice( - options.slidingWindowSize * (1 - options.slidingWindowPrefixPercentage), - ); - - const slidingWindowMatches = await slidingWindowMatcher( - recentlyEditedDocuments, - windowAroundCursor, - 3, - options.slidingWindowSize, - ); - snippets.push(...slidingWindowMatches); - - const recentlyEdited = ( - await Promise.all( - recentlyEditedRanges.map(async (r) => { - return r; - // return await getScopeAroundRange(r); - }), - ) - ).filter((s) => !!s); - snippets.push(...(recentlyEdited as any)); - - // Rank / order the snippets - const scoredSnippets = rankSnippets(snippets, windowAroundCursor); - - // Fill maxSnippetTokens with snippets - const maxSnippetTokens = - options.maxPromptTokens * options.maxSnippetPercentage; - // Construct basic prefix const maxPrefixTokens = options.maxPromptTokens * options.prefixPercentage; let prefix = pruneLinesFromTop(fullPrefix, maxPrefixTokens, modelName); @@ -161,44 +108,82 @@ export async function constructAutocompletePrompt( ); let suffix = pruneLinesFromBottom(fullSuffix, maxSuffixTokens, modelName); - // Remove prefix range from snippets - const prefixLines = prefix.split("\n").length; - const suffixLines = suffix.split("\n").length; - const buffer = 8; - const prefixSuffixRangeWithBuffer = { - start: { - line: cursorLine - prefixLines - buffer, - character: 0, - }, - end: { - line: cursorLine + suffixLines + buffer, - character: 0, - }, - }; - let finalSnippets = removeRangeFromSnippets( - scoredSnippets, - filepath.split("://").slice(-1)[0], - prefixSuffixRangeWithBuffer, - ); + // Find external snippets + let snippets: AutocompleteSnippet[] = []; - // Filter snippets for those with best scores (must be above threshold) - finalSnippets = finalSnippets.filter( - (snippet) => snippet.score >= options.recentlyEditedSimilarityThreshold, - ); - finalSnippets = fillPromptWithSnippets( - scoredSnippets, - maxSnippetTokens, - modelName, - ); + if (options.useOtherFiles) { + snippets.push(...extraSnippets); - // Format snippets as comments and prepend to prefix - const formattedSnippets = finalSnippets - .map((snippet) => - formatExternalSnippet(snippet.filepath, snippet.contents, language), - ) - .join("\n"); - if (formattedSnippets.length > 0) { - prefix = formattedSnippets + "\n\n" + prefix; + const windowAroundCursor = + fullPrefix.slice( + -options.slidingWindowSize * options.slidingWindowPrefixPercentage, + ) + + fullSuffix.slice( + options.slidingWindowSize * (1 - options.slidingWindowPrefixPercentage), + ); + + const slidingWindowMatches = await slidingWindowMatcher( + recentlyEditedDocuments, + windowAroundCursor, + 3, + options.slidingWindowSize, + ); + snippets.push(...slidingWindowMatches); + + const recentlyEdited = ( + await Promise.all( + recentlyEditedRanges.map(async (r) => { + return r; + // return await getScopeAroundRange(r); + }), + ) + ).filter((s) => !!s); + snippets.push(...(recentlyEdited as any)); + // Filter out empty snippets + snippets = snippets.filter( + (s) => + s.contents.trim() !== "" && + !(prefix + suffix).includes(s.contents.trim()), + ); + + // Rank / order the snippets + const scoredSnippets = rankSnippets(snippets, windowAroundCursor); + + // Fill maxSnippetTokens with snippets + const maxSnippetTokens = + options.maxPromptTokens * options.maxSnippetPercentage; + + // Remove prefix range from snippets + const prefixLines = prefix.split("\n").length; + const suffixLines = suffix.split("\n").length; + const buffer = 8; + const prefixSuffixRangeWithBuffer = { + start: { + line: cursorLine - prefixLines - buffer, + character: 0, + }, + end: { + line: cursorLine + suffixLines + buffer, + character: 0, + }, + }; + let finalSnippets = removeRangeFromSnippets( + scoredSnippets, + filepath.split("://").slice(-1)[0], + prefixSuffixRangeWithBuffer, + ); + + // Filter snippets for those with best scores (must be above threshold) + finalSnippets = finalSnippets.filter( + (snippet) => snippet.score >= options.recentlyEditedSimilarityThreshold, + ); + finalSnippets = fillPromptWithSnippets( + scoredSnippets, + maxSnippetTokens, + modelName, + ); + + snippets = finalSnippets; } return { @@ -210,5 +195,6 @@ export async function constructAutocompletePrompt( fullPrefix, fullSuffix, ), + snippets, }; } diff --git a/core/autocomplete/lineStream.ts b/core/autocomplete/lineStream.ts index c7ecc2f7c..98f39b326 100644 --- a/core/autocomplete/lineStream.ts +++ b/core/autocomplete/lineStream.ts @@ -9,7 +9,8 @@ export async function* avoidPathLine( // Snippets are inserted as comments with a line at the start '// Path: '. // Sometimes the model with copy this pattern, which is unwanted for await (const line of stream) { - if (line.startsWith(comment + " Path: ")) { + // Also filter lines that are empty comments + if (line.startsWith(comment + " Path: ") || line.trim() === comment) { continue; } yield line; diff --git a/core/autocomplete/parameters.ts b/core/autocomplete/parameters.ts index fdc72932e..2bde04cf5 100644 --- a/core/autocomplete/parameters.ts +++ b/core/autocomplete/parameters.ts @@ -14,4 +14,5 @@ export const DEFAULT_AUTOCOMPLETE_OPTS: TabAutocompleteOptions = { recentlyEditedSimilarityThreshold: 0.3, useCache: true, onlyMyCode: true, + useOtherFiles: true, }; diff --git a/core/autocomplete/templates.ts b/core/autocomplete/templates.ts index 42c21b242..e71a93320 100644 --- a/core/autocomplete/templates.ts +++ b/core/autocomplete/templates.ts @@ -1,9 +1,19 @@ // Fill in the middle prompts import { CompletionOptions } from ".."; +import { getBasename } from "../util"; +import { AutocompleteSnippet } from "./ranking"; interface AutocompleteTemplate { - template: string | ((prefix: string, suffix: string) => string); + template: + | string + | (( + prefix: string, + suffix: string, + filename: string, + reponame: string, + snippets: AutocompleteSnippet[], + ) => string); completionOptions?: Partial; } @@ -15,6 +25,40 @@ const stableCodeFimTemplate: AutocompleteTemplate = { }, }; +// https://arxiv.org/pdf/2402.19173.pdf section 5.1 +const starcoder2FimTemplate: AutocompleteTemplate = { + template: ( + prefix: string, + suffix: string, + filename: string, + reponame: string, + snippets: AutocompleteSnippet[], + ): string => { + const otherFiles = + snippets.length === 0 + ? "" + : "" + + snippets + .map((snippet) => { + return `${getBasename(snippet.filepath)}\n${snippet.contents}`; + }) + .join("") + + ""; + + let prompt = `${reponame}${otherFiles}${filename}\n${prefix}${suffix}`; + return prompt; + }, + completionOptions: { + stop: [ + "", + "", + "", + "<|endoftext|>", + "", + ], + }, +}; + const codeLlamaFimTemplate: AutocompleteTemplate = { template: "
 {{{prefix}}} {{{suffix}}} ",
   completionOptions: { stop: ["
", "", "", ""] },
@@ -46,6 +90,11 @@ The last line is incomplete, and you should provide the rest of that line. If th
 
 export function getTemplateForModel(model: string): AutocompleteTemplate {
   const lowerCaseModel = model.toLowerCase();
+
+  if (lowerCaseModel.includes("starcoder2")) {
+    return starcoder2FimTemplate;
+  }
+
   if (
     lowerCaseModel.includes("starcoder") ||
     lowerCaseModel.includes("star-coder") ||
diff --git a/core/index.d.ts b/core/index.d.ts
index fbfa0812d..6e6cde136 100644
--- a/core/index.d.ts
+++ b/core/index.d.ts
@@ -595,6 +595,7 @@ export interface TabAutocompleteOptions {
   recentlyEditedSimilarityThreshold: number;
   useCache: boolean;
   onlyMyCode: boolean;
+  useOtherFiles: boolean;
 }
 
 export interface SerializedContinueConfig {
diff --git a/extensions/vscode/.continuerc.json b/extensions/vscode/.continuerc.json
index 12a1699e5..7fbb047a6 100644
--- a/extensions/vscode/.continuerc.json
+++ b/extensions/vscode/.continuerc.json
@@ -1,9 +1,9 @@
 {
-    "customCommands": [
-        {
-            "name": "hello",
-            "prompt": "Write a comprehensive set of unit tests for the selected code. It should setup, run tests that check for correctness including important edge cases, and teardown. Ensure that the tests are complete and sophisticated. Give the tests just as chat output, don't edit any file.",
-            "description": "This is an example custom command. Use /config to edit it and create more"
-        }
-    ]
-}
\ No newline at end of file
+  "customCommands": [
+    {
+      "name": "hello",
+      "prompt": "Write a comprehensive set of unit tests for the selected code. It should setup, run tests that check for correctness including important edge cases, and teardown. Ensure that the tests are complete and sophisticated. Give the tests just as chat output, don't edit any file.",
+      "description": "This is an example custom command. Use /config to edit it and create more"
+    }
+  ]
+}
diff --git a/extensions/vscode/config_schema.json b/extensions/vscode/config_schema.json
index 663c9e52f..663ea66a1 100644
--- a/extensions/vscode/config_schema.json
+++ b/extensions/vscode/config_schema.json
@@ -1579,6 +1579,10 @@
             "onlyMyCode": {
               "type": "boolean",
               "description": "If set to true, Continue will not include any snippets from go to definition unless they are within your repository"
+            },
+            "useOtherFiles": {
+              "type": "boolean",
+              "description": "Defaults to true. If set to false, Continue will not attempt to include snippets from other files."
             }
           },
           "required": []
diff --git a/extensions/vscode/src/autocomplete/completionProvider.ts b/extensions/vscode/src/autocomplete/completionProvider.ts
index b0ba35647..698f2ad8f 100644
--- a/extensions/vscode/src/autocomplete/completionProvider.ts
+++ b/extensions/vscode/src/autocomplete/completionProvider.ts
@@ -58,8 +58,8 @@ export class ContinueCompletionProvider
 
     const config = await this.configHandler.loadConfig();
     const options = {
-      ...config.tabAutocompleteOptions,
       ...DEFAULT_AUTOCOMPLETE_OPTS,
+      ...config.tabAutocompleteOptions,
     };
 
     if (ContinueCompletionProvider.debouncing) {
diff --git a/extensions/vscode/src/autocomplete/getTabCompletion.ts b/extensions/vscode/src/autocomplete/getTabCompletion.ts
index ef2876499..b3bae02f8 100644
--- a/extensions/vscode/src/autocomplete/getTabCompletion.ts
+++ b/extensions/vscode/src/autocomplete/getTabCompletion.ts
@@ -1,10 +1,14 @@
 import { IDE, TabAutocompleteOptions } from "core";
 import { AutocompleteLruCache } from "core/autocomplete/cache";
-import { onlyWhitespaceAfterEndOfLine } from "core/autocomplete/charStream";
+import {
+  noFirstCharNewline,
+  onlyWhitespaceAfterEndOfLine,
+} from "core/autocomplete/charStream";
 import {
   constructAutocompletePrompt,
   languageForFilepath,
 } from "core/autocomplete/constructPrompt";
+import { AutocompleteLanguageInfo } from "core/autocomplete/languages";
 import {
   avoidPathLine,
   stopAtLines,
@@ -17,6 +21,7 @@ import { getTemplateForModel } from "core/autocomplete/templates";
 import { GeneratorReuseManager } from "core/autocomplete/util";
 import { streamLines } from "core/diff/util";
 import OpenAI from "core/llm/llms/OpenAI";
+import { getBasename } from "core/util";
 import Handlebars from "handlebars";
 import * as vscode from "vscode";
 import { TabAutocompleteModel } from "../util/loadAutocompleteModel";
@@ -38,6 +43,23 @@ export interface AutocompleteOutcome {
 const autocompleteCache = AutocompleteLruCache.get();
 const recentlyEditedTracker = new RecentlyEditedTracker();
 
+function formatExternalSnippet(
+  filepath: string,
+  snippet: string,
+  language: AutocompleteLanguageInfo,
+) {
+  const comment = language.comment;
+  const lines = [
+    comment + " Path: " + getBasename(filepath),
+    ...snippet
+      .trim()
+      .split("\n")
+      .map((line) => comment + " " + line),
+    comment,
+  ];
+  return lines.join("\n");
+}
+
 export async function getTabCompletion(
   document: vscode.TextDocument,
   pos: vscode.Position,
@@ -99,7 +121,7 @@ export async function getTabCompletion(
     });
   }
 
-  const { prefix, suffix, completeMultiline } =
+  let { prefix, suffix, completeMultiline, snippets } =
     await constructAutocompletePrompt(
       document.uri.toString(),
       pos.line,
@@ -114,12 +136,37 @@ export async function getTabCompletion(
       extrasSnippets,
     );
 
+  // Template prompt
   const { template, completionOptions } = options.template
     ? { template: options.template, completionOptions: {} }
     : getTemplateForModel(llm.model);
 
-  const compiledTemplate = Handlebars.compile(template);
-  const prompt = compiledTemplate({ prefix, suffix });
+  let prompt: string;
+  const filename = getBasename(document.uri.fsPath);
+  const reponame = getBasename(workspaceDirs[0] ?? "myproject");
+  if (typeof template === "string") {
+    const compiledTemplate = Handlebars.compile(template);
+
+    // Format snippets as comments and prepend to prefix
+    const formattedSnippets = snippets
+      .map((snippet) =>
+        formatExternalSnippet(snippet.filepath, snippet.contents, lang),
+      )
+      .join("\n");
+    if (formattedSnippets.length > 0) {
+      prefix = formattedSnippets + "\n\n" + prefix;
+    }
+
+    prompt = compiledTemplate({
+      prefix,
+      suffix,
+      filename,
+      reponame,
+    });
+  } else {
+    // Let the template function format snippets
+    prompt = template(prefix, suffix, filename, reponame, snippets);
+  }
 
   // Completion
   let completion = "";
@@ -172,8 +219,9 @@ export async function getTabCompletion(
         yield update;
       }
     };
+    let chars = generatorWithCancellation();
     const gen2 = onlyWhitespaceAfterEndOfLine(
-      generatorWithCancellation(),
+      noFirstCharNewline(chars),
       lang.endOfLine,
     );
     const lineGenerator = streamWithNewLines(
diff --git a/gui/src/components/markdown/CodeSnippetPreview.tsx b/gui/src/components/markdown/CodeSnippetPreview.tsx
index 4df6f8896..d5c80e08c 100644
--- a/gui/src/components/markdown/CodeSnippetPreview.tsx
+++ b/gui/src/components/markdown/CodeSnippetPreview.tsx
@@ -93,7 +93,7 @@ function CodeSnippetPreview(props: CodeSnippetPreviewProps) {
             new WebviewIde().showLines(
               props.item.description,
               parseInt(lines[0]) - 1,
-              parseInt(lines[1]) - 1
+              parseInt(lines[1]) - 1,
             );
           } else {
             postToIde("showVirtualFile", {
@@ -144,7 +144,7 @@ function CodeSnippetPreview(props: CodeSnippetPreviewProps) {
           height: collapsed
             ? `${Math.min(
                 MAX_PREVIEW_HEIGHT,
-                codeBlockRef.current?.scrollHeight
+                codeBlockRef.current?.scrollHeight,
               )}px`
             : undefined,
           overflow: collapsed ? "hidden" : "auto",
@@ -152,7 +152,7 @@ function CodeSnippetPreview(props: CodeSnippetPreviewProps) {
       >
         

From 1331d5d7baaa251a129a532b5b7fee9163c8150b Mon Sep 17 00:00:00 2001
From: Nate Sesti 
Date: Wed, 6 Mar 2024 16:51:06 -0800
Subject: [PATCH 09/15] =?UTF-8?q?=E2=9A=A1=EF=B8=8F=20use=20starcoder2=20f?=
 =?UTF-8?q?im=20template=20without=20metadata?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

---
 core/autocomplete/templates.ts                            | 6 +++---
 docs/static/schemas/config.json                           | 4 ++++
 extensions/intellij/src/main/resources/config_schema.json | 4 ++++
 extensions/vscode/continue_rc_schema.json                 | 4 ++++
 4 files changed, 15 insertions(+), 3 deletions(-)

diff --git a/core/autocomplete/templates.ts b/core/autocomplete/templates.ts
index e71a93320..ede752f9d 100644
--- a/core/autocomplete/templates.ts
+++ b/core/autocomplete/templates.ts
@@ -1,7 +1,6 @@
 // Fill in the middle prompts
 
 import { CompletionOptions } from "..";
-import { getBasename } from "../util";
 import { AutocompleteSnippet } from "./ranking";
 
 interface AutocompleteTemplate {
@@ -40,12 +39,13 @@ const starcoder2FimTemplate: AutocompleteTemplate = {
         : "" +
           snippets
             .map((snippet) => {
-              return `${getBasename(snippet.filepath)}\n${snippet.contents}`;
+              return snippet.contents;
+              // return `${getBasename(snippet.filepath)}\n${snippet.contents}`;
             })
             .join("") +
           "";
 
-    let prompt = `${reponame}${otherFiles}${filename}\n${prefix}${suffix}`;
+    let prompt = `${otherFiles}${prefix}${suffix}`;
     return prompt;
   },
   completionOptions: {
diff --git a/docs/static/schemas/config.json b/docs/static/schemas/config.json
index 663c9e52f..663ea66a1 100644
--- a/docs/static/schemas/config.json
+++ b/docs/static/schemas/config.json
@@ -1579,6 +1579,10 @@
             "onlyMyCode": {
               "type": "boolean",
               "description": "If set to true, Continue will not include any snippets from go to definition unless they are within your repository"
+            },
+            "useOtherFiles": {
+              "type": "boolean",
+              "description": "Defaults to true. If set to false, Continue will not attempt to include snippets from other files."
             }
           },
           "required": []
diff --git a/extensions/intellij/src/main/resources/config_schema.json b/extensions/intellij/src/main/resources/config_schema.json
index 663c9e52f..663ea66a1 100644
--- a/extensions/intellij/src/main/resources/config_schema.json
+++ b/extensions/intellij/src/main/resources/config_schema.json
@@ -1579,6 +1579,10 @@
             "onlyMyCode": {
               "type": "boolean",
               "description": "If set to true, Continue will not include any snippets from go to definition unless they are within your repository"
+            },
+            "useOtherFiles": {
+              "type": "boolean",
+              "description": "Defaults to true. If set to false, Continue will not attempt to include snippets from other files."
             }
           },
           "required": []
diff --git a/extensions/vscode/continue_rc_schema.json b/extensions/vscode/continue_rc_schema.json
index a722c32f5..23f035089 100644
--- a/extensions/vscode/continue_rc_schema.json
+++ b/extensions/vscode/continue_rc_schema.json
@@ -1771,6 +1771,10 @@
             "onlyMyCode": {
               "type": "boolean",
               "description": "If set to true, Continue will not include any snippets from go to definition unless they are within your repository"
+            },
+            "useOtherFiles": {
+              "type": "boolean",
+              "description": "Defaults to true. If set to false, Continue will not attempt to include snippets from other files."
             }
           },
           "required": []

From ae9e6db2105532d46e3c5b3d91b8eb440368c485 Mon Sep 17 00:00:00 2001
From: Nate Sesti 
Date: Wed, 6 Mar 2024 17:05:00 -0800
Subject: [PATCH 10/15] =?UTF-8?q?=F0=9F=9A=B8=20switch=20back=20to=20starc?=
 =?UTF-8?q?oder=20as=20default=20until=20starcoder2=20prompt=20is=20fixed?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

---
 core/llm/llms/Ollama.ts                                   | 2 +-
 docs/docs/walkthroughs/tab-autocomplete.md                | 8 ++++----
 docs/static/schemas/config.json                           | 2 +-
 extensions/intellij/src/main/resources/config_schema.json | 2 +-
 extensions/vscode/config_schema.json                      | 2 +-
 extensions/vscode/continue_rc_schema.json                 | 2 +-
 extensions/vscode/media/welcome.md                        | 2 +-
 extensions/vscode/src/util/loadAutocompleteModel.ts       | 4 ++--
 8 files changed, 12 insertions(+), 12 deletions(-)

diff --git a/core/llm/llms/Ollama.ts b/core/llm/llms/Ollama.ts
index cc9795c7e..1f273560d 100644
--- a/core/llm/llms/Ollama.ts
+++ b/core/llm/llms/Ollama.ts
@@ -88,7 +88,7 @@ class Ollama extends BaseLLM {
         "deepseek-33b": "deepseek-coder:33b",
         "neural-chat-7b": "neural-chat:7b-v3.3",
         "starcoder-1b": "starcoder:1b",
-        "starcoder-3b": "starcoder2:3b",
+        "starcoder-3b": "starcoder:3b",
         "stable-code-3b": "stable-code:3b",
       }[this.model] || this.model
     );
diff --git a/docs/docs/walkthroughs/tab-autocomplete.md b/docs/docs/walkthroughs/tab-autocomplete.md
index 82d415389..aa1a024ab 100644
--- a/docs/docs/walkthroughs/tab-autocomplete.md
+++ b/docs/docs/walkthroughs/tab-autocomplete.md
@@ -7,7 +7,7 @@ Continue now provides support for tab autocomplete in [the VS Code extension](ht
 We recommend setting up tab-autocomplete with a local Ollama instance. 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:
 
 ```bash
-ollama run starcoder2:3b
+ollama run starcoder:3b
 ```
 
 Once it has been downloaded, you should begin to see completions in VS Code.
@@ -21,7 +21,7 @@ All of the configuration options available for chat models are available to use
     "tabAutocompleteModel": {
         "title": "Tab Autocomplete Model",
         "provider": "ollama",
-        "model": "starcoder2:3b",
+        "model": "starcoder:3b",
         "apiBase": "https://"
     },
     ...
@@ -58,7 +58,7 @@ This object allows you to customize the behavior of tab-autocomplete. The availa
   "tabAutocompleteModel": {
     "title": "Tab Autocomplete Model",
     "provider": "ollama",
-    "model": "starcoder2:3b",
+    "model": "starcoder:3b",
     "apiBase": "https://"
   },
   "tabAutocompleteOptions": {
@@ -78,7 +78,7 @@ Follow these steps to ensure that everything is set up correctly:
 1. Make sure you have the pre-release version of the extension installed.
 2. Make sure you have the "Enable Tab Autocomplete" setting checked (can toggle by clicking the "Continue" button in the status bar).
 3. Make sure you have downloaded Ollama.
-4. Run `ollama run starcoder2:3b` to verify that the model is downloaded.
+4. Run `ollama run starcoder:3b` to verify that the model is downloaded.
 5. Make sure that any other completion providers are disabled (e.g. Copilot), as they may interfere.
 6. Make sure that you aren't also using another Ollama model for chat. This will cause Ollama to constantly load and unload the models from memory, resulting in slow responses (or none at all) for both.
 7. Check the output of the logs to find any potential errors (cmd/ctrl+shift+p -> "Toggle Developer Tools" -> "Console" tab).
diff --git a/docs/static/schemas/config.json b/docs/static/schemas/config.json
index 663ea66a1..3cd02ca58 100644
--- a/docs/static/schemas/config.json
+++ b/docs/static/schemas/config.json
@@ -1528,7 +1528,7 @@
         },
         "tabAutocompleteModel": {
           "title": "Tab Autocomplete Model",
-          "markdownDescription": "The model used for tab autocompletion. If undefined, Continue will default to using starcoder2:3b on a local Ollama instance.\n\n*IMPORTANT*:\n\nIf you use a custom model, ensure that it is one trained for fill-in-the-middle completions. An instruct model is typically not well-suited to autocomplete and you may receive unsatisfactory completions.",
+          "markdownDescription": "The model used for tab autocompletion. If undefined, Continue will default to using starcoder:3b on a local Ollama instance.\n\n*IMPORTANT*:\n\nIf you use a custom model, ensure that it is one trained for fill-in-the-middle completions. An instruct model is typically not well-suited to autocomplete and you may receive unsatisfactory completions.",
           "default": {
             "title": "Tab Autocomplete Model",
             "provider": "ollama",
diff --git a/extensions/intellij/src/main/resources/config_schema.json b/extensions/intellij/src/main/resources/config_schema.json
index 663ea66a1..3cd02ca58 100644
--- a/extensions/intellij/src/main/resources/config_schema.json
+++ b/extensions/intellij/src/main/resources/config_schema.json
@@ -1528,7 +1528,7 @@
         },
         "tabAutocompleteModel": {
           "title": "Tab Autocomplete Model",
-          "markdownDescription": "The model used for tab autocompletion. If undefined, Continue will default to using starcoder2:3b on a local Ollama instance.\n\n*IMPORTANT*:\n\nIf you use a custom model, ensure that it is one trained for fill-in-the-middle completions. An instruct model is typically not well-suited to autocomplete and you may receive unsatisfactory completions.",
+          "markdownDescription": "The model used for tab autocompletion. If undefined, Continue will default to using starcoder:3b on a local Ollama instance.\n\n*IMPORTANT*:\n\nIf you use a custom model, ensure that it is one trained for fill-in-the-middle completions. An instruct model is typically not well-suited to autocomplete and you may receive unsatisfactory completions.",
           "default": {
             "title": "Tab Autocomplete Model",
             "provider": "ollama",
diff --git a/extensions/vscode/config_schema.json b/extensions/vscode/config_schema.json
index 663ea66a1..3cd02ca58 100644
--- a/extensions/vscode/config_schema.json
+++ b/extensions/vscode/config_schema.json
@@ -1528,7 +1528,7 @@
         },
         "tabAutocompleteModel": {
           "title": "Tab Autocomplete Model",
-          "markdownDescription": "The model used for tab autocompletion. If undefined, Continue will default to using starcoder2:3b on a local Ollama instance.\n\n*IMPORTANT*:\n\nIf you use a custom model, ensure that it is one trained for fill-in-the-middle completions. An instruct model is typically not well-suited to autocomplete and you may receive unsatisfactory completions.",
+          "markdownDescription": "The model used for tab autocompletion. If undefined, Continue will default to using starcoder:3b on a local Ollama instance.\n\n*IMPORTANT*:\n\nIf you use a custom model, ensure that it is one trained for fill-in-the-middle completions. An instruct model is typically not well-suited to autocomplete and you may receive unsatisfactory completions.",
           "default": {
             "title": "Tab Autocomplete Model",
             "provider": "ollama",
diff --git a/extensions/vscode/continue_rc_schema.json b/extensions/vscode/continue_rc_schema.json
index 23f035089..e047c46ee 100644
--- a/extensions/vscode/continue_rc_schema.json
+++ b/extensions/vscode/continue_rc_schema.json
@@ -1716,7 +1716,7 @@
         },
         "tabAutocompleteModel": {
           "title": "Tab Autocomplete Model",
-          "markdownDescription": "The model used for tab autocompletion. If undefined, Continue will default to using starcoder2:3b on a local Ollama instance.\n\n*IMPORTANT*:\n\nIf you use a custom model, ensure that it is one trained for fill-in-the-middle completions. An instruct model is typically not well-suited to autocomplete and you may receive unsatisfactory completions.",
+          "markdownDescription": "The model used for tab autocompletion. If undefined, Continue will default to using starcoder:3b on a local Ollama instance.\n\n*IMPORTANT*:\n\nIf you use a custom model, ensure that it is one trained for fill-in-the-middle completions. An instruct model is typically not well-suited to autocomplete and you may receive unsatisfactory completions.",
           "default": {
             "title": "Tab Autocomplete Model",
             "provider": "ollama",
diff --git a/extensions/vscode/media/welcome.md b/extensions/vscode/media/welcome.md
index 969305dbc..d407ba29f 100644
--- a/extensions/vscode/media/welcome.md
+++ b/extensions/vscode/media/welcome.md
@@ -21,7 +21,7 @@ Continue is currently in the left sidebar, but we recommend moving it to the rig
 ## ⚡️ Setting up tab autocomplete
 
 1. Download [Ollama](https://ollama.ai)
-2. Download starcoder2:3b by running `ollama run starcoder2:3b` in the terminal
+2. Download starcoder:3b by running `ollama run starcoder:3b` in the terminal
 3. That's it! You can disable autocomplete at any time by clicking the `Continue` button in the status bar (bottom right of the VS Code window)
 
 > Learn how to customize your autocomplete experience in [our walkthrough](https://continue.dev/docs/walkthroughs/tab-autocomplete)
diff --git a/extensions/vscode/src/util/loadAutocompleteModel.ts b/extensions/vscode/src/util/loadAutocompleteModel.ts
index fbb0fc322..41fd7f886 100644
--- a/extensions/vscode/src/util/loadAutocompleteModel.ts
+++ b/extensions/vscode/src/util/loadAutocompleteModel.ts
@@ -5,8 +5,8 @@ import * as vscode from "vscode";
 
 export class TabAutocompleteModel {
   private _llm: ILLM | undefined;
-  private defaultTag: string = "starcoder2:3b";
-  private defaultTagName: string = "Starcoder 2 3b";
+  private defaultTag: string = "starcoder:3b";
+  private defaultTagName: string = "Starcoder 3b";
 
   private shownOllamaWarning: boolean = false;
   private shownDeepseekWarning: boolean = false;

From 7998862a1af25ad9f069744a836aa17bb0eb6d1c Mon Sep 17 00:00:00 2001
From: Nate Sesti 
Date: Wed, 6 Mar 2024 17:33:59 -0800
Subject: [PATCH 11/15] =?UTF-8?q?=F0=9F=90=9B=20fix=20input=20focus=20bug?=
 =?UTF-8?q?=20when=20highlighting=20code=20first=20time?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

---
 gui/src/components/mainInput/TipTapEditor.tsx | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/gui/src/components/mainInput/TipTapEditor.tsx b/gui/src/components/mainInput/TipTapEditor.tsx
index fa6591e93..5bf6ae70f 100644
--- a/gui/src/components/mainInput/TipTapEditor.tsx
+++ b/gui/src/components/mainInput/TipTapEditor.tsx
@@ -420,6 +420,7 @@ function TipTapEditor(props: TipTapEditorProps) {
         saveSession();
       }
       setTimeout(() => {
+        editor?.commands.blur();
         editor?.commands.focus("end");
       }, 20);
     },
@@ -493,8 +494,9 @@ function TipTapEditor(props: TipTapEditorProps) {
           })
           .run();
         setTimeout(() => {
+          editor.commands.blur();
           editor.commands.focus("end");
-        }, 200);
+        }, 20);
       }
       setIgnoreHighlightedCode(false);
     },

From 6b525c175423b50ca270244a06b63bbd8cac681c Mon Sep 17 00:00:00 2001
From: Nate Sesti 
Date: Wed, 6 Mar 2024 17:43:35 -0800
Subject: [PATCH 12/15] =?UTF-8?q?=F0=9F=94=96=20update=20package.json=20ve?=
 =?UTF-8?q?rsion?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

---
 extensions/vscode/package.json | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/extensions/vscode/package.json b/extensions/vscode/package.json
index 41af37d1d..109659e25 100644
--- a/extensions/vscode/package.json
+++ b/extensions/vscode/package.json
@@ -1,7 +1,7 @@
 {
   "name": "continue",
   "icon": "media/icon.png",
-  "version": "0.8.14",
+  "version": "0.8.15",
   "repository": {
     "type": "git",
     "url": "https://github.com/continuedev/continue"

From 1171fe15de0f4cd87d528d0f192213236f3b2563 Mon Sep 17 00:00:00 2001
From: Stephen Hood <42821+stlhood@users.noreply.github.com>
Date: Wed, 6 Mar 2024 17:44:50 -0800
Subject: [PATCH 13/15] Add link to llamafile reference page in
 select-provider.md (#944)

---
 docs/docs/model-setup/select-provider.md | 1 +
 1 file changed, 1 insertion(+)

diff --git a/docs/docs/model-setup/select-provider.md b/docs/docs/model-setup/select-provider.md
index 1f0cc1e08..46002cf0d 100644
--- a/docs/docs/model-setup/select-provider.md
+++ b/docs/docs/model-setup/select-provider.md
@@ -17,6 +17,7 @@ You can run a model on your local computer using:
 - [Ollama](../reference/Model%20Providers/ollama.md)
 - [LM Studio](../reference/Model%20Providers/lmstudio.md)
 - [Llama.cpp](../reference/Model%20Providers/llamacpp.md)
+- [llamafile](../reference/Model%20Providers/llamafile) ((OpenAI compatible server)
 - [LocalAI](../reference/Model%20Providers/openai.md) (OpenAI compatible server)
 - [Text generation web UI](../reference/Model%20Providers/openai.md) (OpenAI compatible server)
 - [FastChat](../reference/Model%20Providers/openai.md) (OpenAI compatible server)

From a89cf5e0d57e2d618131bdca145514a204ff074d Mon Sep 17 00:00:00 2001
From: GitHub Action 
Date: Thu, 7 Mar 2024 01:52:49 +0000
Subject: [PATCH 14/15] =?UTF-8?q?=F0=9F=92=9A=20Update=20package.json=20ve?=
 =?UTF-8?q?rsion=20[skip=20ci]?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

---
 extensions/vscode/package-lock.json | 4 ++--
 extensions/vscode/package.json      | 2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/extensions/vscode/package-lock.json b/extensions/vscode/package-lock.json
index 905761ca0..4c29331fd 100644
--- a/extensions/vscode/package-lock.json
+++ b/extensions/vscode/package-lock.json
@@ -1,12 +1,12 @@
 {
   "name": "continue",
-  "version": "0.8.14",
+  "version": "0.8.16",
   "lockfileVersion": 3,
   "requires": true,
   "packages": {
     "": {
       "name": "continue",
-      "version": "0.8.14",
+      "version": "0.8.16",
       "license": "Apache-2.0",
       "dependencies": {
         "@electron/rebuild": "^3.2.10",
diff --git a/extensions/vscode/package.json b/extensions/vscode/package.json
index 109659e25..4cc221f8b 100644
--- a/extensions/vscode/package.json
+++ b/extensions/vscode/package.json
@@ -1,7 +1,7 @@
 {
   "name": "continue",
   "icon": "media/icon.png",
-  "version": "0.8.15",
+  "version": "0.8.16",
   "repository": {
     "type": "git",
     "url": "https://github.com/continuedev/continue"

From 0ad22a73dfd79213920fbabafca8d63d4fa762ce Mon Sep 17 00:00:00 2001
From: Nate Sesti 
Date: Wed, 6 Mar 2024 19:27:36 -0800
Subject: [PATCH 15/15] =?UTF-8?q?=F0=9F=90=9B=20fix=20anthropic=20requests?=
 =?UTF-8?q?=20with=20systemMessage?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

---
 core/llm/llms/Anthropic.ts          | 2 +-
 extensions/vscode/package-lock.json | 4 ++--
 extensions/vscode/yarn.lock         | 6 +++---
 3 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/core/llm/llms/Anthropic.ts b/core/llm/llms/Anthropic.ts
index c5d6b0ee3..cbf675a45 100644
--- a/core/llm/llms/Anthropic.ts
+++ b/core/llm/llms/Anthropic.ts
@@ -50,7 +50,7 @@ class Anthropic extends BaseLLM {
       },
       body: JSON.stringify({
         ...this._convertArgs(options),
-        messages,
+        messages: messages.filter((m) => m.role !== "system"),
         system: this.systemMessage,
         stream: true,
       }),
diff --git a/extensions/vscode/package-lock.json b/extensions/vscode/package-lock.json
index 905761ca0..445f4e039 100644
--- a/extensions/vscode/package-lock.json
+++ b/extensions/vscode/package-lock.json
@@ -1,12 +1,12 @@
 {
   "name": "continue",
-  "version": "0.8.14",
+  "version": "0.8.15",
   "lockfileVersion": 3,
   "requires": true,
   "packages": {
     "": {
       "name": "continue",
-      "version": "0.8.14",
+      "version": "0.8.15",
       "license": "Apache-2.0",
       "dependencies": {
         "@electron/rebuild": "^3.2.10",
diff --git a/extensions/vscode/yarn.lock b/extensions/vscode/yarn.lock
index 530ca3472..21f1b3e6c 100644
--- a/extensions/vscode/yarn.lock
+++ b/extensions/vscode/yarn.lock
@@ -697,9 +697,9 @@
   integrity sha512-4JQNk+3mVzK3xh2rqd6RB4J46qUR19azEHBneZyTZM+c456qOrbbM/5xcR8huNCCcbVt7+UmizG6GuUvPvKUYg==
 
 "@lancedb/vectordb-darwin-arm64@*":
-  version "0.4.11"
-  resolved "https://registry.npmjs.org/@lancedb/vectordb-darwin-arm64/-/vectordb-darwin-arm64-0.4.11.tgz"
-  integrity sha512-JDOKmFnuJPFkA7ZmrzBJolROwSjWr7yMvAbi40uLBc25YbbVezodd30u2EFtIwWwtk1GqNYRZ49FZOElKYeC/Q==
+  version "0.4.12"
+  resolved "https://registry.npmjs.org/@lancedb/vectordb-darwin-arm64/-/vectordb-darwin-arm64-0.4.12.tgz"
+  integrity sha512-38/rkJRlWXkPWXuj9onzvbrhnIWcIUQjgEp5G9v5ixPosBowm7A4j8e2Q8CJMsVSNcVX2JLqwWVldiWegZFuYw==
 
 "@lancedb/vectordb-darwin-arm64@0.4.10":
   version "0.4.10"