diff --git a/core/config/default.ts b/core/config/default.ts index f75fcbe65..60d74f7ec 100644 --- a/core/config/default.ts +++ b/core/config/default.ts @@ -27,6 +27,11 @@ export const defaultConfig: SerializedContinueConfig = { provider: "free-trial", model: "mistral-8x7b", }, + { + title: "Claude 3 Sonnet (Free Trial)", + provider: "free-trial", + model: "claude-3-sonnet-20240229", + }, ], slashCommands: [ { @@ -98,6 +103,11 @@ export const defaultConfigJetBrains: SerializedContinueConfig = { provider: "free-trial", model: "mistral-8x7b", }, + { + title: "Claude 3 Sonnet (Free Trial)", + provider: "free-trial", + model: "claude-3-sonnet-20240229", + }, ], slashCommands: [ { diff --git a/core/index.d.ts b/core/index.d.ts index 02e10c17b..c8d03177a 100644 --- a/core/index.d.ts +++ b/core/index.d.ts @@ -16,7 +16,7 @@ declare global { postIntellijMessage?: ( messageType: string, data: any, - messageIde: string + messageIde: string, ) => void; } } @@ -73,17 +73,17 @@ export interface ILLM extends LLMOptions { streamComplete( prompt: string, - options?: LLMFullCompletionOptions + options?: LLMFullCompletionOptions, ): AsyncGenerator; streamChat( messages: ChatMessage[], - options?: LLMFullCompletionOptions + options?: LLMFullCompletionOptions, ): AsyncGenerator; chat( messages: ChatMessage[], - options?: LLMFullCompletionOptions + options?: LLMFullCompletionOptions, ): Promise; countTokens(text: string): number; @@ -123,10 +123,10 @@ export interface CustomContextProvider { type?: ContextProviderType; getContextItems( query: string, - extras: ContextProviderExtras + extras: ContextProviderExtras, ): Promise; loadSubmenuItems?: ( - args: LoadSubmenuItemsArgs + args: LoadSubmenuItemsArgs, ) => Promise; } @@ -141,7 +141,7 @@ export interface IContextProvider { getContextItems( query: string, - extras: ContextProviderExtras + extras: ContextProviderExtras, ): Promise; loadSubmenuItems(args: LoadSubmenuItemsArgs): Promise; @@ -287,15 +287,15 @@ export interface CustomLLMWithOptionals { streamCompletion?: ( prompt: string, options: CompletionOptions, - fetch: (input: RequestInfo | URL, init?: RequestInit) => Promise + fetch: (input: RequestInfo | URL, init?: RequestInit) => Promise, ) => AsyncGenerator; streamChat?: ( messages: ChatMessage[], options: CompletionOptions, - fetch: (input: RequestInfo | URL, init?: RequestInit) => Promise + fetch: (input: RequestInfo | URL, init?: RequestInit) => Promise, ) => AsyncGenerator; listModels?: ( - fetch: (input: RequestInfo | URL, init?: RequestInit) => Promise + fetch: (input: RequestInfo | URL, init?: RequestInit) => Promise, ) => Promise; } @@ -348,7 +348,7 @@ export interface IDE { getDebugLocals(threadIndex: number): Promise; getTopLevelCallStackSources( threadIndex: number, - stackDepth: number + stackDepth: number, ): Promise; getAvailableThreads(): Promise; listWorkspaceContents(directory?: string): Promise; @@ -366,12 +366,12 @@ export interface IDE { showLines( filepath: string, startLine: number, - endLine: number + endLine: number, ): Promise; showDiff( filepath: string, newContents: string, - stepIndex: number + stepIndex: number, ): Promise; getOpenFiles(): Promise; getPinnedFiles(): Promise; @@ -513,6 +513,7 @@ export type ModelName = | "claude-2" | "claude-3-opus-20240229" | "claude-3-sonnet-20240229" + | "claude-3-haiku-20240307" | "claude-2.1" // Google PaLM | "chat-bison-001" diff --git a/core/llm/autodetect.ts b/core/llm/autodetect.ts index a29ababf8..013525f47 100644 --- a/core/llm/autodetect.ts +++ b/core/llm/autodetect.ts @@ -151,8 +151,9 @@ function autodetectTemplateType(model: string): TemplateType | undefined { return "zephyr"; } + // Claude requests always sent through Messages API, so formatting not necessary if (lower.includes("claude")) { - return "anthropic"; + return "none"; } if (lower.includes("alpaca") || lower.includes("wizard")) { diff --git a/extensions/vscode/config_schema.json b/extensions/vscode/config_schema.json index 3ac512c20..f93ccb3ba 100644 --- a/extensions/vscode/config_schema.json +++ b/extensions/vscode/config_schema.json @@ -427,6 +427,9 @@ "gpt-4-vision-preview", "codellama-70b", "mistral-8x7b", + "claude-3-opus-20240229", + "claude-3-sonnet-20240229", + "claude-3-haiku-20240307", "AUTODETECT" ] } @@ -514,6 +517,7 @@ "claude-instant-1", "claude-3-opus-20240229", "claude-3-sonnet-20240229", + "claude-3-haiku-20240307", "claude-2.1" ] }, @@ -862,6 +866,7 @@ "claude-instant-1", "claude-3-opus-20240229", "claude-3-sonnet-20240229", + "claude-3-haiku-20240307", "claude-2.1", "chat-bison-001", "gemini-pro", diff --git a/gui/src/util/modelData.ts b/gui/src/util/modelData.ts index adab0715a..304a11cb2 100644 --- a/gui/src/util/modelData.ts +++ b/gui/src/util/modelData.ts @@ -562,7 +562,7 @@ const claude3Opus: ModelPackage = { title: "Claude 3 Opus", apiKey: "", }, - providerOptions: ["anthropic"], + providerOptions: ["anthropic", "freetrial"], icon: "anthropic.png", }; @@ -576,7 +576,7 @@ const claude3Sonnet: ModelPackage = { title: "Claude 3 Sonnet", apiKey: "", }, - providerOptions: ["anthropic"], + providerOptions: ["anthropic", "freetrial"], icon: "anthropic.png", }; @@ -585,12 +585,12 @@ const claude3Haiku: ModelPackage = { description: "The third most capable model in the Claude 3 series: fastest and most compact model for near-instant responsiveness", params: { - model: "claude-2", + model: "claude-3-haiku-20240307", contextLength: 200_000, title: "Claude 3 Haiku", apiKey: "", }, - providerOptions: ["anthropic"], + providerOptions: ["anthropic", "freetrial"], icon: "anthropic.png", }; @@ -625,6 +625,7 @@ export const MODEL_INFO: ModelPackage[] = [ geminiPro, claude3Opus, claude3Sonnet, + claude3Haiku, claude2, deepseek, mistral, @@ -693,7 +694,7 @@ export const PROVIDER_INFO: { [key: string]: ModelInfo } = { defaultValue: 100_000, }, ], - packages: [claude3Opus, claude3Sonnet, claude2], + packages: [claude3Opus, claude3Sonnet, claude3Haiku, claude2], }, ollama: { title: "Ollama", @@ -929,6 +930,9 @@ After it's up and running, you can start using Continue.`, packages: [ codellama70bTrial, mixtralTrial, + { ...claude3Opus, title: "Claude 3 Opus (trial)" }, + { ...claude3Sonnet, title: "Claude 3 Sonnet (trial)" }, + { ...claude3Haiku, title: "Claude 3 Haiku (trial)" }, { ...geminiPro, title: "Gemini Pro (trial)" }, { ...gpt4vision, title: "GPT-4 Vision (trial)" }, { ...gpt35turbo, title: "GPT-3.5-Turbo (trial)" },