diff --git a/docs/docs/actions/how-to-customize.md b/docs/docs/actions/how-to-customize.md index 9153a38b0..2f13e4f1a 100644 --- a/docs/docs/actions/how-to-customize.md +++ b/docs/docs/actions/how-to-customize.md @@ -5,49 +5,6 @@ keywords: [customize, actions] sidebar_position: 5 --- -## Built-in slash commands +The easiest way to add actions is by adding [`prompt` blocks](../hub/blocks/block-types.md#prompts) to your assistant, which show up as slash commands in [Chat](../chat/how-it-works.md). -Continue has a large library of built-in slash commands, but when you first install we only display the most commonly used ones, like “/edit”, “/comment”, and “/share”. To add more actions, you can open [config.json](../json-reference.md) and add them to the `slashCommands` array. - -## Custom slash commands - -There are two ways to add custom slash commands: - -1. With `.prompt` files - this is recommended in most cases. See the full reference [here](../customize/deep-dives/prompt-files.md). -2. With `config.ts` - this gives you full programmatic access to the LLM, IDE, and other important entities by writing a JavaScript/TypeScript function - -### Custom Slash Commands with `config.ts` - -If you want to go a step further than writing custom commands with natural language, you can write a custom function that returns the response. This requires using `config.ts` instead of `config.json`. - -To do this, push a new `SlashCommand` object to the `slashCommands` list. This object contains "name", the name that you will type to invoke the slash command, "description", the description seen in the dropdown menu, and "run". The `run` function is any async generator that should yield strings as you want them to be streamed to the UI. As an argument to the function, you have access to a `ContinueSDK` object with utilities such as access to certain information/actions within the IDE, the current language model, and a few other utilities. For example, here is a slash command that generates a commit message: - -```typescript title="config.ts" -export function modifyConfig(config: Config): Config { - config.slashCommands?.push({ - name: "commit", - description: "Write a commit message", - run: async function* (sdk) { - // The getDiff function takes a boolean parameter that indicates whether - // to include unstaged changes in the diff or not. - const diff = await sdk.ide.getDiff(false); // Pass false to exclude unstaged changes - for await (const message of sdk.llm.streamComplete( - `${diff}\n\nWrite a commit message for the above changes. Use no more than 20 tokens to give a brief description in the imperative mood (e.g. 'Add feature' not 'Added feature'):`, - new AbortController().signal, - { - maxTokens: 20, - }, - )) { - yield message; - } - }, - }); - return config; -} -``` - -## Other custom actions - -Currently the other action triggers are not open for configuration, but we plan to allow this via .prompt files in the future. - - +Check out the [slash commands deep dive](../customize/slash-commands.mdx) for more information on extending actions. diff --git a/docs/docs/actions/model-setup.md b/docs/docs/actions/model-setup.md index 81133787a..91912dcbf 100644 --- a/docs/docs/actions/model-setup.md +++ b/docs/docs/actions/model-setup.md @@ -5,6 +5,6 @@ keywords: [model] sidebar_position: 2 --- -By default, Actions uses the same model as [Chat](chat/model-setup.mdx) since we recommend a similar, 400B+ parameter model or one of the frontier models for the complex instructions that will be carried out. +By default, Actions uses the same model as [Chat](chat/model-setup.mdx), since we recommend a similar, 400B+ parameter model or one of the frontier models for the complex instructions that will be carried out. You can also set specific models to be used for Edit and Apply actions. See the [Model roles](../customize/model-roles/intro.mdx) page for more details. diff --git a/docs/docs/autocomplete/model-setup.mdx b/docs/docs/autocomplete/model-setup.mdx index 1b67997a3..aa05e3c31 100644 --- a/docs/docs/autocomplete/model-setup.mdx +++ b/docs/docs/autocomplete/model-setup.mdx @@ -12,4 +12,6 @@ For the best autocomplete experience we recommend Codestral from Mistral. Add Codestral to your assistant from the hub [here](https://hub.continue.dev/mistral/codestral). Visit the [Mistral Platform](https://console.mistral.ai/codestral) to get a Codestral API key. +For a fully local autocomplete experience, we recommend [Qwen 2.5 Coder 1.5B on Ollama](https://hub.continue.dev/ollama/qwen2.5-coder-1.5b). + For more details about setup and recommended models, visit the [autocomplete deep dive](../customize/deep-dives/autocomplete.mdx). diff --git a/docs/docs/chat/how-to-customize.md b/docs/docs/chat/how-to-customize.md index aad019940..acb357983 100644 --- a/docs/docs/chat/how-to-customize.md +++ b/docs/docs/chat/how-to-customize.md @@ -5,11 +5,11 @@ keywords: [customize, chat] sidebar_position: 5 --- -There are a number of different ways to customize Chat +There are a number of different ways to customize Chat: -- You can add a [`.continuerules`](../customize/deep-dives/rules.md) file to the root of your project to customize the system prompt +- You can add a [`rules` block](../hub/blocks/block-types.md#rules) to your assistant to give the model persistent instructions through the system prompt. See the [rules deep dive](../customize/deep-dives/rules.md) for more information. - You can configure [`@Codebase`](../customize/deep-dives/codebase.mdx) -- You can create your own [custom code RAG](../customize/tutorials/custom-code-rag.mdx) - You can configure [`@Docs`](../customize/deep-dives/docs.mdx) -- You can [build your own context provider](../customize/tutorials/build-your-own-context-provider.mdx) - You can configure and create custom [tools](../customize/tools.mdx) +- You can [build your own context provider](../customize/tutorials/build-your-own-context-provider.mdx) +- You can create your own [custom code RAG](../customize/tutorials/custom-code-rag.mdx) diff --git a/docs/docs/chat/model-setup.mdx b/docs/docs/chat/model-setup.mdx index 903c5054e..989f37b42 100644 --- a/docs/docs/chat/model-setup.mdx +++ b/docs/docs/chat/model-setup.mdx @@ -12,4 +12,13 @@ For the best chat experience we recommend Claude 3.7 Sonnet from Anthropic. Add Claude 3.7 Sonnet to your assistant from the hub [here](https://hub.continue.dev/anthropic/claude-3-7-sonnet). You can get an API key from the [Anthropic console](https://console.anthropic.com/settings/keys). +Other recommended chat models include: + +- [GPT-4o from OpenAI](https://hub.continue.dev/openai/gpt-4o) +- [Grok-2 from xAI](https://hub.continue.dev/xai/grok-2) +- [Gemini 1.5 Pro from Google](https://hub.continue.dev/google/gemini-1.5-pro) +- [Llama 3.1 8b from Meta on Ollama](https://hub.continue.dev/ollama/llama3.1-8b) for a fully local experience + {/* HUB_TODO nonexistent blocks */} +- Deepseek Coder 2 from deepseek on [Ollama](https://hub.continue.dev/explore/models) or [LM Studio](https://hub.continue.dev/explore/models) + For more details about setup and recommended models, see [here](../customize/model-roles/chat.mdx). diff --git a/docs/docs/customize/deep-dives/autocomplete.mdx b/docs/docs/customize/deep-dives/autocomplete.mdx index 12e9b5fb0..4966689db 100644 --- a/docs/docs/customize/deep-dives/autocomplete.mdx +++ b/docs/docs/customize/deep-dives/autocomplete.mdx @@ -55,7 +55,7 @@ Then, add the model to your configuration: - [Qwen 2.5 Coder 1.5B model block](https://hub.continue.dev/lmstudio/qwen2.5-coder-1.5b) + [Ollama Qwen 2.5 Coder 1.5B model block](https://hub.continue.dev/ollama/qwen2.5-coder-1.5b) ```yaml title="config.yaml" @@ -82,92 +82,23 @@ Then, add the model to your configuration: Once the model 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 (note that it is not inside the models array): - - - - ```yaml title="config.yaml" - models: - - name: Tab Autocomplete Model - provider: ollama - model: qwen2.5-coder:1.5b - apiBase: https:// - roles: - - autocomplete - ``` - - - ```json title="config.json" - { - "tabAutocompleteModel": { - "title": "Tab Autocomplete Model", - "provider": "ollama", - "model": "qwen2.5-coder:1.5b", - "apiBase": "https://" - } - } - ``` - - - -If you aren't yet familiar with the available options, you can find the full reference [here](./configuration.md). - ## Configuration Options -The following can be configured in `config.json`: +### Hub Autocomplete models -### `tabAutocompleteModel` +Explore autocomplete model configurations on [the hub](https://hub.continue.dev/explore/models?roles=autocomplete) -This is just another object like the ones in the `"models"` array of `config.json`. You can choose and configure any model you would like, but we strongly suggest using a small model made for tab-autocomplete, such as `deepseek-1b`, `qwen2.5-coder:1.5b`, or `starcoder2-3b`. +### Autocomplete User Settings -### `tabAutocompleteOptions` +The following settings can be configured for autocompletion in the IDE extension [User Settings Page](../settings.md): -This object allows you to customize the behavior of tab-autocomplete. The available options are shown below, and you can find their default values [here](https://github.com/continuedev/continue/blob/fbeb2e4fe15d4b434a30a136f74b672485c852d9/core/util/parameters.ts). +- `Use autocomplete cache`: If on, caches completions +- `Multiline Autocompletions`: Controls multiline completions for autocomplete. Can be set to `always`, `never`, or `auto`. Defaults to `auto` +- `Disable autocomplete in files`: List of comma-separated glob pattern to disable autocomplete in matching files. E.g., "\_/.md, \*/.txt" -- `disable`: Disable autocomplete (can also be done from IDE settings) (default: `false`) -- `template`: An optional template string to be used for autocomplete. It will be rendered with the Mustache templating language, and is passed the 'prefix' and 'suffix' variables. (String) -- `maxPromptTokens`: The maximum number of prompt tokens to use. A smaller number will yield faster completions, but less context. (Number) (default: `1024`) -- `prefixPercentage`: The percentage of the input that should be dedicated to the prefix. (Number) (default: `0.3`) -- `maxSuffixPercentage`: The maximum percentage of the prompt that can be dedicated to the suffix. (Number) (default: `0.2`) -- `debounceDelay`: The delay in milliseconds before triggering autocomplete after a keystroke. (Number) (default: `350`) -- `multilineCompletions`: Whether to enable multiline completions ("always", "never", or "auto"). Defaults to "auto". (default: `auto`) -- `useCache`: Whether to cache and reuse completions when the prompt is the same as a previous one. May be useful to disable for testing purposes. (default: `true`) -- `disableInFiles`: A list of glob patterns for files in which you want to disable tab autocomplete. (default: `[]`) +### `config.json` Configuration -### Full example - - - - ```yaml title="config.yaml" - models: - - name: Tab Autocomplete Model - provider: ollama - model: qwen2.5-coder:1.5b-base - apiBase: https:// - roles: - - autocomplete - ``` - - - ```json title="config.json" - { - "tabAutocompleteModel": { - "title": "Tab Autocomplete Model", - "provider": "ollama", - "model": "qwen2.5-coder:1.5b-base", - "apiBase": "https://" - }, - "tabAutocompleteOptions": { - "debounceDelay": 500, - "maxPromptTokens": 1500, - "disableInFiles": ["*.md"] - } - } - ``` - - +The `config.json` configuration format (deprecated) offers further configuration options through `tabAutocompleteOptions`. See the [JSON Reference](../../reference.md#tabAutocompleteOptions) for more details. ## FAQs @@ -181,7 +112,7 @@ Follow these steps to ensure that everything is set up correctly: 1. Make sure you have the "Enable Tab Autocomplete" setting checked (in VS Code, you can toggle by clicking the "Continue" button in the status bar, and in JetBrains by going to Settings -> Tools -> Continue). 2. Make sure you have downloaded Ollama. -3. Run `ollama run qwen2.5-coder:1.5b-base` to verify that the model is downloaded. +3. Run `ollama run qwen2.5-coder:1.5b` to verify that the model is downloaded. 4. Make sure that any other completion providers are disabled (e.g. Copilot), as they may interfere. 5. Check the output of the logs to find any potential errors: cmd/ctrl + shift + P -> "Toggle Developer Tools" -> "Console" tab in VS Code, ~/.continue/logs/core.log in JetBrains. 6. Check VS Code settings to make sure that `"editor.inlineSuggest.enabled"` is set to `true` (use cmd/ctrl + , then search for this and check the box) diff --git a/docs/docs/customize/deep-dives/codebase.mdx b/docs/docs/customize/deep-dives/codebase.mdx index 24256672e..a500e80dc 100644 --- a/docs/docs/customize/deep-dives/codebase.mdx +++ b/docs/docs/customize/deep-dives/codebase.mdx @@ -11,7 +11,7 @@ import Tabs from "@theme/Tabs"; Continue indexes your codebase so that it can later automatically pull in the most relevant context from throughout your workspace. This is done via a combination of embeddings-based retrieval and keyword search. By default, all embeddings are calculated locally using `transformers.js` and stored locally in `~/.continue/index`. :::info[`transformers.js cannot be used in JetBrains`] -Currently, `transformers.js` cannot be used in JetBrains IDEs. However, you can select a differet embeddings model from [the list here](../model-roles/embeddings.mdx). +Currently, `transformers.js` cannot be used in JetBrains IDEs. However, you can select a differet embeddings model from [the list here](../model-types/embeddings.mdx). ::: Currently, the codebase retrieval feature is available as the "codebase" and "folder" context providers. You can use them by typing `@Codebase` or `@Folder` in the input box, and then asking a question. The contents of the input box will be compared with the embeddings from the rest of the codebase (or folder) to determine relevant files. diff --git a/docs/docs/customize/model-roles/apply.mdx b/docs/docs/customize/model-roles/apply.mdx index be1879b03..1ecace184 100644 --- a/docs/docs/customize/model-roles/apply.mdx +++ b/docs/docs/customize/model-roles/apply.mdx @@ -10,8 +10,6 @@ import Tabs from "@theme/Tabs"; When editing code, Chat and Edit model output often doesn't clearly align with existing code. A model with the `apply` role is used to generate a more precise diff to apply changes to a file. -Generally speaking, models proficient in editing can also be used for applying code. +Generally speaking, models proficient in chat and edit can also be used for applying code. Explore apply models in [the hub](https://hub.continue.dev/explore/models?roles=apply). - -{/* HUB_TODO recommended apply models? */} diff --git a/docs/docs/customize/model-roles/chat.mdx b/docs/docs/customize/model-roles/chat.mdx index f88a8cc9f..42b9df280 100644 --- a/docs/docs/customize/model-roles/chat.mdx +++ b/docs/docs/customize/model-roles/chat.mdx @@ -5,6 +5,9 @@ keywords: [chat, model, role] sidebar_position: 1 --- +import TabItem from "@theme/TabItem"; +import Tabs from "@theme/Tabs"; + A "chat model" is an LLM that is trained to respond in a conversational format. Because they should be able to answer general questions and generate complex code, the best chat models are typically large, often 405B+ parameters. In Continue, these models are used for [Chat](../../chat/how-to-use-it.md) and [Actions](../../actions/how-to-use-it.md). The selected chat model will also be used for [Edit](../../edit/how-to-use-it.md) and [Apply](./apply.mdx) if no `edit` or `apply` models are specified, respectively. @@ -17,9 +20,12 @@ For the best overall Chat experience, you will want to use a 400B+ parameter mod ### Claude Sonnet 3.5 from Anthropic -Our current top recommendation is Claude Sonnet 3.5 from [Anthropic](../customize/model-providers/top-level/anthropic.mdx). +Our current top recommendation is Claude Sonnet 3.7 from [Anthropic](../customize/model-providers/top-level/anthropic.mdx). - + + + View the [Claude 3.7 Sonnet model block](https://hub.continue.dev/anthropic/claude-3-7-sonnet) on the hub. + ```yaml title="config.yaml" models: @@ -49,7 +55,27 @@ Our current top recommendation is Claude Sonnet 3.5 from [Anthropic](../customiz If you prefer to use an open-weight model, then Llama 3.1 405B from Meta is your best option right now. You will need to decide if you use it through a SaaS model provider (e.g. [Together](../customize/model-providers/more/together.mdx) or [Groq](../customize/model-providers/more/groq.mdx)) or self-host it (e.g. using [vLLM](../customize/model-providers//more/vllm.mdx) or [Ollama](../customize/model-providers/top-level/ollama.mdx)). - + + + + {/* HUB_TODO nonexistent block */} + + Add the [Together Llama 3.1 405b block](https://hub.continue.dev/explore/assistants) from the hub + + {/* HUB_TODO nonexistent block */} + + Add the [Groq Llama 3.1 405b block](https://hub.continue.dev/explore/assistants) from the hub + + {/* HUB_TODO nonexistent block */} + + Add the [vLLM Llama 3.1 405b block](https://hub.continue.dev/explore/assistants) from the hub + + {/* HUB_TODO nonexistent block */} + + Add the [Ollama Llama 3.1 405b block](https://hub.continue.dev/explore/assistants) from the hub + + + @@ -152,7 +178,10 @@ If you prefer to use an open-weight model, then Llama 3.1 405B from Meta is your If you prefer to use a model from [OpenAI](../customize/model-providers/top-level/openai.mdx), then we recommend GPT-4o. - + + + Add the [OpenAI GPT-4o block](https://hub.continue.dev/openai/gpt-4o) from the hub + ```yaml title="config.yaml" models: @@ -182,7 +211,10 @@ If you prefer to use a model from [OpenAI](../customize/model-providers/top-leve If you prefer to use a model from [xAI](../customize/model-providers/top-level/xAI.mdx), then we recommend Grok-2. - + + + Add the [xAI Grok-2 block](https://hub.continue.dev/xai/grok-2) from the hub + ```yaml title="config.yaml" models: @@ -212,7 +244,10 @@ If you prefer to use a model from [xAI](../customize/model-providers/top-level/x If you prefer to use a model from [Google](../customize/model-providers/top-level/gemini.mdx), then we recommend Gemini 1.5 Pro. - + + + Add the [Gemini 1.5 Pro block](https://hub.continue.dev/google/gemini-1.5-pro) from the hub + ```yaml title="config.yaml" models: @@ -246,7 +281,18 @@ For the best local, offline Chat experience, you will want to use a model that i If your local machine can run an 8B parameter model, then we recommend running Llama 3.1 8B on your machine (e.g. using [Ollama](../customize/model-providers/top-level/ollama.mdx) or [LM Studio](../customize/model-providers/more/lmstudio.mdx)). - + + + + + Add the [Ollama Llama 3.1 8b block](https://hub.continue.dev/ollama/llama3.1-8b) from the hub + + {/* HUB_TODO nonexistent block */} + + Add the [LM Studio Llama 3.1 8b block](https://hub.continue.dev/explore/models) from the hub + + + @@ -303,7 +349,19 @@ If your local machine can run an 8B parameter model, then we recommend running L If your local machine can run a 16B parameter model, then we recommend running DeepSeek Coder 2 16B (e.g. using [Ollama](../customize/model-providers/top-level/ollama.mdx) or [LM Studio](../customize/model-providers/more/lmstudio.mdx)). - + + + + {/* HUB_TODO nonexistent block */} + + Add the [Ollama Deepseek Coder 2 16B block](https://hub.continue.dev/explore/models) from the hub + + {/* HUB_TODO nonexistent block */} + + Add the [LM Studio Deepseek Coder 2 16B block](https://hub.continue.dev/explore/models) from the hub + + + @@ -359,4 +417,4 @@ If your local machine can run a 16B parameter model, then we recommend running D ## Other experiences -There are many more models and providers you can use with Chat beyond those mentioned above. Read more [here](../customize/model-roles/chat.mdx) +There are many more models and providers you can use with Chat beyond those mentioned above. Read more [here](../model-roles/chat.mdx) diff --git a/docs/docs/customize/model-roles/edit.mdx b/docs/docs/customize/model-roles/edit.mdx index aa86ff0d8..57bbc76aa 100644 --- a/docs/docs/customize/model-roles/edit.mdx +++ b/docs/docs/customize/model-roles/edit.mdx @@ -12,5 +12,37 @@ It's often useful to select a different model to respond to Edit prompts than fo In Continue, you can add `edit` to a model's roles to specify that it can be used for Edit requests. If no edit models are specified, the selected `chat` model is used. -Explore edit models in [the hub](https://hub.continue.dev/explore/models?roles=edit). -{/* HUB_TODO recommended edit models? */} + + + Use model roles. + ```yaml title="config.yaml" + models: + - name: Claude 3.5 Sonnet + provider: anthropic + model: claude-3-5-sonnet-latest + apiKey: + roles: + - edit + ``` + + + Set the `experimental.modelRoles.inlineEdit` property in `config.json`. + ```json title="config.json" + { + "models": { + "name": "Claude 3.5 Sonnet", + "provider": "anthropic", + "model": "claude-3-5-sonnet-latest", + "apiKey": "" + }, + "experimental": { + "modelRoles": { + "inlineEdit": "Claude 3.5 Sonnet", + } + } + } + ``` + + + +Explore edit models in [the hub](https://hub.continue.dev/explore/models?roles=edit). Generally, we our recommendations for Edit overlap with recommendations for Chat. diff --git a/docs/docs/edit/how-to-customize.mdx b/docs/docs/edit/how-to-customize.mdx index 9c3d242dd..35b918393 100644 --- a/docs/docs/edit/how-to-customize.mdx +++ b/docs/docs/edit/how-to-customize.mdx @@ -8,37 +8,4 @@ keywords: [edit, cmd i, works] import TabItem from "@theme/TabItem"; import Tabs from "@theme/Tabs"; -You can configure a particular model to be used for Edit. - - - - Use model roles. - ```yaml title="config.yaml" - models: - - name: Claude 3.5 Sonnet - provider: anthropic - model: claude-3-5-sonnet-latest - apiKey: - roles: - - edit - ``` - - - Set the `experimental.modelRoles.inlineEdit` property in `config.json`. - ```json title="config.json" - { - "models": { - "name": "Claude 3.5 Sonnet", - "provider": "anthropic", - "model": "claude-3-5-sonnet-latest", - "apiKey": "" - }, - "experimental": { - "modelRoles": { - "inlineEdit": "Claude 3.5 Sonnet", - } - } - } - ``` - - +You can configure a particular model to be used for Edit by setting/overriding `roles` in the model's YAML config. See [Edit role](../customize/model-roles/edit.mdx) for more details.