diff --git a/core/config/types.ts b/core/config/types.ts index 82d71289e..abd2aeb31 100644 --- a/core/config/types.ts +++ b/core/config/types.ts @@ -428,7 +428,7 @@ declare global { | "gpt-4" | "gpt-3.5-turbo-0613" | "gpt-4-32k" - | "gpt-4-1106-preview" + | "gpt-4-turbo-preview" // Open Source | "mistral-7b" | "mistral-8x7b" diff --git a/core/index.d.ts b/core/index.d.ts index a83d407bf..1a1407d52 100644 --- a/core/index.d.ts +++ b/core/index.d.ts @@ -460,7 +460,7 @@ export type ModelName = | "gpt-4" | "gpt-3.5-turbo-0613" | "gpt-4-32k" - | "gpt-4-0125-preview" + | "gpt-4-turbo-preview" | "gpt-4-vision-preview" // Open Source | "mistral-7b" diff --git a/core/indexing/LanceDbIndex.ts b/core/indexing/LanceDbIndex.ts index 792c01fd4..123c1d25c 100644 --- a/core/indexing/LanceDbIndex.ts +++ b/core/indexing/LanceDbIndex.ts @@ -1,6 +1,5 @@ // NOTE: vectordb requirement must be listed in extensions/vscode to avoid error import { v4 as uuidv4 } from "uuid"; -import * as lancedb from "vectordb"; import { Chunk, EmbeddingsProvider, IndexingProgressUpdate } from ".."; import { MAX_CHUNK_SIZE } from "../llm/constants"; import { getBasename } from "../util"; @@ -134,6 +133,7 @@ export class LanceDbIndex implements CodebaseIndex { resultType: IndexResultType ) => void ): AsyncGenerator { + const lancedb = await import("vectordb"); const tableName = this.tableNameForTag(tag); const db = await lancedb.connect(getLanceDbPath()); @@ -141,7 +141,7 @@ export class LanceDbIndex implements CodebaseIndex { await this.createSqliteCacheTable(sqlite); // Compute - let table: lancedb.Table | undefined = undefined; + let table = undefined; let needToCreateTable = true; const existingTables = await db.tableNames(); let computedRows: LanceDbRow[] = []; @@ -243,7 +243,7 @@ export class LanceDbIndex implements CodebaseIndex { n: number, directory: string | undefined, vector: number[], - db: lancedb.Connection + db: any /// lancedb.Connection ): Promise { const tableName = this.tableNameForTag(tag); const tableNames = await db.tableNames(); @@ -269,6 +269,10 @@ export class LanceDbIndex implements CodebaseIndex { n: number, directory: string | undefined ): Promise { + const lancedb = await import("vectordb"); + if (!lancedb.connect) { + throw new Error("LanceDB failed to load a native module"); + } const [vector] = await this.embeddingsProvider.embed([text]); const db = await lancedb.connect(getLanceDbPath()); diff --git a/core/indexing/docs/db.ts b/core/indexing/docs/db.ts index 21a23d827..4250a6610 100644 --- a/core/indexing/docs/db.ts +++ b/core/indexing/docs/db.ts @@ -1,6 +1,5 @@ import { Database, open } from "sqlite"; import sqlite3 from "sqlite3"; -import * as lancedb from "vectordb"; import { Chunk } from "../.."; import { getDocsSqlitePath, getLanceDbPath } from "../../util/paths"; @@ -31,6 +30,7 @@ export async function retrieveDocs( vector: number[], nRetrieve: number ): Promise { + const lancedb = await import("vectordb"); const lance = await lancedb.connect(getLanceDbPath()); const table = await lance.openTable(DOCS_TABLE_NAME); const docs: LanceDbDocsRow[] = await table @@ -68,6 +68,7 @@ export async function addDocs( vector: embeddings[i], })); + const lancedb = await import("vectordb"); const lance = await lancedb.connect(getLanceDbPath()); const tableNames = await lance.tableNames(); if (!tableNames.includes(DOCS_TABLE_NAME)) { diff --git a/core/llm/constants.ts b/core/llm/constants.ts index 0a05c8886..1c8c54bcb 100644 --- a/core/llm/constants.ts +++ b/core/llm/constants.ts @@ -16,7 +16,7 @@ const CONTEXT_LENGTH_FOR_MODEL: { [name: string]: number } = { "gpt-35-turbo-0613": 4096, "gpt-35-turbo": 4096, "gpt-4-32k": 32_768, - "gpt-4-1106-preview": 128_000, + "gpt-4-turbo-preview": 128_000, "gpt-4-vision": 128_000, "gpt-4-0125-preview": 128_000, }; diff --git a/docs/docs/config-file-migration.md b/docs/docs/config-file-migration.md index d4d140815..d38c72327 100644 --- a/docs/docs/config-file-migration.md +++ b/docs/docs/config-file-migration.md @@ -53,7 +53,7 @@ Instead of writing something like `Ollama(model="phind-codellama:34b", ...)`, wh "gpt-4", "gpt-3.5-turbo-0613", "gpt-4-32k", - "gpt-4-1106-preview", + "gpt-4-turbo-preview", # Open-Source "mistral-7b", "llama2-7b", diff --git a/docs/docs/model-setup/configuration.md b/docs/docs/model-setup/configuration.md index 5337a7da1..a40911643 100644 --- a/docs/docs/model-setup/configuration.md +++ b/docs/docs/model-setup/configuration.md @@ -98,9 +98,9 @@ This exact function and a few other default implementations are available in [`c You also have access to customize the prompt used in the '/edit' slash command. We already have a well-engineered prompt for GPT-4 and sensible defaults for less powerful open-source models, but you might wish to play with the prompt and try to find a more reliable alternative if you are for example getting English as well as code in your output. -To customize the prompt, use the `promptTemplates` property of any model, which is a dictionary, and set the "edit" key to a template string with Mustache syntax. The 'filePrefix', 'fileSuffix', 'codeToEdit', 'language', 'contextItems', and 'userInput' variables are available in the template. Here is an example: +To customize the prompt, use the `promptTemplates` property of any model, which is a dictionary, and set the "edit" key to a template string with Mustache syntax. The 'filePrefix', 'fileSuffix', 'codeToEdit', 'language', 'contextItems', and 'userInput' variables are available in the template. Here is an example of how it can be set in `config.ts`: -```typescript +```typescript title="~/.continue/config.ts" const codellamaEditPrompt = `\`\`\`{{{language}}} {{{codeToEdit}}} \`\`\` @@ -109,13 +109,9 @@ const codellamaEditPrompt = `\`\`\`{{{language}}} Your answer should be given inside of a code block. It should use the same kind of indentation as above. [/INST] Sure! Here's the rewritten code you requested: \`\`\`{{{language}}}`; -``` -It can then be used like this in `config.ts`: - -```typescript title="~/.continue/config.ts" function modifyConfig(config: Config): Config { - config.models[0].promptTemplates["edit"] = ""; + config.models[0].promptTemplates["edit"] = codellamaEditPrompt; return config; } ``` diff --git a/docs/docs/walkthroughs/config-file-migration.md b/docs/docs/walkthroughs/config-file-migration.md index 9aea69edd..b8e83d2f8 100644 --- a/docs/docs/walkthroughs/config-file-migration.md +++ b/docs/docs/walkthroughs/config-file-migration.md @@ -52,7 +52,7 @@ Instead of writing something like `Ollama(model="phind-codellama:34b", ...)`, wh "gpt-4", "gpt-3.5-turbo-0613", "gpt-4-32k", - "gpt-4-1106-preview", + "gpt-4-turbo-preview", # Open-Source "mistral-7b", "llama2-7b", diff --git a/docs/docs/walkthroughs/tab-autocomplete.md b/docs/docs/walkthroughs/tab-autocomplete.md index b247d5c5c..c6fd9ba5b 100644 --- a/docs/docs/walkthroughs/tab-autocomplete.md +++ b/docs/docs/walkthroughs/tab-autocomplete.md @@ -2,7 +2,7 @@ Continue now provides experimental support for tab autocomplete in VS Code. You can enable it by downloading the pre-release version of the extension, opening VS Code settings, and then checking the box that says "Enable Tab Autocomplete". There is also a button on the bottom/status bar for fast access. We will be greatly improving the experience over the next few releases, and it is always helpful to hear feedback. If you have any problems or suggestions, please let us know in our [Discord](https://discord.gg/vapESyrFmJ). -## Setting up with Ollama +## Setting up with Ollama (default) 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: @@ -12,6 +12,24 @@ ollama run deepseek-coder:1.3b-base Once it has been downloaded, you should begin to see completions in VS Code. +## Setting up a custom model + +All of the configuration options available for chat models are available to use for tab-autocomplete. For example, if you wanted to use a remote Ollama instance you would edit your `config.json` like this: + +```json +{ + "tabAutocompleteModel": { + "title": "Tab Autocomplete Model", + "provider": "ollama", + "model": "deepseek-coder:1.3b-base", + "apiBase": "https://" + }, + ... +} +``` + +If you aren't yet familiar with the available options, you can learn more in our [overview](../model-setup/overview.md). + ## Configuration Options The following can be configured in `config.json`: diff --git a/docs/static/schemas/config.json b/docs/static/schemas/config.json index 486d6343c..746737b6a 100644 --- a/docs/static/schemas/config.json +++ b/docs/static/schemas/config.json @@ -336,6 +336,7 @@ "gpt-3.5-turbo-0613", "gpt-4-32k", "gpt-4-0125-preview", + "gpt-4-turbo-preview", "AUTODETECT" ] } @@ -421,7 +422,7 @@ "gpt-4", "gpt-3.5-turbo-0613", "gpt-4-32k", - "gpt-4-0125-preview", + "gpt-4-turbo-preview", "gpt-4-vision-preview", "mistral-7b", "mistral-8x7b", @@ -782,7 +783,7 @@ "gpt-4", "gpt-3.5-turbo-0613", "gpt-4-32k", - "gpt-4-0125-preview", + "gpt-4-turbo-preview", "gpt-4-vision-preview", "mistral-7b", "mistral-8x7b", diff --git a/extensions/vscode/config_schema.json b/extensions/vscode/config_schema.json index 486d6343c..746737b6a 100644 --- a/extensions/vscode/config_schema.json +++ b/extensions/vscode/config_schema.json @@ -336,6 +336,7 @@ "gpt-3.5-turbo-0613", "gpt-4-32k", "gpt-4-0125-preview", + "gpt-4-turbo-preview", "AUTODETECT" ] } @@ -421,7 +422,7 @@ "gpt-4", "gpt-3.5-turbo-0613", "gpt-4-32k", - "gpt-4-0125-preview", + "gpt-4-turbo-preview", "gpt-4-vision-preview", "mistral-7b", "mistral-8x7b", @@ -782,7 +783,7 @@ "gpt-4", "gpt-3.5-turbo-0613", "gpt-4-32k", - "gpt-4-0125-preview", + "gpt-4-turbo-preview", "gpt-4-vision-preview", "mistral-7b", "mistral-8x7b", diff --git a/extensions/vscode/package-lock.json b/extensions/vscode/package-lock.json index 00cabff3b..34ca38569 100644 --- a/extensions/vscode/package-lock.json +++ b/extensions/vscode/package-lock.json @@ -8,9 +8,6 @@ "name": "continue", "version": "0.9.62", "license": "Apache-2.0", - "dependencies": { - "@electron/rebuild": "^3.2.10", - "@reduxjs/toolkit": "^1.9.3", "@types/jest": "^29.5.11", "@types/node-fetch": "^2.6.11", "@vscode/ripgrep": "^1.15.9", diff --git a/gui/src/util/modelData.ts b/gui/src/util/modelData.ts index f712d8950..658fbda5a 100644 --- a/gui/src/util/modelData.ts +++ b/gui/src/util/modelData.ts @@ -479,9 +479,9 @@ const gpt4turbo: ModelPackage = { description: "A faster, cheaper version of GPT-4 with a longer context length", params: { - model: "gpt-4-0125-preview", + model: "gpt-4-turbo-preview", contextLength: 128_000, - title: "GPT-4 Turbo", + title: "gpt-4-turbo-preview", }, providerOptions: ["openai", "freetrial"], icon: "openai.png", diff --git a/media/above-line-edit.gif b/media/above-line-edit.gif new file mode 100644 index 000000000..1a3b77a6c Binary files /dev/null and b/media/above-line-edit.gif differ diff --git a/media/autocomplete.gif b/media/autocomplete.gif new file mode 100644 index 000000000..ab86182d3 Binary files /dev/null and b/media/autocomplete.gif differ diff --git a/media/image.gif b/media/image.gif new file mode 100644 index 000000000..25d413e43 Binary files /dev/null and b/media/image.gif differ diff --git a/media/scratch.gif b/media/scratch.gif new file mode 100644 index 000000000..a5dc01006 Binary files /dev/null and b/media/scratch.gif differ diff --git a/schema/json/ModelName.json b/schema/json/ModelName.json index f5aeae752..c030566da 100644 --- a/schema/json/ModelName.json +++ b/schema/json/ModelName.json @@ -6,7 +6,7 @@ "gpt-4", "gpt-3.5-turbo-0613", "gpt-4-32k", - "gpt-4-1106-preview", + "gpt-4-turbo-preview", "mistral-7b", "llama2-7b", "llama2-13b",