(providerID: string)
| 2125 | } |
| 2126 | |
| 2127 | export async function getSmallModel(providerID: string) { |
| 2128 | const cfg = await Config.get() |
| 2129 | |
| 2130 | if (cfg.small_model) { |
| 2131 | const parsed = parseModel(cfg.small_model) |
| 2132 | return getModel(parsed.providerID, parsed.modelID) |
| 2133 | } |
| 2134 | |
| 2135 | const provider = await state().then((state) => state.providers[providerID]) |
| 2136 | if (provider) { |
| 2137 | let priority = [ |
| 2138 | "gpt-5-mini", |
| 2139 | "claude-haiku-4-5", |
| 2140 | "claude-haiku-4.5", |
| 2141 | "3-5-haiku", |
| 2142 | "3.5-haiku", |
| 2143 | "gemini-2.5-flash", |
| 2144 | "gpt-5-nano", |
| 2145 | ] |
| 2146 | // claude-haiku-4.5 is considered a premium model in github copilot, we shouldn't use premium requests for title gen |
| 2147 | if (providerID === "github-copilot") { |
| 2148 | priority = priority.filter((m) => m !== "claude-haiku-4.5") |
| 2149 | } |
| 2150 | if (providerID.startsWith("arctic")) { |
| 2151 | priority = ["gpt-5-nano"] |
| 2152 | } |
| 2153 | for (const item of priority) { |
| 2154 | for (const model of Object.keys(provider.models)) { |
| 2155 | if (model.includes(item)) return getModel(providerID, model) |
| 2156 | } |
| 2157 | } |
| 2158 | } |
| 2159 | |
| 2160 | // Check if arctic provider is available before using it |
| 2161 | const arcticProvider = await state().then((state) => state.providers["arctic"]) |
| 2162 | if (arcticProvider && arcticProvider.models["gpt-5-nano"]) { |
| 2163 | return getModel("arctic", "gpt-5-nano") |
| 2164 | } |
| 2165 | |
| 2166 | return undefined |
| 2167 | } |
| 2168 | |
| 2169 | const priority = ["gpt-5", "claude-sonnet-4", "big-pickle", "gemini-3-pro"] |
| 2170 | export function sort(models: Model[]) { |
nothing calls this directly
no test coverage detected