* Add model-recs yaml file for central updating * feat: centralize model recommendations with React component - Add ModelRecommendations.jsx component for dynamic table rendering - Replace static markdown table in models.mdx with reusable component - Update model recommendations with latest 2025 models - Add support for role-based filtering and markdown link parsing - Remove unused YAML data files to reduce duplication - Implement centralized model management per Mintlify best practices * Add recommended agent models to agent docs * Add Autocomplete model recs * Link to mercury coder * Add Recommendations for chat models * Add recommendation for edit * Add Autocomplete recs * Add chat model recs * Add model recs to edit * Run Prettier * Fix merge conflicts * Merge new files from main * Add name to package.json
84 lines
2.5 KiB
Text
84 lines
2.5 KiB
Text
---
|
|
title: Edit Role
|
|
description: Edit model role
|
|
keywords: [edit, editing, model, role]
|
|
sidebar_position: 3
|
|
---
|
|
import { ModelRecommendations } from '/snippets/ModelRecommendations.jsx'
|
|
|
|
It's often useful to select a different model to respond to Edit prompts than for chat prompts, as Edits are often more code-specific and may require less conversational readability.
|
|
|
|
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.
|
|
|
|
<Tabs>
|
|
<Tab title="YAML">
|
|
Use model roles.
|
|
```yaml title="config.yaml"
|
|
models:
|
|
- name: Claude 3.5 Sonnet
|
|
provider: anthropic
|
|
model: claude-3-5-sonnet-latest
|
|
apiKey: <YOUR_ANTHROPIC_API_KEY>
|
|
roles:
|
|
- edit
|
|
```
|
|
</Tab>
|
|
<Tab title="JSON">
|
|
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": "<YOUR_ANTHROPIC_API_KEY>"
|
|
},
|
|
"experimental": {
|
|
"modelRoles": {
|
|
"inlineEdit": "Claude 3.5 Sonnet",
|
|
}
|
|
}
|
|
}
|
|
```
|
|
</Tab>
|
|
</Tabs>
|
|
|
|
Explore edit models in [the hub](https://hub.continue.dev/explore/models?roles=edit). Generally, our recommendations for Edit overlap with recommendations for Chat.
|
|
|
|
## Model Recommendations
|
|
|
|
<ModelRecommendations role="chat_edit" />
|
|
|
|
## Prompt templating
|
|
|
|
You can customize the prompt template used for editing code by setting the `promptTemplates.edit` property in your model configuration. Continue uses [Handlebars syntax](https://handlebarsjs.com/guide/) for templating.
|
|
|
|
Available variables for the edit template:
|
|
|
|
- `{{{userInput}}}` - The user's edit request/instruction
|
|
- `{{{language}}}` - The programming language of the code
|
|
- `{{{codeToEdit}}}` - The code that's being edited
|
|
- `{{{prefix}}}` - Content before the edit area
|
|
- `{{{suffix}}}` - Content after the edit area
|
|
- `{{{supportsCompletions}}}` - Whether the model supports completions API
|
|
- `{{{supportsPrefill}}}` - Whether the model supports prefill capability
|
|
|
|
Example:
|
|
|
|
```yaml
|
|
models:
|
|
- name: My Custom Edit Template
|
|
provider: openai
|
|
model: gpt-4o
|
|
promptTemplates:
|
|
edit: |
|
|
`Here is the code before editing:
|
|
\`\`\`{{{language}}}
|
|
{{{codeToEdit}}}
|
|
\`\`\`
|
|
|
|
Here is the edit requested:
|
|
"{{{userInput}}}"
|
|
|
|
Here is the code after editing:`
|
|
```
|