Skip to content

Nate/vllm-no-fim #5833

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 6 commits into from
May 26, 2025
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
4 changes: 4 additions & 0 deletions core/llm/llms/Vllm.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@ class Vllm extends OpenAI {
}
}

supportsFim(): boolean {
return false;
}

private _setupCompletionOptions() {
this.fetch(this._getEndpoint("models"), {
method: "GET",
Expand Down
4 changes: 4 additions & 0 deletions core/llm/llms/stubs/ContinueProxy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,10 @@ class ContinueProxy extends OpenAI {
}

supportsFim(): boolean {
const { provider } = parseProxyModelName(this.model);
if (provider === "vllm") {
return false;
}
return true;
}

Expand Down
55 changes: 55 additions & 0 deletions core/llm/llms/test/supportsFim.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
import { jest } from "@jest/globals";
import Anthropic from "../Anthropic.js";
import Deepseek from "../Deepseek.js";
import FunctionNetwork from "../FunctionNetwork.js";
import Mistral from "../Mistral.js";
import OpenAI from "../OpenAI.js";
import ContinueProxy from "../stubs/ContinueProxy.js";
import Vllm from "../Vllm.js";

// Mock the parseProxyModelName function
const mockParseProxyModelName = jest.fn();
jest.mock("@continuedev/config-yaml", () => ({
parseProxyModelName: mockParseProxyModelName,
decodeSecretLocation: jest.fn(),
SecretType: { NotFound: "not-found" },
}));

// Test cases: [LLM class, model, expected supportsFim result, description]
const testCases: [any, string, boolean, string][] = [
[ContinueProxy, "owner/package/vllm/some-model", false, "vllm provider"],
[ContinueProxy, "owner/package/openai/gpt-4", true, "openai provider"],
[
ContinueProxy,
"owner/package/anthropic/claude-3",
true,
"anthropic provider",
],
[ContinueProxy, "owner/package/cohere/command-r", true, "cohere provider"],
[
ContinueProxy,
"owner/package/unknown-provider/some-model",
true,
"unknown provider",
],
[ContinueProxy, "owner/package/groq/llama-model", true, "groq provider"],
[Vllm, "any-model", false, "Vllm"],
[Anthropic, "claude-3-5-sonnet-latest", false, "Anthropic"],
[FunctionNetwork, "any-model", false, "FunctionNetwork"],
[OpenAI, "codestral", false, "OpenAI"],
[Mistral, "codestral", true, "Mistral"],
[Deepseek, "deepseek-chat", true, "Deepseek"],
];

testCases.forEach(([LLMClass, model, expectedResult, description]) => {
test(`supportsFim returns ${expectedResult} for ${description}`, () => {
const llm = new LLMClass({
model,
apiKey: "test-key",
});

const result = llm.supportsFim();

expect(result).toBe(expectedResult);
});
});
7 changes: 4 additions & 3 deletions core/llm/toolSupport.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ export const PROVIDER_TOOL_SUPPORT: Record<string, (model: string) => boolean> =
"claude-3.5",
"claude-3-7",
"claude-3.7",
"claude-4",
"claude-sonnet-4",
"gpt-4",
"o3",
"gemini",
Expand All @@ -31,7 +31,7 @@ export const PROVIDER_TOOL_SUPPORT: Record<string, (model: string) => boolean> =
"claude-3.5",
"claude-3-7",
"claude-3.7",
"claude-4",
"claude-sonnet-4",
].some((part) => model.toLowerCase().startsWith(part))
) {
return true;
Expand Down Expand Up @@ -91,7 +91,7 @@ export const PROVIDER_TOOL_SUPPORT: Record<string, (model: string) => boolean> =
"claude-3.5",
"claude-3-7",
"claude-3.7",
"claude-4",
"claude-sonnet-4",
].some((part) => model.toLowerCase().includes(part))
) {
return true;
Expand All @@ -104,6 +104,7 @@ export const PROVIDER_TOOL_SUPPORT: Record<string, (model: string) => boolean> =
return (
!model.toLowerCase().includes("mamba") &&
[
"devstral",
"codestral",
"mistral-large",
"mistral-small",
Expand Down
2 changes: 1 addition & 1 deletion extensions/vscode/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "continue",
"icon": "media/icon.png",
"author": "Continue Dev, Inc",
"version": "1.1.39",
"version": "1.1.40",
"repository": {
"type": "git",
"url": "https://github.com/continuedev/continue"
Expand Down
Loading