From 64541630784bf46d0faf994b645780de8eacb286 Mon Sep 17 00:00:00 2001 From: Saoud Rizwan <7799382+saoudrizwan@users.noreply.github.com> Date: Sun, 11 Aug 2024 03:24:10 -0400 Subject: [PATCH] Remove unusable models; minor fixes --- src/ClaudeDev.ts | 4 +- src/shared/api.ts | 89 +++++++++++------------- webview-ui/src/components/ApiOptions.tsx | 16 ++--- webview-ui/src/components/ChatView.tsx | 2 +- 4 files changed, 52 insertions(+), 59 deletions(-) diff --git a/src/ClaudeDev.ts b/src/ClaudeDev.ts index 09f4cce..1a72bfa 100644 --- a/src/ClaudeDev.ts +++ b/src/ClaudeDev.ts @@ -353,7 +353,7 @@ export class ClaudeDev { let totalInputTokens = 0 let totalOutputTokens = 0 - while (this.requestCount < this.maxRequestsPerTask) { + while (!this.abort) { const { didEndLoop, inputTokens, outputTokens } = await this.recursivelyMakeClaudeRequests([ textBlock, ...imageBlocks, @@ -366,7 +366,7 @@ export class ClaudeDev { //const totalCost = this.calculateApiCost(totalInputTokens, totalOutputTokens) if (didEndLoop) { - // for now this never happens + // For now a task never 'completes'. This will only happen if the user hits max requests and denies resetting the count. //this.say("task_completed", `Task completed. Total API usage cost: ${totalCost}`) break } else { diff --git a/src/shared/api.ts b/src/shared/api.ts index abf5420..40fb728 100644 --- a/src/shared/api.ts +++ b/src/shared/api.ts @@ -133,24 +133,25 @@ export const openRouterModels = { inputPrice: 10, outputPrice: 30, }, - "meta-llama/llama-3.1-405b-instruct": { - maxTokens: 2048, - supportsImages: false, - inputPrice: 2.7, - outputPrice: 2.7, - }, - "meta-llama/llama-3.1-70b-instruct": { - maxTokens: 2048, - supportsImages: false, - inputPrice: 0.52, - outputPrice: 0.75, - }, - "meta-llama/llama-3.1-8b-instruct": { - maxTokens: 2048, - supportsImages: false, - inputPrice: 0.06, - outputPrice: 0.06, - }, + // llama 3.1 models cannot use tools yet + // "meta-llama/llama-3.1-405b-instruct": { + // maxTokens: 2048, + // supportsImages: false, + // inputPrice: 2.7, + // outputPrice: 2.7, + // }, + // "meta-llama/llama-3.1-70b-instruct": { + // maxTokens: 2048, + // supportsImages: false, + // inputPrice: 0.52, + // outputPrice: 0.75, + // }, + // "meta-llama/llama-3.1-8b-instruct": { + // maxTokens: 2048, + // supportsImages: false, + // inputPrice: 0.06, + // outputPrice: 0.06, + // }, "google/gemini-pro-1.5": { maxTokens: 8192, supportsImages: true, @@ -163,46 +164,38 @@ export const openRouterModels = { inputPrice: 0.25, outputPrice: 0.75, }, + // while deepseek coder can use tools, it may sometimes send tool invocation as a text block "deepseek/deepseek-coder": { maxTokens: 4096, supportsImages: false, inputPrice: 0.14, outputPrice: 0.28, }, + // mistral models can use tools but aren't great at going step-by-step and proceeding to the next step "mistralai/mistral-large": { maxTokens: 8192, supportsImages: false, inputPrice: 3, outputPrice: 9, }, - "mistralai/mistral-medium": { - maxTokens: 4096, - supportsImages: false, - inputPrice: 2.7, - outputPrice: 8.1, - }, - "mistralai/mistral-small": { - maxTokens: 4096, - supportsImages: false, - inputPrice: 2, - outputPrice: 6, - }, - "mistralai/mistral-7b-instruct-v0.1": { - maxTokens: 4096, - supportsImages: false, - inputPrice: 0.06, - outputPrice: 0.06, - }, - "cohere/command-r-plus": { - maxTokens: 4000, - supportsImages: false, - inputPrice: 3, - outputPrice: 15, - }, - "cohere/command-r": { - maxTokens: 4000, - supportsImages: false, - inputPrice: 0.5, - outputPrice: 1.5, - }, + // This model is not capable of complex system/tool prompts + // "mistralai/mistral-7b-instruct-v0.1": { + // maxTokens: 4096, + // supportsImages: false, + // inputPrice: 0.06, + // outputPrice: 0.06, + // }, + // cohere models are not capable of complex system/tool prompts + // "cohere/command-r-plus": { + // maxTokens: 4000, + // supportsImages: false, + // inputPrice: 3, + // outputPrice: 15, + // }, + // "cohere/command-r": { + // maxTokens: 4000, + // supportsImages: false, + // inputPrice: 0.5, + // outputPrice: 1.5, + // }, } as const satisfies Record diff --git a/webview-ui/src/components/ApiOptions.tsx b/webview-ui/src/components/ApiOptions.tsx index 37aa6e0..43e30aa 100644 --- a/webview-ui/src/components/ApiOptions.tsx +++ b/webview-ui/src/components/ApiOptions.tsx @@ -146,15 +146,15 @@ const ApiOptions: React.FC = ({ showModelOptions, apiConfigurat Select a region... {/* The user will have to choose a region that supports the model they use, but this shouldn't be a problem since they'd have to request access for it in that region in the first place. */} US East (N. Virginia) - US East (Ohio) - US West (N. California) + {/* US East (Ohio) */} + {/* US West (N. California) */} US West (Oregon) - Africa (Cape Town) - Asia Pacific (Hong Kong) + {/* Africa (Cape Town) */} + {/* Asia Pacific (Hong Kong) */} Asia Pacific (Mumbai) Asia Pacific (Tokyo) - Asia Pacific (Seoul) - Asia Pacific (Osaka) + {/* Asia Pacific (Seoul) */} + {/* Asia Pacific (Osaka) */} Asia Pacific (Singapore) Asia Pacific (Sydney) Canada (Central) @@ -162,8 +162,8 @@ const ApiOptions: React.FC = ({ showModelOptions, apiConfigurat Europe (Ireland) Europe (London) Europe (Paris) - Europe (Stockholm) - Middle East (Bahrain) + {/* Europe (Stockholm) */} + {/* Middle East (Bahrain) */} South America (São Paulo) diff --git a/webview-ui/src/components/ChatView.tsx b/webview-ui/src/components/ChatView.tsx index 3346b30..3dc1eb4 100644 --- a/webview-ui/src/components/ChatView.tsx +++ b/webview-ui/src/components/ChatView.tsx @@ -610,7 +610,7 @@ const ChatView = ({ style={{ marginRight: "4px" }}> + style={{ fontSize: 18.5, marginLeft: -2, marginBottom: 1.5 }}>