Skip to content

Commit 2726f3b

Browse files
authored
Merge pull request #5833 from continuedev/nate/vllm-no-fim
Nate/vllm-no-fim
2 parents 32986ea + 0c18c51 commit 2726f3b

File tree

5 files changed

+68
-4
lines changed

5 files changed

+68
-4
lines changed

core/llm/llms/Vllm.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,10 @@ class Vllm extends OpenAI {
1212
}
1313
}
1414

15+
supportsFim(): boolean {
16+
return false;
17+
}
18+
1519
private _setupCompletionOptions() {
1620
this.fetch(this._getEndpoint("models"), {
1721
method: "GET",

core/llm/llms/stubs/ContinueProxy.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,10 @@ class ContinueProxy extends OpenAI {
8989
}
9090

9191
supportsFim(): boolean {
92+
const { provider } = parseProxyModelName(this.model);
93+
if (provider === "vllm") {
94+
return false;
95+
}
9296
return true;
9397
}
9498

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -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+
});

core/llm/toolSupport.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ export const PROVIDER_TOOL_SUPPORT: Record<string, (model: string) => boolean> =
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 @@ export const PROVIDER_TOOL_SUPPORT: Record<string, (model: string) => boolean> =
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 @@ export const PROVIDER_TOOL_SUPPORT: Record<string, (model: string) => boolean> =
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 @@ export const PROVIDER_TOOL_SUPPORT: Record<string, (model: string) => boolean> =
104104
return (
105105
!model.toLowerCase().includes("mamba") &&
106106
[
107+
"devstral",
107108
"codestral",
108109
"mistral-large",
109110
"mistral-small",

extensions/vscode/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -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"

0 commit comments

Comments
 (0)