Elffuss BraidHub

kikocis/continue public

Merge pull request #5759 from continuedev/nate/dev-data-updates

Fix dev data paper cuts
Changeset419651c68e24068f9f1f500d6e5138bf3d69f8b3e88e3c7353aab2017b14a4dc
AuthorNate Sesti <33237525+sestinj@users.noreply.github.com> · 2025-05-25 21:45 -07:00
CommitterGitHub <noreply@github.com> · 2025-05-25 21:45 -07:00
Parentsb0349aaa027a, 75b17df40f78

Browse the files at this changeset

16 files changed

modified binary/test/binary.test.ts +2 −0
@@ -226,6 +226,7 @@
226226 title: "Test Model",
227227 provider: "openai",
228228 model: "gpt-3.5-turbo",
229+ underlyingProviderName: "openai",
229230 };
230231 await messenger.request("config/addModel", {
231232 model,
@@ -252,6 +253,7 @@
252253 title: "Test Model",
253254 provider: "mock",
254255 model: "gpt-3.5-turbo",
256+ underlyingProviderName: "mock",
255257 };
256258 await messenger.request("config/addModel", {
257259 model,
modified core/autocomplete/CompletionProvider.ts +1 −1
@@ -244,7 +244,7 @@
244244 prefix,
245245 suffix,
246246 prompt,
247- modelProvider: llm.providerName,
247+ modelProvider: llm.underlyingProviderName,
248248 modelName: llm.model,
249249 completionOptions,
250250 cacheHit,
modified core/config/load.ts +1 −0
@@ -627,6 +627,7 @@
627627 function llmToSerializedModelDescription(llm: ILLM): ModelDescription {
628628 return {
629629 provider: llm.providerName,
630+ underlyingProviderName: llm.underlyingProviderName,
630631 model: llm.model,
631632 title: llm.title ?? llm.model,
632633 apiKey: llm.apiKey,
modified core/index.d.ts +3 −0
@@ -93,6 +93,7 @@
9393 extends Omit<LLMOptions, RequiredLLMOptions>,
9494 Required<Pick<LLMOptions, RequiredLLMOptions>> {
9595 get providerName(): string;
96+ get underlyingProviderName(): string;
9697
9798 complete(
9899 prompt: string,
@@ -1035,6 +1036,7 @@
10351036 export interface ModelDescription {
10361037 title: string;
10371038 provider: string;
1039+ underlyingProviderName: string;
10381040 model: string;
10391041 apiKey?: string;
10401042
@@ -1333,6 +1335,7 @@
13331335 export interface JSONModelDescription {
13341336 title: string;
13351337 provider: string;
1338+ underlyingProviderName: string;
13361339 model: string;
13371340 apiKey?: string;
13381341 apiBase?: string;
modified core/llm/index.ts +9 −1
@@ -88,6 +88,14 @@
8888 return (this.constructor as typeof BaseLLM).providerName;
8989 }
9090
91+ /**
92+ * This exists because for the continue-proxy, sometimes we want to get the value of the underlying provider that is used on the server
93+ * For example, the underlying provider should always be sent with dev data
94+ */
95+ get underlyingProviderName(): string {
96+ return this.providerName;
97+ }
98+
9199 supportsFim(): boolean {
92100 return false;
93101 }
@@ -332,7 +340,7 @@
332340 name: "tokensGenerated",
333341 data: {
334342 model: model,
335- provider: this.providerName,
343+ provider: this.underlyingProviderName,
336344 promptTokens: promptTokens,
337345 generatedTokens: generatedTokens,
338346 },
modified core/llm/llms/stubs/ContinueProxy.ts +6 −0
@@ -1,6 +1,7 @@
11 import {
22 ContinueProperties,
33 decodeSecretLocation,
4+ parseProxyModelName,
45 SecretType,
56 } from "@continuedev/config-yaml";
67
@@ -47,6 +48,11 @@
4748 useLegacyCompletionsEndpoint: false,
4849 };
4950
51+ get underlyingProviderName(): string {
52+ const { provider } = parseProxyModelName(this.model);
53+ return provider;
54+ }
55+
5056 protected extraBodyProperties(): Record<string, any> {
5157 const continueProperties: ContinueProperties = {
5258 apiKeyLocation: this.apiKeyLocation,
modified core/llm/toolSupport.test.ts +76 −40
@@ -6,39 +6,57 @@
66 const supportsFn = PROVIDER_TOOL_SUPPORT["continue-proxy"];
77
88 it("should return true for Claude 3.5 models", () => {
9- expect(supportsFn("claude-3-5-sonnet")).toBe(true);
10- expect(supportsFn("claude-3.5-sonnet")).toBe(true);
9+ expect(
10+ supportsFn("ownerSlug/packageSlug/anthropic/claude-3-5-sonnet"),
11+ ).toBe(true);
12+ expect(
13+ supportsFn("ownerSlug/packageSlug/anthropic/claude-3.5-sonnet"),
14+ ).toBe(true);
1115 });
1216
1317 it("should return true for Claude 3.7 models", () => {
14- expect(supportsFn("claude-3-7-haiku")).toBe(true);
15- expect(supportsFn("claude-3.7-sonnet")).toBe(true);
18+ expect(
19+ supportsFn("ownerSlug/packageSlug/anthropic/claude-3-7-haiku"),
20+ ).toBe(true);
21+ expect(
22+ supportsFn("ownerSlug/packageSlug/anthropic/claude-3.7-sonnet"),
23+ ).toBe(true);
1624 });
1725
1826 it("should return true for GPT-4 models", () => {
19- expect(supportsFn("gpt-4-turbo")).toBe(true);
20- expect(supportsFn("gpt-4-1106-preview")).toBe(true);
27+ expect(supportsFn("ownerSlug/packageSlug/openai/gpt-4-turbo")).toBe(true);
28+ expect(
29+ supportsFn("ownerSlug/packageSlug/openai/gpt-4-1106-preview"),
30+ ).toBe(true);
2131 });
2232
2333 it("should return true for O3 models", () => {
24- expect(supportsFn("o3-preview")).toBe(true);
34+ expect(supportsFn("ownerSlug/packageSlug/openai/o3-preview")).toBe(true);
2535 });
2636
2737 it("should return true for Gemini models", () => {
28- expect(supportsFn("gemini-pro")).toBe(true);
29- expect(supportsFn("gemini-1.5-pro")).toBe(true);
38+ expect(supportsFn("ownerSlug/packageSlug/gemini/gemini-pro")).toBe(true);
39+ expect(supportsFn("ownerSlug/packageSlug/gemini/gemini-1.5-pro")).toBe(
40+ true,
41+ );
3042 });
3143
3244 it("should return false for unsupported models", () => {
33- expect(supportsFn("gpt-3.5-turbo")).toBe(false);
34- expect(supportsFn("claude-2")).toBe(false);
35- expect(supportsFn("llama-3")).toBe(false);
45+ expect(supportsFn("ownerSlug/packageSlug/openai/gpt-3.5-turbo")).toBe(
46+ false,
47+ );
48+ expect(supportsFn("ownerSlug/packageSlug/anthropic/claude-2")).toBe(
49+ false,
50+ );
51+ expect(supportsFn("ownerSlug/packageSlug/together/llama-3")).toBe(false);
3652 });
3753
3854 it("should handle case insensitivity", () => {
39- expect(supportsFn("CLAUDE-3-5-sonnet")).toBe(true);
40- expect(supportsFn("GPT-4-turbo")).toBe(true);
41- expect(supportsFn("GEMINI-pro")).toBe(true);
55+ expect(
56+ supportsFn("ownerSlug/packageSlug/anthropic/CLAUDE-3-5-sonnet"),
57+ ).toBe(true);
58+ expect(supportsFn("ownerSlug/packageSlug/openai/GPT-4-turbo")).toBe(true);
59+ expect(supportsFn("ownerSlug/packageSlug/gemini/GEMINI-pro")).toBe(true);
4260 });
4361 });
4462
@@ -56,8 +74,8 @@
5674 });
5775
5876 it("should return undefined for unsupported models", () => {
59- expect(supportsFn("claude-2")).toBeUndefined();
60- expect(supportsFn("claude-instant")).toBeUndefined();
77+ expect(supportsFn("claude-2")).toBe(false);
78+ expect(supportsFn("claude-instant")).toBe(false);
6179 });
6280
6381 it("should handle case insensitivity", () => {
@@ -81,8 +99,8 @@
8199 });
82100
83101 it("should return undefined for unsupported models", () => {
84- expect(supportsFn("gpt-3.5-turbo")).toBeUndefined();
85- expect(supportsFn("davinci")).toBeUndefined();
102+ expect(supportsFn("gpt-3.5-turbo")).toBe(false);
103+ expect(supportsFn("davinci")).toBe(false);
86104 });
87105
88106 it("should handle case insensitivity", () => {
@@ -115,31 +133,49 @@
115133 const supportsFn = PROVIDER_TOOL_SUPPORT["bedrock"];
116134
117135 it("should return true for Claude 3.5 Sonnet models", () => {
118- expect(supportsFn("anthropic.claude-3-5-sonnet-20240620-v1:0")).toBe(true);
119- expect(supportsFn("anthropic.claude-3.5-sonnet-20240620-v1:0")).toBe(true);
136+ expect(supportsFn("anthropic.claude-3-5-sonnet-20240620-v1:0")).toBe(
137+ true,
138+ );
139+ expect(supportsFn("anthropic.claude-3.5-sonnet-20240620-v1:0")).toBe(
140+ true,
141+ );
120142 });
121143
122144 it("should return true for Claude 3.7 Sonnet models", () => {
123- expect(supportsFn("anthropic.claude-3-7-sonnet-20240620-v1:0")).toBe(true);
124- expect(supportsFn("anthropic.claude-3.7-sonnet-20240620-v1:0")).toBe(true);
145+ expect(supportsFn("anthropic.claude-3-7-sonnet-20240620-v1:0")).toBe(
146+ true,
147+ );
148+ expect(supportsFn("anthropic.claude-3.7-sonnet-20240620-v1:0")).toBe(
149+ true,
150+ );
125151 });
126152
127153 it("should return undefined for Claude Haiku and Opus models", () => {
128- expect(supportsFn("anthropic.claude-3-5-haiku-20240307-v1:0")).toBeUndefined();
129- expect(supportsFn("anthropic.claude-3.5-haiku-20240620-v1:0")).toBeUndefined();
130- expect(supportsFn("anthropic.claude-3-7-haiku-20240620-v1:0")).toBeUndefined();
131- expect(supportsFn("anthropic.claude-3-5-opus-20240620-v1:0")).toBeUndefined();
132- expect(supportsFn("anthropic.claude-3.7-opus-20240620-v1:0")).toBeUndefined();
154+ expect(supportsFn("anthropic.claude-3-5-haiku-20240307-v1:0")).toBe(
155+ false,
156+ );
157+ expect(supportsFn("anthropic.claude-3.5-haiku-20240620-v1:0")).toBe(
158+ false,
159+ );
160+ expect(supportsFn("anthropic.claude-3-7-haiku-20240620-v1:0")).toBe(
161+ false,
162+ );
163+ expect(supportsFn("anthropic.claude-3-5-opus-20240620-v1:0")).toBe(false);
164+ expect(supportsFn("anthropic.claude-3.7-opus-20240620-v1:0")).toBe(false);
133165 });
134166
135167 it("should return undefined for other unsupported models", () => {
136- expect(supportsFn("anthropic.claude-instant-v1")).toBeUndefined();
137- expect(supportsFn("anthropic.titan-text-express-v1")).toBeUndefined();
168+ expect(supportsFn("anthropic.claude-instant-v1")).toBe(false);
169+ expect(supportsFn("anthropic.titan-text-express-v1")).toBe(false);
138170 });
139171
140172 it("should handle case insensitivity", () => {
141- expect(supportsFn("ANTHROPIC.CLAUDE-3-5-SONNET-20240620-v1:0")).toBe(true);
142- expect(supportsFn("ANTHROPIC.CLAUDE-3.7-SONNET-20240620-v1:0")).toBe(true);
173+ expect(supportsFn("ANTHROPIC.CLAUDE-3-5-SONNET-20240620-v1:0")).toBe(
174+ true,
175+ );
176+ expect(supportsFn("ANTHROPIC.CLAUDE-3.7-SONNET-20240620-v1:0")).toBe(
177+ true,
178+ );
143179 });
144180 });
145181
@@ -206,9 +242,9 @@
206242 });
207243
208244 it("should return undefined for other models", () => {
209- expect(supportsFn("llama2")).toBeUndefined();
210- expect(supportsFn("phi-2")).toBeUndefined();
211- expect(supportsFn("falcon")).toBeUndefined();
245+ expect(supportsFn("llama2")).toBe(false);
246+ expect(supportsFn("phi-2")).toBe(false);
247+ expect(supportsFn("falcon")).toBe(false);
212248 });
213249
214250 it("should handle case insensitivity", () => {
@@ -221,16 +257,16 @@
221257 describe("edge cases", () => {
222258 it("should handle empty model names", () => {
223259 expect(PROVIDER_TOOL_SUPPORT["continue-proxy"]("")).toBe(false);
224- expect(PROVIDER_TOOL_SUPPORT["anthropic"]("")).toBeUndefined();
225- expect(PROVIDER_TOOL_SUPPORT["openai"]("")).toBeUndefined();
260+ expect(PROVIDER_TOOL_SUPPORT["anthropic"]("")).toBe(false);
261+ expect(PROVIDER_TOOL_SUPPORT["openai"]("")).toBe(false);
226262 expect(PROVIDER_TOOL_SUPPORT["gemini"]("")).toBe(false);
227- expect(PROVIDER_TOOL_SUPPORT["bedrock"]("")).toBeUndefined();
228- expect(PROVIDER_TOOL_SUPPORT["ollama"]("")).toBeUndefined();
263+ expect(PROVIDER_TOOL_SUPPORT["bedrock"]("")).toBe(false);
264+ expect(PROVIDER_TOOL_SUPPORT["ollama"]("")).toBe(false);
229265 });
230266
231267 it("should handle non-existent provider", () => {
232268 // @ts-ignore - Testing runtime behavior with invalid provider
233- expect(PROVIDER_TOOL_SUPPORT["non-existent"]).toBeUndefined();
269+ expect(PROVIDER_TOOL_SUPPORT["non-existent"]).toBe(undefined);
234270 });
235271 });
236272 });
modified core/llm/toolSupport.ts +258 −223
@@ -1,238 +1,273 @@
1-export const PROVIDER_TOOL_SUPPORT: Record<
2- string,
3- (model: string) => boolean | undefined
4-> = {
5- "continue-proxy": (model) => {
6- // see getContinueProxyModelName
7- const provider = model.split("/")[2];
8- const _model = model.split("/")[3];
9- if (provider && _model && provider !== "continue-proxy") {
10- const fn = PROVIDER_TOOL_SUPPORT[provider];
11- if (fn) {
12- return fn(_model);
1+import { parseProxyModelName } from "@continuedev/config-yaml";
2+
3+export const PROVIDER_TOOL_SUPPORT: Record<string, (model: string) => boolean> =
4+ {
5+ "continue-proxy": (model) => {
6+ try {
7+ const { provider, model: _model } = parseProxyModelName(model);
8+ if (provider && _model && provider !== "continue-proxy") {
9+ const fn = PROVIDER_TOOL_SUPPORT[provider];
10+ if (fn) {
11+ return fn(_model);
12+ }
13+ }
14+ } catch (e) {}
15+
16+ return [
17+ "claude-3-5",
18+ "claude-3.5",
19+ "claude-3-7",
20+ "claude-3.7",
21+ "claude-4",
22+ "gpt-4",
23+ "o3",
24+ "gemini",
25+ ].some((part) => model.toLowerCase().startsWith(part));
26+ },
27+ anthropic: (model) => {
28+ if (
29+ [
30+ "claude-3-5",
31+ "claude-3.5",
32+ "claude-3-7",
33+ "claude-3.7",
34+ "claude-4",
35+ ].some((part) => model.toLowerCase().startsWith(part))
36+ ) {
37+ return true;
1338 }
14- }
15- return [
16- "claude-3-5",
17- "claude-3.5",
18- "claude-3-7",
19- "claude-3.7",
20- "claude-sonnet-4",
21- "gpt-4",
22- "o3",
23- "gemini",
24- ].some((part) => model.toLowerCase().startsWith(part));
25- },
26- anthropic: (model) => {
27- if (
28- ["claude-3-5", "claude-3.5", "claude-3-7", "claude-3.7","claude-sonnet-4"].some((part) =>
29- model.toLowerCase().startsWith(part),
39+
40+ return false;
41+ },
42+ azure: (model) => {
43+ if (
44+ model.toLowerCase().startsWith("gpt-4") ||
45+ model.toLowerCase().startsWith("o3")
3046 )
31- ) {
32- return true;
33- }
34- },
35- azure: (model) => {
36- if (
37- model.toLowerCase().startsWith("gpt-4") ||
38- model.toLowerCase().startsWith("o3")
39- )
40- return true;
41- return false;
42- },
43- openai: (model) => {
44- // https://platform.openai.com/docs/guides/function-calling#models-supporting-function-calling
45- if (
46- model.toLowerCase().startsWith("gpt-4") ||
47- model.toLowerCase().startsWith("o3")
48- ) {
49- return true;
50- }
51- // firworks-ai https://docs.fireworks.ai/guides/function-calling
52- if (model.startsWith("accounts/fireworks/models/")) {
53- switch (model.substring(26)) {
54- case "llama-v3p1-405b-instruct":
55- case "llama-v3p1-70b-instruct":
56- case "qwen2p5-72b-instruct":
57- case "firefunction-v1":
58- case "firefunction-v2":
59- return true;
60- default:
61- return false;
47+ return true;
48+ return false;
49+ },
50+ openai: (model) => {
51+ // https://platform.openai.com/docs/guides/function-calling#models-supporting-function-calling
52+ if (
53+ model.toLowerCase().startsWith("gpt-4") ||
54+ model.toLowerCase().startsWith("o3")
55+ ) {
56+ return true;
57+ }
58+ // firworks-ai https://docs.fireworks.ai/guides/function-calling
59+ if (model.startsWith("accounts/fireworks/models/")) {
60+ switch (model.substring(26)) {
61+ case "llama-v3p1-405b-instruct":
62+ case "llama-v3p1-70b-instruct":
63+ case "qwen2p5-72b-instruct":
64+ case "firefunction-v1":
65+ case "firefunction-v2":
66+ return true;
67+ default:
68+ return false;
69+ }
6270 }
63- }
64- },
65- gemini: (model) => {
66- // All gemini models support function calling
67- return model.toLowerCase().includes("gemini");
68- },
69- vertexai: (model) => {
70- // All gemini models except flash 2.0 lite support function calling
71- return (
72- model.toLowerCase().includes("gemini") &&
73- !model.toLowerCase().includes("lite")
74- );
75- },
76- bedrock: (model) => {
77- // For Bedrock, only support Claude Sonnet models with versions 3.5/3-5 and 3.7/3-7
78- if (
79- model.toLowerCase().includes("sonnet") &&
80- ["claude-3-5", "claude-3.5", "claude-3-7", "claude-3.7","claude-sonnet-4"].some((part) =>
81- model.toLowerCase().includes(part),
82- )
83- ) {
84- return true;
85- }
86- },
87- mistral: (model) => {
88- // https://docs.mistral.ai/capabilities/function_calling/
89- return (
90- !model.toLowerCase().includes("mamba") &&
91- [
92- "devstral",
93- "codestral",
94- "mistral-large",
95- "mistral-small",
96- "pixtral",
97- "ministral",
98- "mistral-nemo",
99- ].some((part) => model.toLowerCase().includes(part))
100- );
101- },
102- // https://ollama.com/search?c=tools
103- ollama: (model) => {
104- let modelName = "";
105- // Extract the model name after the last slash to support other registries
106- if (model.includes("/")) {
107- let parts = model.split("/");
108- modelName = parts[parts.length - 1];
109- } else {
110- modelName = model;
111- }
11271
113- if (
114- ["vision", "math", "guard", "mistrallite", "mistral-openorca"].some(
115- (part) => modelName.toLowerCase().includes(part),
116- )
117- ) {
11872 return false;
119- }
120- if (
121- [
122- "cogito",
123- "llama3.3",
124- "qwq",
125- "llama3.2",
126- "llama3.1",
127- "qwen2",
128- "qwen3",
129- "mixtral",
130- "command-r",
131- "smollm2",
132- "hermes3",
133- "athene-v2",
134- "nemotron",
135- "llama3-groq",
136- "granite3",
137- "granite-3",
138- "aya-expanse",
139- "firefunction-v2",
140- "mistral",
141- "devstral",
142- ].some((part) => modelName.toLowerCase().includes(part))
143- ) {
144- return true;
145- }
146- },
147- sambanova: (model) => {
148- // https://docs.sambanova.ai/cloud/docs/capabilities/function-calling
149- if (
150- model.toLowerCase().startsWith("meta-llama-3") ||
151- model.toLowerCase().includes("llama-4") ||
152- model.toLowerCase().includes("deepseek")
153- ) {
154- return true;
155- }
156- },
157- deepseek: (model) => {
158- if (model !== "deepseek-reasoner") {
159- return true;
160- }
161- },
162- watsonx: (model) => {
163- if (model.toLowerCase().includes("guard")) return false;
164- if (
165- ["llama-3", "llama-4", "mistral", "codestral", "granite-3"].some((part) =>
166- model.toLowerCase().includes(part),
167- )
168- )
169- return true;
170- },
171- openrouter: (model) => {
172- // https://openrouter.ai/models?fmt=cards&supported_parameters=tools
173- if (
174- ["vision", "math", "guard", "mistrallite", "mistral-openorca"].some(
175- (part) => model.toLowerCase().includes(part),
176- )
177- ) {
73+ },
74+ gemini: (model) => {
75+ // All gemini models support function calling
76+ return model.toLowerCase().includes("gemini");
77+ },
78+ vertexai: (model) => {
79+ // All gemini models except flash 2.0 lite support function calling
80+ return (
81+ model.toLowerCase().includes("gemini") &&
82+ !model.toLowerCase().includes("lite")
83+ );
84+ },
85+ bedrock: (model) => {
86+ // For Bedrock, only support Claude Sonnet models with versions 3.5/3-5 and 3.7/3-7
87+ if (
88+ model.toLowerCase().includes("sonnet") &&
89+ [
90+ "claude-3-5",
91+ "claude-3.5",
92+ "claude-3-7",
93+ "claude-3.7",
94+ "claude-4",
95+ ].some((part) => model.toLowerCase().includes(part))
96+ ) {
97+ return true;
98+ }
99+
178100 return false;
179- }
101+ },
102+ mistral: (model) => {
103+ // https://docs.mistral.ai/capabilities/function_calling/
104+ return (
105+ !model.toLowerCase().includes("mamba") &&
106+ [
107+ "codestral",
108+ "mistral-large",
109+ "mistral-small",
110+ "pixtral",
111+ "ministral",
112+ "mistral-nemo",
113+ "devstral",
114+ ].some((part) => model.toLowerCase().includes(part))
115+ );
116+ },
117+ // https://ollama.com/search?c=tools
118+ ollama: (model) => {
119+ let modelName = "";
120+ // Extract the model name after the last slash to support other registries
121+ if (model.includes("/")) {
122+ let parts = model.split("/");
123+ modelName = parts[parts.length - 1];
124+ } else {
125+ modelName = model;
126+ }
127+
128+ if (
129+ ["vision", "math", "guard", "mistrallite", "mistral-openorca"].some(
130+ (part) => modelName.toLowerCase().includes(part),
131+ )
132+ ) {
133+ return false;
134+ }
135+ if (
136+ [
137+ "cogito",
138+ "llama3.3",
139+ "qwq",
140+ "llama3.2",
141+ "llama3.1",
142+ "qwen2",
143+ "qwen3",
144+ "mixtral",
145+ "command-r",
146+ "smollm2",
147+ "hermes3",
148+ "athene-v2",
149+ "nemotron",
150+ "llama3-groq",
151+ "granite3",
152+ "granite-3",
153+ "aya-expanse",
154+ "firefunction-v2",
155+ "mistral",
156+ "devstral",
157+ ].some((part) => modelName.toLowerCase().includes(part))
158+ ) {
159+ return true;
160+ }
180161
181- const supportedPrefixes = [
182- "openai/gpt-3.5",
183- "openai/gpt-4",
184- "openai/o1",
185- "openai/o3",
186- "openai/o4",
187- "anthropic/claude-3",
188- "microsoft/phi-3",
189- "google/gemini-flash-1.5",
190- "google/gemini-2",
191- "google/gemini-pro",
192- "x-ai/grok",
193- "qwen/qwen3",
194- "qwen/qwen-",
195- "cohere/command-r",
196- "ai21/jamba-1.6",
197- "mistralai/mistral",
198- "mistralai/ministral",
199- "mistralai/codestral",
200- "mistralai/mixtral",
201- "mistral/ministral",
202- "mistralai/pixtral",
203- "meta-llama/llama-3.3",
204- "amazon/nova",
205- "deepseek/deepseek-r1",
206- "deepseek/deepseek-chat",
207- "meta-llama/llama-4",
208- "all-hands/openhands-lm-32b",
209- ];
210- for (const prefix of supportedPrefixes) {
211- if (model.toLowerCase().startsWith(prefix)) {
162+ return false;
163+ },
164+ sambanova: (model) => {
165+ // https://docs.sambanova.ai/cloud/docs/capabilities/function-calling
166+ if (
167+ model.toLowerCase().startsWith("meta-llama-3") ||
168+ model.toLowerCase().includes("llama-4") ||
169+ model.toLowerCase().includes("deepseek")
170+ ) {
212171 return true;
213172 }
214- }
215173
216- const specificModels = [
217- "qwen/qwq-32b",
218- "qwen/qwen-2.5-72b-instruct",
219- "meta-llama/llama-3.2-3b-instruct",
220- "meta-llama/llama-3-8b-instruct",
221- "meta-llama/llama-3-70b-instruct",
222- "arcee-ai/caller-large",
223- "nousresearch/hermes-3-llama-3.1-70b",
224- ];
225- for (const model of specificModels) {
226- if (model.toLowerCase() === model) {
174+ return false;
175+ },
176+ deepseek: (model) => {
177+ if (model !== "deepseek-reasoner") {
227178 return true;
228179 }
229- }
230180
231- const supportedContains = ["llama-3.1"];
232- for (const model of supportedContains) {
233- if (model.toLowerCase().includes(model)) {
181+ return false;
182+ },
183+ watsonx: (model) => {
184+ if (model.toLowerCase().includes("guard")) {
185+ return false;
186+ }
187+ if (
188+ [
189+ "llama-3",
190+ "llama-4",
191+ "mistral",
192+ "codestral",
193+ "granite-3",
194+ "devstral",
195+ ].some((part) => model.toLowerCase().includes(part))
196+ ) {
234197 return true;
235198 }
236- }
237- },
238-};
199+
200+ return false;
201+ },
202+ openrouter: (model) => {
203+ // https://openrouter.ai/models?fmt=cards&supported_parameters=tools
204+ if (
205+ ["vision", "math", "guard", "mistrallite", "mistral-openorca"].some(
206+ (part) => model.toLowerCase().includes(part),
207+ )
208+ ) {
209+ return false;
210+ }
211+
212+ const supportedPrefixes = [
213+ "openai/gpt-3.5",
214+ "openai/gpt-4",
215+ "openai/o1",
216+ "openai/o3",
217+ "openai/o4",
218+ "anthropic/claude-3",
219+ "anthropic/claude-4",
220+ "microsoft/phi-3",
221+ "google/gemini-flash-1.5",
222+ "google/gemini-2",
223+ "google/gemini-pro",
224+ "x-ai/grok",
225+ "qwen/qwen3",
226+ "qwen/qwen-",
227+ "cohere/command-r",
228+ "ai21/jamba-1.6",
229+ "mistralai/mistral",
230+ "mistralai/ministral",
231+ "mistralai/codestral",
232+ "mistralai/mixtral",
233+ "mistral/ministral",
234+ "mistral/devstral",
235+ "mistralai/pixtral",
236+ "meta-llama/llama-3.3",
237+ "amazon/nova",
238+ "deepseek/deepseek-r1",
239+ "deepseek/deepseek-chat",
240+ "meta-llama/llama-4",
241+ "all-hands/openhands-lm-32b",
242+ ];
243+ for (const prefix of supportedPrefixes) {
244+ if (model.toLowerCase().startsWith(prefix)) {
245+ return true;
246+ }
247+ }
248+
249+ const specificModels = [
250+ "qwen/qwq-32b",
251+ "qwen/qwen-2.5-72b-instruct",
252+ "meta-llama/llama-3.2-3b-instruct",
253+ "meta-llama/llama-3-8b-instruct",
254+ "meta-llama/llama-3-70b-instruct",
255+ "arcee-ai/caller-large",
256+ "nousresearch/hermes-3-llama-3.1-70b",
257+ ];
258+ for (const model of specificModels) {
259+ if (model.toLowerCase() === model) {
260+ return true;
261+ }
262+ }
263+
264+ const supportedContains = ["llama-3.1"];
265+ for (const model of supportedContains) {
266+ if (model.toLowerCase().includes(model)) {
267+ return true;
268+ }
269+ }
270+
271+ return false;
272+ },
273+ };
modified extensions/vscode/src/extension/VsCodeMessenger.ts +2 −1
@@ -236,8 +236,9 @@
236236 data: {
237237 prompt: stripImages(prompt),
238238 completion: fileAfterEdit ?? "",
239- modelProvider: model.providerName,
239+ modelProvider: model.underlyingProviderName,
240240 modelTitle: model.title ?? "",
241+ filepath: msg.data.range.filepath,
241242 },
242243 });
243244
modified gui/src/components/OnboardingCard/components/BestExperienceConfigForm.tsx +3 −0
@@ -40,6 +40,7 @@
4040 const chatModelConfig = {
4141 model: chatModel.params.model,
4242 provider: chatProvider.provider,
43+ underlyingProviderName: chatProvider.provider,
4344 apiKey: chatApiKey,
4445 title: chatModel.params.title,
4546 };
@@ -47,6 +48,7 @@
4748 const repoMapConfig = {
4849 model: repoMapModel.params.model,
4950 provider: chatProvider.provider,
51+ underlyingProviderName: chatProvider.provider,
5052 apiKey: chatApiKey,
5153 title: repoMapModel.params.title,
5254 };
@@ -54,6 +56,7 @@
5456 const autocompleteModelConfig = {
5557 title: autocompleteModel.params.title,
5658 provider: autocompleteProvider.provider,
59+ underlyingProviderName: autocompleteProvider.provider,
5760 model: autocompleteModel.params.model,
5861 apiKey: autocompleteApiKey,
5962 };
modified gui/src/redux/thunks/streamNormalInput.ts +1 −1
@@ -79,7 +79,7 @@
7979 data: {
8080 prompt: next.value.prompt,
8181 completion: next.value.completion,
82- modelProvider: selectedChatModel.provider,
82+ modelProvider: selectedChatModel.underlyingProviderName,
8383 modelTitle: selectedChatModel.title,
8484 sessionId: state.session.id,
8585 },
modified packages/config-yaml/src/index.ts +1 −0
@@ -8,6 +8,7 @@
88 export * from "./load/proxySecretResolution.js";
99 export * from "./load/typeGuards.js";
1010 export * from "./load/unroll.js";
11+export * from "./modelName.js";
1112 export * from "./registryClient.js";
1213 export * from "./schemas/data/index.js";
1314 export * from "./schemas/index.js";
added packages/config-yaml/src/modelName.test.ts +43 −0
@@ -0,0 +1,43 @@
1+import { parseProxyModelName } from "./modelName.js";
2+
3+describe("parseProxyModelName", () => {
4+ it("parses a basic model name correctly", () => {
5+ const result = parseProxyModelName("owner/package/provider/model");
6+ expect(result).toEqual({
7+ ownerSlug: "owner",
8+ packageSlug: "package",
9+ provider: "provider",
10+ model: "model",
11+ });
12+ });
13+
14+ it("handles model names with slashes in the model part", () => {
15+ const result = parseProxyModelName(
16+ "owner/package/provider/model/with/slashes",
17+ );
18+ expect(result).toEqual({
19+ ownerSlug: "owner",
20+ packageSlug: "package",
21+ provider: "provider",
22+ model: "model/with/slashes",
23+ });
24+ });
25+
26+ it("throws an error for invalid model formats (missing provider)", () => {
27+ expect(() => {
28+ parseProxyModelName("owner/package");
29+ }).toThrow("Invalid model format");
30+ });
31+
32+ it("throws an error for invalid model formats (missing model)", () => {
33+ expect(() => {
34+ parseProxyModelName("owner/package/provider");
35+ }).toThrow("Invalid model format");
36+ });
37+
38+ it("throws an error for empty string", () => {
39+ expect(() => {
40+ parseProxyModelName("");
41+ }).toThrow("Invalid model format");
42+ });
43+});
added packages/config-yaml/src/modelName.ts +19 −0
@@ -0,0 +1,19 @@
1+export interface ProxyModelName {
2+ ownerSlug: string;
3+ packageSlug: string;
4+ provider: string;
5+ model: string;
6+}
7+
8+export function parseProxyModelName(modelName: string): ProxyModelName {
9+ const parts = modelName.split("/");
10+
11+ const [ownerSlug, packageSlug, provider, ...modelParts] = parts;
12+ const model = modelParts.join("/");
13+
14+ if (!provider || !model) {
15+ throw new Error("Invalid model format");
16+ }
17+
18+ return { provider, model, ownerSlug, packageSlug };
19+}
modified packages/config-yaml/src/schemas/data/editInteraction/index.ts +1 −0
@@ -9,4 +9,5 @@
99 modelTitle: z.string(),
1010 prompt: z.string(),
1111 completion: z.string(),
12+ filepath: z.string(),
1213 });
modified packages/config-yaml/src/schemas/data/editInteraction/v0.2.0.ts +1 −0
@@ -15,6 +15,7 @@
1515 completion: true,
1616 modelTitle: true,
1717 modelProvider: true,
18+ filepath: true,
1819 });
1920
2021 export const editInteractionEventSchema_0_2_0_noCode =