Elffuss BraidHub

kikocis/continue public

Merge pull request #5833 from continuedev/nate/vllm-no-fim

Nate/vllm-no-fim
Changesetcb66032ac113744fe9957c2662dd36d2f5198ab9bb00dcd0c13c71ffe668d897
AuthorNate Sesti <33237525+sestinj@users.noreply.github.com> · 2025-05-25 22:20 -07:00
CommitterGitHub <noreply@github.com> · 2025-05-25 22:20 -07:00
Parents0ac707eac642, 1db4eaf4c0a7

Browse the files at this changeset

5 files changed

modified core/llm/llms/Vllm.ts +4 −0
@@ -12,6 +12,10 @@
1212 }
1313 }
1414
15+ supportsFim(): boolean {
16+ return false;
17+ }
18+
1519 private _setupCompletionOptions() {
1620 this.fetch(this._getEndpoint("models"), {
1721 method: "GET",
modified core/llm/llms/stubs/ContinueProxy.ts +4 −0
@@ -89,6 +89,10 @@
8989 }
9090
9191 supportsFim(): boolean {
92+ const { provider } = parseProxyModelName(this.model);
93+ if (provider === "vllm") {
94+ return false;
95+ }
9296 return true;
9397 }
9498
added core/llm/llms/test/supportsFim.test.ts +55 −0
@@ -0,0 +1,55 @@
1+import { jest } from "@jest/globals";
2+import Anthropic from "../Anthropic.js";
3+import Deepseek from "../Deepseek.js";
4+import FunctionNetwork from "../FunctionNetwork.js";
5+import Mistral from "../Mistral.js";
6+import OpenAI from "../OpenAI.js";
7+import ContinueProxy from "../stubs/ContinueProxy.js";
8+import Vllm from "../Vllm.js";
9+
10+// Mock the parseProxyModelName function
11+const mockParseProxyModelName = jest.fn();
12+jest.mock("@continuedev/config-yaml", () => ({
13+ parseProxyModelName: mockParseProxyModelName,
14+ decodeSecretLocation: jest.fn(),
15+ SecretType: { NotFound: "not-found" },
16+}));
17+
18+// Test cases: [LLM class, model, expected supportsFim result, description]
19+const testCases: [any, string, boolean, string][] = [
20+ [ContinueProxy, "owner/package/vllm/some-model", false, "vllm provider"],
21+ [ContinueProxy, "owner/package/openai/gpt-4", true, "openai provider"],
22+ [
23+ ContinueProxy,
24+ "owner/package/anthropic/claude-3",
25+ true,
26+ "anthropic provider",
27+ ],
28+ [ContinueProxy, "owner/package/cohere/command-r", true, "cohere provider"],
29+ [
30+ ContinueProxy,
31+ "owner/package/unknown-provider/some-model",
32+ true,
33+ "unknown provider",
34+ ],
35+ [ContinueProxy, "owner/package/groq/llama-model", true, "groq provider"],
36+ [Vllm, "any-model", false, "Vllm"],
37+ [Anthropic, "claude-3-5-sonnet-latest", false, "Anthropic"],
38+ [FunctionNetwork, "any-model", false, "FunctionNetwork"],
39+ [OpenAI, "codestral", false, "OpenAI"],
40+ [Mistral, "codestral", true, "Mistral"],
41+ [Deepseek, "deepseek-chat", true, "Deepseek"],
42+];
43+
44+testCases.forEach(([LLMClass, model, expectedResult, description]) => {
45+ test(`supportsFim returns ${expectedResult} for ${description}`, () => {
46+ const llm = new LLMClass({
47+ model,
48+ apiKey: "test-key",
49+ });
50+
51+ const result = llm.supportsFim();
52+
53+ expect(result).toBe(expectedResult);
54+ });
55+});
modified core/llm/toolSupport.ts +4 −3
@@ -18,7 +18,7 @@
1818 "claude-3.5",
1919 "claude-3-7",
2020 "claude-3.7",
21- "claude-4",
21+ "claude-sonnet-4",
2222 "gpt-4",
2323 "o3",
2424 "gemini",
@@ -31,7 +31,7 @@
3131 "claude-3.5",
3232 "claude-3-7",
3333 "claude-3.7",
34- "claude-4",
34+ "claude-sonnet-4",
3535 ].some((part) => model.toLowerCase().startsWith(part))
3636 ) {
3737 return true;
@@ -91,7 +91,7 @@
9191 "claude-3.5",
9292 "claude-3-7",
9393 "claude-3.7",
94- "claude-4",
94+ "claude-sonnet-4",
9595 ].some((part) => model.toLowerCase().includes(part))
9696 ) {
9797 return true;
@@ -104,6 +104,7 @@
104104 return (
105105 !model.toLowerCase().includes("mamba") &&
106106 [
107+ "devstral",
107108 "codestral",
108109 "mistral-large",
109110 "mistral-small",
modified extensions/vscode/package.json +1 −1
@@ -2,7 +2,7 @@
22 "name": "continue",
33 "icon": "media/icon.png",
44 "author": "Continue Dev, Inc",
5- "version": "1.1.39",
5+ "version": "1.1.40",
66 "repository": {
77 "type": "git",
88 "url": "https://github.com/continuedev/continue"