summary optimizaitons

This commit is contained in:
Dax Raad
2025-11-22 11:32:49 -05:00
parent e103fb1f93
commit 75c29d4d1c
9 changed files with 113 additions and 70 deletions

View File

@@ -658,20 +658,29 @@ export namespace Provider {
}
const provider = await state().then((state) => state.providers[providerID])
if (!provider) return
let priority = ["claude-haiku-4-5", "claude-haiku-4.5", "3-5-haiku", "3.5-haiku", "gemini-2.5-flash", "gpt-5-nano"]
// claude-haiku-4.5 is considered a premium model in github copilot, we shouldn't use premium requests for title gen
if (providerID === "github-copilot") {
priority = priority.filter((m) => m !== "claude-haiku-4.5")
}
if (providerID === "opencode" || providerID === "local") {
priority = ["gpt-5-nano"]
}
for (const item of priority) {
for (const model of Object.keys(provider.info.models)) {
if (model.includes(item)) return getModel(providerID, model)
if (provider) {
let priority = [
"claude-haiku-4-5",
"claude-haiku-4.5",
"3-5-haiku",
"3.5-haiku",
"gemini-2.5-flash",
"gpt-5-nano",
]
// claude-haiku-4.5 is considered a premium model in github copilot, we shouldn't use premium requests for title gen
if (providerID === "github-copilot") {
priority = priority.filter((m) => m !== "claude-haiku-4.5")
}
if (providerID === "opencode" || providerID === "local") {
priority = ["gpt-5-nano"]
}
for (const item of priority) {
for (const model of Object.keys(provider.info.models)) {
if (model.includes(item)) return getModel(providerID, model)
}
}
}
return getModel("opencode", "gpt-5-nano")
}
const priority = ["gpt-5", "claude-sonnet-4", "big-pickle", "gemini-3-pro"]

View File

@@ -128,12 +128,7 @@ export namespace ProviderTransform {
return undefined
}
export function options(
providerID: string,
modelID: string,
npm: string,
sessionID: string,
): Record<string, any> | undefined {
export function options(providerID: string, modelID: string, npm: string, sessionID: string): Record<string, any> {
const result: Record<string, any> = {}
// switch to providerID later, for now use this
@@ -175,6 +170,25 @@ export namespace ProviderTransform {
return result
}
export function smallOptions(input: { providerID: string; modelID: string }) {
const options: Record<string, any> = {}
if (input.providerID === "openai" || input.modelID.includes("gpt-5")) {
if (input.modelID.includes("5.1")) {
options["reasoningEffort"] = "low"
} else {
options["reasoningEffort"] = "minimal"
}
}
if (input.providerID === "google") {
options["thinkingConfig"] = {
thinkingBudget: 0,
}
}
return options
}
export function providerOptions(npm: string | undefined, providerID: string, options: { [x: string]: any }) {
switch (npm) {
case "@ai-sdk/openai":