Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/bug_report.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ body:
- **OS**: macOS
- **Continue version**: v0.9.4
- **IDE version**: VSCode 1.85.1
- Model: Claude Sonnet 3.5
- Model: Claude Sonnet 4.5
- Agent configuration
value: |
- OS:
Expand Down
4 changes: 2 additions & 2 deletions core/config/workspace/workspaceBlocks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,9 @@ function getContentsForNewBlock(blockType: BlockType): ConfigYaml {
configYaml.models = [
{
provider: "anthropic",
model: "claude-3-7-sonnet-latest",
model: "claude-sonnet-4-5",
apiKey: "${{ secrets.ANTHROPIC_API_KEY }}",
name: "Claude 3.7 Sonnet",
name: "Claude Sonnet 4.5",
roles: ["chat", "edit"],
},
];
Expand Down
30 changes: 15 additions & 15 deletions core/llm/llms/Anthropic.vitest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ describe("Anthropic", () => {
test("streamChat should send a valid request", async () => {
const anthropic = new Anthropic({
apiKey: "test-api-key",
model: "claude-3-5-sonnet-latest",
model: "claude-sonnet-4-5",
apiBase: "https://api.anthropic.com/v1/",
});

Expand All @@ -155,7 +155,7 @@ describe("Anthropic", () => {
"x-api-key": "test-api-key",
},
body: {
model: "claude-3-5-sonnet-latest",
model: "claude-sonnet-4-5",
max_tokens: 8192,
stream: true,
messages: [
Expand All @@ -177,7 +177,7 @@ describe("Anthropic", () => {
test("chat should send a valid request", async () => {
const anthropic = new Anthropic({
apiKey: "test-api-key",
model: "claude-3-5-sonnet-latest",
model: "claude-sonnet-4-5",
apiBase: "https://api.anthropic.com/v1/",
});

Expand All @@ -198,7 +198,7 @@ describe("Anthropic", () => {
"x-api-key": "test-api-key",
},
body: {
model: "claude-3-5-sonnet-latest",
model: "claude-sonnet-4-5",
max_tokens: 8192,
stream: true,
messages: [
Expand All @@ -220,7 +220,7 @@ describe("Anthropic", () => {
test("streamComplete should send a valid request", async () => {
const anthropic = new Anthropic({
apiKey: "test-api-key",
model: "claude-3-5-sonnet-latest",
model: "claude-sonnet-4-5",
apiBase: "https://api.anthropic.com/v1/",
});

Expand All @@ -238,7 +238,7 @@ describe("Anthropic", () => {
"x-api-key": "test-api-key",
},
body: {
model: "claude-3-5-sonnet-latest",
model: "claude-sonnet-4-5",
max_tokens: 8192,
stream: true,
messages: [
Expand All @@ -260,7 +260,7 @@ describe("Anthropic", () => {
test("complete should send a valid request", async () => {
const anthropic = new Anthropic({
apiKey: "test-api-key",
model: "claude-3-5-sonnet-latest",
model: "claude-sonnet-4-5",
apiBase: "https://api.anthropic.com/v1/",
});

Expand All @@ -278,7 +278,7 @@ describe("Anthropic", () => {
"x-api-key": "test-api-key",
},
body: {
model: "claude-3-5-sonnet-latest",
model: "claude-sonnet-4-5",
max_tokens: 8192,
stream: true,
messages: [
Expand All @@ -301,7 +301,7 @@ describe("Anthropic", () => {
test("should handle system message", async () => {
const anthropic = new Anthropic({
apiKey: "test-api-key",
model: "claude-3-5-sonnet-latest",
model: "claude-sonnet-4-5",
apiBase: "https://api.anthropic.com/v1/",
});

Expand All @@ -325,7 +325,7 @@ describe("Anthropic", () => {
"x-api-key": "test-api-key",
},
body: {
model: "claude-3-5-sonnet-latest",
model: "claude-sonnet-4-5",
max_tokens: 8192,
stream: true,
messages: [
Expand All @@ -347,7 +347,7 @@ describe("Anthropic", () => {
test("should handle tool calls", async () => {
const anthropic = new Anthropic({
apiKey: "test-api-key",
model: "claude-3-5-sonnet-latest",
model: "claude-sonnet-4-5",
apiBase: "https://api.anthropic.com/v1/",
});

Expand Down Expand Up @@ -386,7 +386,7 @@ describe("Anthropic", () => {
"x-api-key": "test-api-key",
},
body: {
model: "claude-3-5-sonnet-latest",
model: "claude-sonnet-4-5",
max_tokens: 8192,
stream: true,
messages: [
Expand Down Expand Up @@ -424,7 +424,7 @@ describe("Anthropic", () => {
test("should handle custom max tokens", async () => {
const anthropic = new Anthropic({
apiKey: "test-api-key",
model: "claude-3-5-sonnet-latest",
model: "claude-sonnet-4-5",
apiBase: "https://api.anthropic.com/v1/",
});

Expand All @@ -446,7 +446,7 @@ describe("Anthropic", () => {
"x-api-key": "test-api-key",
},
body: {
model: "claude-3-5-sonnet-latest",
model: "claude-sonnet-4-5",
max_tokens: 1000,
stream: true,
messages: [
Expand All @@ -470,7 +470,7 @@ describe("Anthropic", () => {
test("should throw error when API key is missing", async () => {
const anthropic = new Anthropic({
apiKey: "",
model: "claude-3-5-sonnet-latest",
model: "claude-sonnet-4-5",
apiBase: "https://api.anthropic.com/v1/",
});

Expand Down
20 changes: 10 additions & 10 deletions core/llm/llms/OpenRouter.vitest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@ import OpenRouter from "./OpenRouter";
describe("OpenRouter Anthropic Caching", () => {
it("should detect Anthropic models correctly", () => {
const openRouter = new OpenRouter({
model: "claude-3-5-sonnet-latest",
model: "claude-sonnet-4-5",
apiKey: "test-key",
});

// Test private method through modifyChatBody
const body: ChatCompletionCreateParams = {
model: "claude-3-5-sonnet-latest",
model: "claude-sonnet-4-5",
messages: [],
};

Expand All @@ -22,7 +22,7 @@ describe("OpenRouter Anthropic Caching", () => {

it("should add cache_control to user messages when caching is enabled", () => {
const openRouter = new OpenRouter({
model: "anthropic/claude-3.5-sonnet",
model: "anthropic/claude-sonnet-4.5",
apiKey: "test-key",
cacheBehavior: {
cacheConversation: true,
Expand All @@ -31,7 +31,7 @@ describe("OpenRouter Anthropic Caching", () => {
});

const body: ChatCompletionCreateParams = {
model: "anthropic/claude-3.5-sonnet",
model: "anthropic/claude-sonnet-4.5",
messages: [
{ role: "user", content: "First message" },
{ role: "assistant", content: "Response" },
Expand Down Expand Up @@ -71,7 +71,7 @@ describe("OpenRouter Anthropic Caching", () => {

it("should correctly handle cache_control with system messages present", () => {
const openRouter = new OpenRouter({
model: "claude-3-5-sonnet-latest",
model: "claude-sonnet-4-5",
apiKey: "test-key",
cacheBehavior: {
cacheConversation: true,
Expand All @@ -80,7 +80,7 @@ describe("OpenRouter Anthropic Caching", () => {
});

const body: ChatCompletionCreateParams = {
model: "claude-3-5-sonnet-latest",
model: "claude-sonnet-4-5",
messages: [
{ role: "system", content: "You are a helpful assistant" },
{ role: "user", content: "First user message" },
Expand Down Expand Up @@ -137,7 +137,7 @@ describe("OpenRouter Anthropic Caching", () => {

it("should add cache_control to system message when caching is enabled", () => {
const openRouter = new OpenRouter({
model: "claude-3-5-sonnet-latest",
model: "claude-sonnet-4-5",
apiKey: "test-key",
cacheBehavior: {
cacheConversation: false,
Expand All @@ -146,7 +146,7 @@ describe("OpenRouter Anthropic Caching", () => {
});

const body: ChatCompletionCreateParams = {
model: "claude-3-5-sonnet-latest",
model: "claude-sonnet-4-5",
messages: [
{ role: "system", content: "You are a helpful assistant" },
{ role: "user", content: "Hello" },
Expand Down Expand Up @@ -176,7 +176,7 @@ describe("OpenRouter Anthropic Caching", () => {

it("should handle array content correctly", () => {
const openRouter = new OpenRouter({
model: "claude-3-5-sonnet-latest",
model: "claude-sonnet-4-5",
apiKey: "test-key",
cacheBehavior: {
cacheConversation: true,
Expand All @@ -185,7 +185,7 @@ describe("OpenRouter Anthropic Caching", () => {
});

const body: ChatCompletionCreateParams = {
model: "claude-3-5-sonnet-latest",
model: "claude-sonnet-4-5",
messages: [
{
role: "user",
Expand Down
16 changes: 5 additions & 11 deletions core/llm/toolSupport.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -179,17 +179,11 @@ describe("PROVIDER_TOOL_SUPPORT", () => {
});

it("should return undefined for Claude Haiku and Opus models", () => {
expect(supportsFn("anthropic.claude-3-5-haiku-20240307-v1:0")).toBe(
false,
);
expect(supportsFn("anthropic.claude-3.5-haiku-20240620-v1:0")).toBe(
false,
);
expect(supportsFn("anthropic.claude-3-7-haiku-20240620-v1:0")).toBe(
false,
);
expect(supportsFn("anthropic.claude-3-5-opus-20240620-v1:0")).toBe(false);
expect(supportsFn("anthropic.claude-3.7-opus-20240620-v1:0")).toBe(false);
expect(supportsFn("anthropic.claude-3-5-haiku-20240307-v1:0")).toBe(true);
expect(supportsFn("anthropic.claude-3.5-haiku-20240620-v1:0")).toBe(true);
expect(supportsFn("anthropic.claude-3-7-haiku-20240620-v1:0")).toBe(true);
expect(supportsFn("anthropic.claude-3-5-opus-20240620-v1:0")).toBe(true);
expect(supportsFn("anthropic.claude-3.7-opus-20240620-v1:0")).toBe(true);
});

it("should return undefined for other unsupported models", () => {
Expand Down
51 changes: 13 additions & 38 deletions core/llm/toolSupport.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,39 +14,17 @@ export const PROVIDER_TOOL_SUPPORT: Record<string, (model: string) => boolean> =
}
} catch (e) {}

return [
"claude-3-5",
"claude-3.5",
"claude-3-7",
"claude-3.7",
"claude-sonnet-4",
"claude-4-sonnet",
"gpt-4",
"o3",
"gemini",
"claude-opus-4",
"gemma",
].some((part) => model.toLowerCase().startsWith(part));
return ["claude", "gpt-4", "o3", "gemini", "gemma"].some((part) =>
model.toLowerCase().startsWith(part),
);
},
anthropic: (model) => {
const lower = model.toLowerCase();
if (
[
"claude-3-5",
"claude-3.5",
"claude-3-7",
"claude-3.7",
"claude-sonnet-4",
"claude-4-sonnet",
"claude-opus-4",
].some((part) => lower.startsWith(part))
) {
return true;
if (model.includes("claude-2") || model.includes("claude-instant")) {
return false;
}
if (lower.includes("claude") && lower.includes("4-5")) {
if (["claude"].some((part) => model.toLowerCase().startsWith(part))) {
return true;
}

return false;
},
azure: (model) => {
Expand Down Expand Up @@ -125,15 +103,12 @@ export const PROVIDER_TOOL_SUPPORT: Record<string, (model: string) => boolean> =
);
},
bedrock: (model) => {
if (model.includes("claude-2") || model.includes("claude-instant")) {
return false;
}
if (
[
"claude-3-5-sonnet",
"claude-3.5-sonnet",
"claude-3-7-sonnet",
"claude-3.7-sonnet",
"claude-sonnet-4",
"claude-4-sonnet",
"claude-opus-4",
"claude",
"nova-lite",
"nova-pro",
"nova-micro",
Expand Down Expand Up @@ -280,8 +255,7 @@ export const PROVIDER_TOOL_SUPPORT: Record<string, (model: string) => boolean> =
"openai/o3",
"openai/o4",
"openai/gpt-oss",
"anthropic/claude-3",
"anthropic/claude-4",
"anthropic/claude",
"microsoft/phi-3",
"google/gemini-flash-1.5",
"google/gemini-2",
Expand Down Expand Up @@ -391,7 +365,8 @@ export function isRecommendedAgentModel(modelName: string): boolean {
const recs: RegExp[][] = [
[/o[134]/],
[/deepseek/, /r1|reasoner/],
[/gemini/, /2\.5|3/, /pro/],
[/gemini/, /2\.5/, /pro/],
[/gemini/, /3-pro/],
[/gpt/, /-5|5\.1/],
[/claude/, /sonnet/, /3\.7|3-7|-4/],
[/claude/, /opus/, /-4/],
Expand Down
2 changes: 1 addition & 1 deletion docs/customize/model-providers/top-level/anthropic.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ sidebarTitle: "Anthropic"
</Tabs>

<Info>
**Check out a more advanced configuration [here](https://hub.continue.dev/anthropic/claude-4-sonnet?view=config)**
**Check out a more advanced configuration [here](https://hub.continue.dev/anthropic/claude-sonnet-4-5?view=config)**
</Info>

## How to Enable Prompt Caching with Claude
Expand Down
4 changes: 2 additions & 2 deletions docs/customize/models.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,10 @@ Read more about [model roles](/customize/model-roles), [model capabilities](/cus

# Frontier Models

[Claude 4 Sonnet](https://hub.continue.dev/anthropic/claude-4-sonnet) from Anthropic
[Claude Sonnet 4.5](https://hub.continue.dev/anthropic/claude-sonnet-4-5) from Anthropic

1. Get your API key from [Anthropic](https://console.anthropic.com/)
2. Add [Claude 4 Sonnet](https://hub.continue.dev/anthropic/claude-4-sonnet) to a config on Continue Mission Control
2. Add[Claude Sonnet 4.5](https://hub.continue.dev/anthropic/claude-sonnet-4-5) to a config on Continue Mission Control
3. Add `ANTHROPIC_API_KEY` as a [User Secret](https://docs.continue.dev/mission-control/secrets/secret-types#user-secrets) on Continue Mission Control [here](https://hub.continue.dev/settings/secrets)
4. Click `Reload config` in the config selector in the Continue IDE extension

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@ const val DEFAULT_CONFIG =
{
"models": [
{
"model": "claude-3-5-sonnet-latest",
"model": "claude-sonnet-4-5",
"provider": "anthropic",
"apiKey": "",
"title": "Claude 3.5 Sonnet"
"title": "Claude Sonnet 4.5"
}
],
"tabAutocompleteModel": {
Expand Down
Loading
Loading