mirror of
https://github.com/getcompanion-ai/co-mono.git
synced 2026-04-22 02:03:42 +00:00
feat: added filter for generate-models and regenerated
- blacklisted gpt-4o-2024-08-06, gpt-4o-2024-11-20, gpt-3.5-turbo-0613, gpt-4, gpt-4-0613
This commit is contained in:
parent
5f590b7c53
commit
7d4cdd09c3
2 changed files with 21 additions and 182 deletions
|
|
@ -51,6 +51,26 @@ function isCopilotModelDeprecated(model: Record<string, unknown>): boolean {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Models to exclude from Copilot - dated snapshots, legacy models, and unsupported versions.
|
||||||
|
* Users should use the main model ID (e.g., "gpt-4o") instead of dated versions.
|
||||||
|
*/
|
||||||
|
const COPILOT_EXCLUDED_MODELS = new Set([
|
||||||
|
// Dated GPT-4o snapshots - use "gpt-4o" instead
|
||||||
|
"gpt-4o-2024-05-13",
|
||||||
|
"gpt-4o-2024-08-06",
|
||||||
|
"gpt-4o-2024-11-20",
|
||||||
|
// Legacy GPT-3.5 and GPT-4 models
|
||||||
|
"gpt-3.5-turbo",
|
||||||
|
"gpt-3.5-turbo-0613",
|
||||||
|
"gpt-4",
|
||||||
|
"gpt-4-0613",
|
||||||
|
]);
|
||||||
|
|
||||||
|
function isCopilotModelExcluded(modelId: string): boolean {
|
||||||
|
return COPILOT_EXCLUDED_MODELS.has(modelId);
|
||||||
|
}
|
||||||
|
|
||||||
function getCopilotApi(modelId: string, supportedEndpoints: string[] | null): Api {
|
function getCopilotApi(modelId: string, supportedEndpoints: string[] | null): Api {
|
||||||
if (supportedEndpoints?.includes("/responses")) return "openai-responses";
|
if (supportedEndpoints?.includes("/responses")) return "openai-responses";
|
||||||
if (supportedEndpoints?.includes("/chat/completions")) return "openai-completions";
|
if (supportedEndpoints?.includes("/chat/completions")) return "openai-completions";
|
||||||
|
|
@ -103,6 +123,7 @@ async function fetchCopilotModels(githubToken: string): Promise<Model<any>[]> {
|
||||||
const id = typeof model.id === "string" ? model.id : null;
|
const id = typeof model.id === "string" ? model.id : null;
|
||||||
if (!id) continue;
|
if (!id) continue;
|
||||||
if (isCopilotModelDeprecated(model)) continue;
|
if (isCopilotModelDeprecated(model)) continue;
|
||||||
|
if (isCopilotModelExcluded(id)) continue;
|
||||||
|
|
||||||
const caps = model.capabilities;
|
const caps = model.capabilities;
|
||||||
if (!caps || typeof caps !== "object") continue;
|
if (!caps || typeof caps !== "object") continue;
|
||||||
|
|
|
||||||
|
|
@ -6373,58 +6373,6 @@ export const MODELS = {
|
||||||
contextWindow: 128000,
|
contextWindow: 128000,
|
||||||
maxTokens: 4096,
|
maxTokens: 4096,
|
||||||
} satisfies Model<"openai-completions">,
|
} satisfies Model<"openai-completions">,
|
||||||
"gpt-4o-2024-11-20": {
|
|
||||||
id: "gpt-4o-2024-11-20",
|
|
||||||
name: "gpt-4o-2024-11-20",
|
|
||||||
api: "openai-completions",
|
|
||||||
provider: "github-copilot",
|
|
||||||
baseUrl: "https://api.githubcopilot.com",
|
|
||||||
headers: {
|
|
||||||
"User-Agent": "GitHubCopilotChat/0.35.0",
|
|
||||||
"Editor-Version": "vscode/1.105.1",
|
|
||||||
"Editor-Plugin-Version": "copilot-chat/0.35.0",
|
|
||||||
"Copilot-Integration-Id": "copilot-developer-cli",
|
|
||||||
"Openai-Intent": "conversation-edits",
|
|
||||||
"X-Initiator": "agent",
|
|
||||||
},
|
|
||||||
compat: { supportsStore: false, supportsDeveloperRole: false, supportsReasoningEffort: false },
|
|
||||||
reasoning: false,
|
|
||||||
input: ["text", "image"],
|
|
||||||
cost: {
|
|
||||||
input: 0,
|
|
||||||
output: 0,
|
|
||||||
cacheRead: 0,
|
|
||||||
cacheWrite: 0,
|
|
||||||
},
|
|
||||||
contextWindow: 128000,
|
|
||||||
maxTokens: 16384,
|
|
||||||
} satisfies Model<"openai-completions">,
|
|
||||||
"gpt-4o-2024-08-06": {
|
|
||||||
id: "gpt-4o-2024-08-06",
|
|
||||||
name: "gpt-4o-2024-08-06",
|
|
||||||
api: "openai-completions",
|
|
||||||
provider: "github-copilot",
|
|
||||||
baseUrl: "https://api.githubcopilot.com",
|
|
||||||
headers: {
|
|
||||||
"User-Agent": "GitHubCopilotChat/0.35.0",
|
|
||||||
"Editor-Version": "vscode/1.105.1",
|
|
||||||
"Editor-Plugin-Version": "copilot-chat/0.35.0",
|
|
||||||
"Copilot-Integration-Id": "copilot-developer-cli",
|
|
||||||
"Openai-Intent": "conversation-edits",
|
|
||||||
"X-Initiator": "agent",
|
|
||||||
},
|
|
||||||
compat: { supportsStore: false, supportsDeveloperRole: false, supportsReasoningEffort: false },
|
|
||||||
reasoning: false,
|
|
||||||
input: ["text"],
|
|
||||||
cost: {
|
|
||||||
input: 0,
|
|
||||||
output: 0,
|
|
||||||
cacheRead: 0,
|
|
||||||
cacheWrite: 0,
|
|
||||||
},
|
|
||||||
contextWindow: 128000,
|
|
||||||
maxTokens: 16384,
|
|
||||||
} satisfies Model<"openai-completions">,
|
|
||||||
"grok-code-fast-1": {
|
"grok-code-fast-1": {
|
||||||
id: "grok-code-fast-1",
|
id: "grok-code-fast-1",
|
||||||
name: "grok-code-fast-1",
|
name: "grok-code-fast-1",
|
||||||
|
|
@ -6681,110 +6629,6 @@ export const MODELS = {
|
||||||
contextWindow: 264000,
|
contextWindow: 264000,
|
||||||
maxTokens: 64000,
|
maxTokens: 64000,
|
||||||
} satisfies Model<"openai-responses">,
|
} satisfies Model<"openai-responses">,
|
||||||
"gpt-3.5-turbo-0613": {
|
|
||||||
id: "gpt-3.5-turbo-0613",
|
|
||||||
name: "gpt-3.5-turbo-0613",
|
|
||||||
api: "openai-completions",
|
|
||||||
provider: "github-copilot",
|
|
||||||
baseUrl: "https://api.githubcopilot.com",
|
|
||||||
headers: {
|
|
||||||
"User-Agent": "GitHubCopilotChat/0.35.0",
|
|
||||||
"Editor-Version": "vscode/1.105.1",
|
|
||||||
"Editor-Plugin-Version": "copilot-chat/0.35.0",
|
|
||||||
"Copilot-Integration-Id": "copilot-developer-cli",
|
|
||||||
"Openai-Intent": "conversation-edits",
|
|
||||||
"X-Initiator": "agent",
|
|
||||||
},
|
|
||||||
compat: { supportsStore: false, supportsDeveloperRole: false, supportsReasoningEffort: false },
|
|
||||||
reasoning: false,
|
|
||||||
input: ["text"],
|
|
||||||
cost: {
|
|
||||||
input: 0,
|
|
||||||
output: 0,
|
|
||||||
cacheRead: 0,
|
|
||||||
cacheWrite: 0,
|
|
||||||
},
|
|
||||||
contextWindow: 16384,
|
|
||||||
maxTokens: 4096,
|
|
||||||
} satisfies Model<"openai-completions">,
|
|
||||||
"gpt-4": {
|
|
||||||
id: "gpt-4",
|
|
||||||
name: "gpt-4",
|
|
||||||
api: "openai-completions",
|
|
||||||
provider: "github-copilot",
|
|
||||||
baseUrl: "https://api.githubcopilot.com",
|
|
||||||
headers: {
|
|
||||||
"User-Agent": "GitHubCopilotChat/0.35.0",
|
|
||||||
"Editor-Version": "vscode/1.105.1",
|
|
||||||
"Editor-Plugin-Version": "copilot-chat/0.35.0",
|
|
||||||
"Copilot-Integration-Id": "copilot-developer-cli",
|
|
||||||
"Openai-Intent": "conversation-edits",
|
|
||||||
"X-Initiator": "agent",
|
|
||||||
},
|
|
||||||
compat: { supportsStore: false, supportsDeveloperRole: false, supportsReasoningEffort: false },
|
|
||||||
reasoning: false,
|
|
||||||
input: ["text"],
|
|
||||||
cost: {
|
|
||||||
input: 0,
|
|
||||||
output: 0,
|
|
||||||
cacheRead: 0,
|
|
||||||
cacheWrite: 0,
|
|
||||||
},
|
|
||||||
contextWindow: 32768,
|
|
||||||
maxTokens: 4096,
|
|
||||||
} satisfies Model<"openai-completions">,
|
|
||||||
"gpt-4-0613": {
|
|
||||||
id: "gpt-4-0613",
|
|
||||||
name: "gpt-4-0613",
|
|
||||||
api: "openai-completions",
|
|
||||||
provider: "github-copilot",
|
|
||||||
baseUrl: "https://api.githubcopilot.com",
|
|
||||||
headers: {
|
|
||||||
"User-Agent": "GitHubCopilotChat/0.35.0",
|
|
||||||
"Editor-Version": "vscode/1.105.1",
|
|
||||||
"Editor-Plugin-Version": "copilot-chat/0.35.0",
|
|
||||||
"Copilot-Integration-Id": "copilot-developer-cli",
|
|
||||||
"Openai-Intent": "conversation-edits",
|
|
||||||
"X-Initiator": "agent",
|
|
||||||
},
|
|
||||||
compat: { supportsStore: false, supportsDeveloperRole: false, supportsReasoningEffort: false },
|
|
||||||
reasoning: false,
|
|
||||||
input: ["text"],
|
|
||||||
cost: {
|
|
||||||
input: 0,
|
|
||||||
output: 0,
|
|
||||||
cacheRead: 0,
|
|
||||||
cacheWrite: 0,
|
|
||||||
},
|
|
||||||
contextWindow: 32768,
|
|
||||||
maxTokens: 4096,
|
|
||||||
} satisfies Model<"openai-completions">,
|
|
||||||
"gpt-4o-2024-05-13": {
|
|
||||||
id: "gpt-4o-2024-05-13",
|
|
||||||
name: "gpt-4o-2024-05-13",
|
|
||||||
api: "openai-completions",
|
|
||||||
provider: "github-copilot",
|
|
||||||
baseUrl: "https://api.githubcopilot.com",
|
|
||||||
headers: {
|
|
||||||
"User-Agent": "GitHubCopilotChat/0.35.0",
|
|
||||||
"Editor-Version": "vscode/1.105.1",
|
|
||||||
"Editor-Plugin-Version": "copilot-chat/0.35.0",
|
|
||||||
"Copilot-Integration-Id": "copilot-developer-cli",
|
|
||||||
"Openai-Intent": "conversation-edits",
|
|
||||||
"X-Initiator": "agent",
|
|
||||||
},
|
|
||||||
compat: { supportsStore: false, supportsDeveloperRole: false, supportsReasoningEffort: false },
|
|
||||||
reasoning: false,
|
|
||||||
input: ["text", "image"],
|
|
||||||
cost: {
|
|
||||||
input: 0,
|
|
||||||
output: 0,
|
|
||||||
cacheRead: 0,
|
|
||||||
cacheWrite: 0,
|
|
||||||
},
|
|
||||||
contextWindow: 128000,
|
|
||||||
maxTokens: 4096,
|
|
||||||
} satisfies Model<"openai-completions">,
|
|
||||||
"gpt-4-o-preview": {
|
"gpt-4-o-preview": {
|
||||||
id: "gpt-4-o-preview",
|
id: "gpt-4-o-preview",
|
||||||
name: "gpt-4-o-preview",
|
name: "gpt-4-o-preview",
|
||||||
|
|
@ -6837,32 +6681,6 @@ export const MODELS = {
|
||||||
contextWindow: 128000,
|
contextWindow: 128000,
|
||||||
maxTokens: 16384,
|
maxTokens: 16384,
|
||||||
} satisfies Model<"openai-completions">,
|
} satisfies Model<"openai-completions">,
|
||||||
"gpt-3.5-turbo": {
|
|
||||||
id: "gpt-3.5-turbo",
|
|
||||||
name: "gpt-3.5-turbo",
|
|
||||||
api: "openai-completions",
|
|
||||||
provider: "github-copilot",
|
|
||||||
baseUrl: "https://api.githubcopilot.com",
|
|
||||||
headers: {
|
|
||||||
"User-Agent": "GitHubCopilotChat/0.35.0",
|
|
||||||
"Editor-Version": "vscode/1.105.1",
|
|
||||||
"Editor-Plugin-Version": "copilot-chat/0.35.0",
|
|
||||||
"Copilot-Integration-Id": "copilot-developer-cli",
|
|
||||||
"Openai-Intent": "conversation-edits",
|
|
||||||
"X-Initiator": "agent",
|
|
||||||
},
|
|
||||||
compat: { supportsStore: false, supportsDeveloperRole: false, supportsReasoningEffort: false },
|
|
||||||
reasoning: false,
|
|
||||||
input: ["text"],
|
|
||||||
cost: {
|
|
||||||
input: 0,
|
|
||||||
output: 0,
|
|
||||||
cacheRead: 0,
|
|
||||||
cacheWrite: 0,
|
|
||||||
},
|
|
||||||
contextWindow: 16384,
|
|
||||||
maxTokens: 4096,
|
|
||||||
} satisfies Model<"openai-completions">,
|
|
||||||
"gpt-4o-mini": {
|
"gpt-4o-mini": {
|
||||||
id: "gpt-4o-mini",
|
id: "gpt-4o-mini",
|
||||||
name: "gpt-4o-mini",
|
name: "gpt-4o-mini",
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue