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:
cau1k 2025-12-14 22:26:43 -05:00
parent 5f590b7c53
commit 7d4cdd09c3
No known key found for this signature in database
2 changed files with 21 additions and 182 deletions

View file

@ -51,6 +51,26 @@ function isCopilotModelDeprecated(model: Record<string, unknown>): boolean {
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 {
if (supportedEndpoints?.includes("/responses")) return "openai-responses";
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;
if (!id) continue;
if (isCopilotModelDeprecated(model)) continue;
if (isCopilotModelExcluded(id)) continue;
const caps = model.capabilities;
if (!caps || typeof caps !== "object") continue;

View file

@ -6373,58 +6373,6 @@ export const MODELS = {
contextWindow: 128000,
maxTokens: 4096,
} 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": {
id: "grok-code-fast-1",
name: "grok-code-fast-1",
@ -6681,110 +6629,6 @@ export const MODELS = {
contextWindow: 264000,
maxTokens: 64000,
} 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": {
id: "gpt-4-o-preview",
name: "gpt-4-o-preview",
@ -6837,32 +6681,6 @@ export const MODELS = {
contextWindow: 128000,
maxTokens: 16384,
} 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": {
id: "gpt-4o-mini",
name: "gpt-4o-mini",