diff --git a/packages/factory/README.md b/packages/factory/README.md index fa7f46c..357dec0 100644 --- a/packages/factory/README.md +++ b/packages/factory/README.md @@ -66,16 +66,19 @@ Each model is served on the one API droid uses for it: | Anthropic Messages (`/api/llm/a`) | Fable 5.1, Fable 5, Opus 5.5, Opus 5, Opus 4.8, Sonnet 5.5, Sonnet 5, Sonnet 4.6, Haiku 5.5, Haiku 4.5, MiniMax M2.7 | | OpenAI Responses (`/api/llm/o/v1`) | GPT-6.1 Sol, GPT-6 Sol/Astra/Luna, GPT-5.6 Sol/Terra/Luna, GPT-5.5, GPT-5.4, GPT-5.3-Codex, Grok 4.7, Grok 4.6 | | Chat completions (`/api/llm/o/v1`) | GLM-5.3, GLM-5.3-Flash, GLM-5.2, Kimi K3, DeepSeek V4.1 Flash, Qwen3.8 Max, MiniMax M3, Mistral Large 4, Mistral Medium 3.5, Nemotron 3 Ultra | +| Gemini generate (`/api/llm/g/v1/generate`) | Gemini 4 Argon, Gemini 3.1 Pro, Gemini 3.8/3.7/3.6/3.5 Flash, Gemini 3 Flash | Reasoning efforts are the variants droid offers for each model. DeepSeek V4.1 Flash, Kimi K3 and GLM-5.2 have `none`, droid's "off": they stop thinking. Reasoning is mandatory on GLM-5.3 and GLM-5.3-Flash (Fireworks turns `none` away), so `low` is their least. -The list is not included: +Gemini's requests go to Factory's generate route with the model in the +body, droid's line opening the system instruction. Gemini 4 Argon is behind +a Factory feature flag in droid 0.241.1, so an account it isn't on for may +be refused it. -- Gemini, which Factory sends on a route of its own. -- auto, which droid picks on the client side. +auto is not included: droid picks it on the client side. ## Use diff --git a/packages/factory/gemini.test.mjs b/packages/factory/gemini.test.mjs new file mode 100644 index 0000000..91b2780 --- /dev/null +++ b/packages/factory/gemini.test.mjs @@ -0,0 +1,71 @@ +// yetone/magpie#2080: Gemini's models go to Factory's own route, +// /api/llm/g/v1/generate, as magpie's built-in sends them (buildGemini, +// factoryDroidGoogle in internal/provider/factory_client.go). +import { afterEach, expect, test } from "bun:test" +import { FactoryAuthPlugin } from "./index.mjs" + +const real = globalThis.fetch +afterEach(() => (globalThis.fetch = real)) +const droid = "You are Droid, an AI software engineering agent built by Factory." + +async function loaded(auth = { type: "oauth", access: "factory-token", expires: Date.now() + 3_600_000, activeOrganizationId: "org_A" }) { + const seen = [] + globalThis.fetch = async (url, init) => { + seen.push({ url: String(url), ...init }) + return new Response('data: {"candidates":[{"content":{"role":"model","parts":[{"text":"ok"}]}}]}\n\n', { headers: { "content-type": "text/event-stream" } }) + } + const hooks = await FactoryAuthPlugin({ client: { auth: { set: async () => {} } } }) + return { l: await hooks.auth.loader(async () => auth), seen } +} + +// the request magpie's gateway hands a plugin's @ai-sdk/google model +const request = { + contents: [{ role: "user", parts: [{ text: "hi" }, { inlineData: { mimeType: "image/png", data: "aW1n" } }] }], + systemInstruction: { role: "user", parts: [{ text: "Be brief." }, { text: "Use tools." }] }, + generationConfig: { maxOutputTokens: 512, thinkingConfig: { includeThoughts: true, thinkingLevel: "high" } }, + tools: [{ functionDeclarations: [{ name: "Read", parameters: { type: "object" } }] }], +} + +test("a Gemini model goes to /api/llm/g/v1/generate, the model in the body, x-api-provider google", async () => { + const { l, seen } = await loaded() + const res = await l.fetch("https://api.factory.ai/api/llm/g/v1/models/gemini-4-argon:streamGenerateContent?alt=sse", { + method: "POST", + headers: { "content-type": "application/json", "x-goog-api-key": "placeholder", "content-length": "1" }, + body: JSON.stringify(request), + }) + expect(seen[0].url).toBe("https://api.factory.ai/api/llm/g/v1/generate") + const sent = JSON.parse(seen[0].body) + expect(sent.model).toBe("gemini-4-argon") + expect(sent.systemInstruction).toEqual({ parts: [{ text: droid + "\nBe brief.\nUse tools." }] }) + for (const k of ["contents", "generationConfig", "tools"]) expect(sent[k]).toEqual(request[k]) + const h = seen[0].headers + expect(h.get("x-api-provider")).toBe("google") + expect(h.get("authorization")).toBe("Bearer factory-token") + expect(h.get("x-goog-api-key")).toBeNull() + expect(h.get("x-api-key")).toBeNull() + expect(h.get("content-length")).toBeNull() + expect(h.get("OpenAI-Platform")).toBeNull() + expect(await res.text()).toContain('"text":"ok"') +}) + +test("a Gemini request with no system instruction gets droid's line, one droid opened already goes on as it is", async () => { + const { l, seen } = await loaded() + const at = "https://api.factory.ai/api/llm/g/v1/models/gemini-3.5-flash:streamGenerateContent?alt=sse" + await l.fetch(at, { method: "POST", body: JSON.stringify({ contents: request.contents }) }) + expect(JSON.parse(seen[0].body).systemInstruction).toEqual({ parts: [{ text: droid }] }) + const own = { contents: request.contents, systemInstruction: { parts: [{ text: droid + "\nmine" }, { inlineData: { mimeType: "image/png", data: "eA==" } }] } } + await l.fetch(at, { method: "POST", body: JSON.stringify(own) }) + expect(JSON.parse(seen[1].body)).toEqual({ ...own, model: "gemini-3.5-flash" }) + // a string instruction and parts other than text keep their place after the line + await l.fetch(at, { method: "POST", body: JSON.stringify({ contents: request.contents, systemInstruction: "Plain." }) }) + expect(JSON.parse(seen[2].body).systemInstruction).toEqual({ parts: [{ text: droid + "\nPlain." }] }) + await l.fetch(at, { method: "POST", body: JSON.stringify({ contents: request.contents, systemInstruction: { parts: [{ text: "A" }, { inlineData: { mimeType: "image/png", data: "eA==" } }] } }) }) + expect(JSON.parse(seen[3].body).systemInstruction).toEqual({ parts: [{ text: droid + "\nA" }, { inlineData: { mimeType: "image/png", data: "eA==" } }] }) +}) + +test("an EU org's Gemini request goes to Factory's EU region's generate route", async () => { + const { l, seen } = await loaded({ type: "oauth", access: "factory-token", expires: Date.now() + 3_600_000, activeOrganizationId: "org_A", region: "eu" }) + await l.fetch("https://api.factory.ai/api/llm/g/v1/models/gemini-3.8-flash:streamGenerateContent?alt=sse", { method: "POST", body: JSON.stringify(request) }) + expect(new URL(seen[0].url).pathname).toBe("/api/llm/g/v1/generate") + expect(seen[0].url.startsWith("https://api.factory.ai/")).toBe(false) +}) diff --git a/packages/factory/index.mjs b/packages/factory/index.mjs index b3ee448..dbbab37 100644 --- a/packages/factory/index.mjs +++ b/packages/factory/index.mjs @@ -27,18 +27,25 @@ const ASK_AGAIN = 10 * 60 * 1000 const ANTHROPIC = { npm: "@ai-sdk/anthropic", api: API + "/api/llm/a/v1" } const RESPONSES = { npm: "@ai-sdk/openai", api: API + "/api/llm/o/v1" } const CHAT = { npm: "@ai-sdk/openai-compatible", api: API + "/api/llm/o/v1" } +// Gemini's go to Factory's /api/llm/g/v1/generate, the model in the body +// (geminiBody); the AI SDK's Google package asks for :streamGenerateContent +// under models/, which send() takes there +const GEMINI = { npm: "@ai-sdk/google", api: API + "/api/llm/g/v1" } const E5 = ["low", "medium", "high", "xhigh", "max"] const E6 = ["none", "low", "medium", "high", "xhigh", "max"] const E4 = ["low", "medium", "high", "xhigh"] -// The models droid's /model picker offers, less Gemini's (sent on a route of -// Factory's own) and auto (droid picks it client side): id, name, the wire -// droid sends it on, the vendor it names in x-api-provider, context, output, -// reasoning efforts, images. Haiku 5.5 and Mistral Large 4 are droid -// 0.240.0's (models.test.mjs reads its registry); GPT-6 Astra Ultra Fast, -// new there too, stays out: droid offers it only after the user accepts -// Factory's high-cost terms for it (explicitOptInRequirement). +// The models droid's /model picker offers, less auto (droid picks it client +// side): id, name, the wire droid sends it on, the vendor it names in +// x-api-provider, context, output, reasoning efforts, images. Haiku 5.5 and +// Mistral Large 4 are droid 0.240.0's (models.test.mjs reads its registry); +// GPT-6 Astra Ultra Fast, new there too, stays out: droid offers it only +// after the user accepts Factory's high-cost terms for it +// (explicitOptInRequirement). Gemini's are droid 0.241.1's, as magpie's +// built-in has them (yetone/magpie#2080); Gemini 4 Argon is behind a +// feature flag of Factory's there, so an account it isn't on for may be +// refused it. const MODELS = [ ["claude-fable-5.1", "Fable 5.1", ANTHROPIC, "anthropic", 867000, 128000, E5, true], ["claude-fable-5", "Fable 5", ANTHROPIC, "anthropic", 867000, 128000, E5, true], @@ -76,6 +83,13 @@ const MODELS = [ ["mistral-large-4", "Mistral Large 4", CHAT, "mistral", 524288, 64000, ["high"], true], ["mistral-medium-3.5", "Mistral Medium 3.5", CHAT, "mistral", 256000, 64000, ["high"], true], ["nemotron-3-ultra", "Nemotron 3 Ultra", CHAT, "baseten", 202000, 65536, ["high"], false], + ["gemini-4-argon", "Gemini 4 Argon", GEMINI, "google", 1000000, 65536, ["low", "medium", "high"], true], + ["gemini-3.1-pro-preview", "Gemini 3.1 Pro", GEMINI, "google", 1000000, 65536, ["low", "medium", "high"], true], + ["gemini-3.8-flash", "Gemini 3.8 Flash", GEMINI, "google", 1000000, 65536, ["low", "medium", "high"], true], + ["gemini-3.7-flash", "Gemini 3.7 Flash", GEMINI, "google", 1000000, 65536, ["low", "medium", "high"], true], + ["gemini-3.6-flash", "Gemini 3.6 Flash", GEMINI, "google", 1000000, 65536, ["low", "medium", "high"], true], + ["gemini-3.5-flash", "Gemini 3.5 Flash", GEMINI, "google", 1000000, 65536, ["minimal", "low", "medium", "high"], true], + ["gemini-3-flash-preview", "Gemini 3 Flash", GEMINI, "google", 1000000, 65536, ["minimal", "low", "medium", "high"], true], ].map(([id, name, wire, upstream, context, output, efforts, images]) => ({ id, name, wire, upstream, context, output, efforts, images })) const byId = new Map(MODELS.map((m) => [m.id, m])) @@ -83,6 +97,7 @@ const byId = new Map(MODELS.map((m) => [m.id, m])) // variant is what the AI SDK package a model is on is given for an effort. function variant(npm, effort) { if (npm === ANTHROPIC.npm) return { effort } + if (npm === GEMINI.npm) return { thinkingConfig: { includeThoughts: true, thinkingLevel: effort } } return { reasoningEffort: effort } } @@ -400,6 +415,53 @@ function droidBody(path, body) { return JSON.stringify(m) } +// bodyText is a request body as text, or null for one that isn't. +function bodyText(body) { + if (typeof body === "string") return body + if (body instanceof ArrayBuffer || ArrayBuffer.isView(body)) return Buffer.from(body instanceof ArrayBuffer ? body : body.buffer.slice(body.byteOffset, body.byteOffset + body.byteLength)).toString("utf8") + return null +} + +// GEMINI_CALL is the AI SDK Google package's request path, the model in it. +const GEMINI_CALL = /\/models\/([^/:]+):(?:stream)?generateContent$/i + +// geminiBody is body, a Gemini generateContent request for model, as +// Factory's /api/llm/g/v1/generate takes it, as magpie's built-in sends it +// (buildGemini, factoryDroidGoogle): the model in the body, the system +// instruction without a role and opening with droid's line, as one text part +// of droid's line and the instruction's text parts joined with "\n", then +// its other parts. A body that can't be read goes on as it is. +function geminiBody(model, body) { + const text = bodyText(body) + if (text == null) return body + let m + try { + m = JSON.parse(text) + } catch { + return body + } + if (!m || typeof m !== "object" || Array.isArray(m)) return body + m.model = model + delete m.stream + let si = m.systemInstruction + if (typeof si === "string") si = { parts: [{ text: si }] } + if (!si || typeof si !== "object") si = { parts: [] } + delete si.role + const parts = Array.isArray(si.parts) ? si.parts : [] + if (!(typeof parts[0]?.text === "string" && parts[0].text.startsWith(DROID_LINE))) { + const texts = [] + const rest = [] + for (const p of parts) { + if (p && typeof p === "object" && typeof p.text === "string" && Object.keys(p).length === 1) texts.push(p.text) + else rest.push(p) + } + const joined = texts.join("\n") + si.parts = [{ text: joined.trim() === "" ? DROID_LINE : DROID_LINE + "\n" + joined }, ...rest] + } + m.systemInstruction = si + return JSON.stringify(m) +} + // errorReply is an error as the API the request was for words one: // Anthropic's on /llm/a/, OpenAI's on the others. function errorReply(url, status, type, message, headers = new Headers()) { @@ -550,8 +612,8 @@ async function deviceSignIn() { // is a balance in cents. // CORE are the models Droid Core's windows count: those of a vendor other -// than Anthropic, OpenAI and xAI. Standard's count every other model. -const CORE = MODELS.filter((m) => !["anthropic", "openai", "xai"].includes(m.upstream)).map((m) => m.id) +// than Anthropic, OpenAI, xAI and Google. Standard's count every other model. +const CORE = MODELS.filter((m) => !["anthropic", "openai", "xai", "google"].includes(m.upstream)).map((m) => m.id) // statusLine is a status as Go's HTTP client names it, "403 Forbidden". const statusLine = (status) => `${status} ${STATUS_CODES[status] ?? ""}`.trim() @@ -1432,12 +1494,23 @@ export const FactoryAuthPlugin = async ({ client }) => { const send = async (input, init, body, renewed) => { const c = await fresh(renewed) let url = input instanceof Request ? input.url : String(input) + // Gemini's: Factory's generate route, the model in the body + const call = GEMINI_CALL.exec(new URL(url).pathname) + if (call) { + const u = new URL(url) + u.pathname = u.pathname.replace(GEMINI_CALL, "/generate") + u.search = "" + url = u.toString() + body = geminiBody(decodeURIComponent(call[1]), body) + } // an EU org is served from Factory's EU region, an on-prem one // from its own host: the request goes there const to = llmBase(c) if (to !== API && url.startsWith(API)) url = to + url.slice(API.length) const h = new Headers(init?.headers ?? (input instanceof Request ? input.headers : undefined)) h.delete("x-api-key") + // the AI SDK's Google package's, with OpenCode's placeholder key + h.delete("x-goog-api-key") factoryHeaders(h, c) const model = byId.get(bodyModel(body)) const path = new URL(url).pathname @@ -1454,7 +1527,8 @@ export const FactoryAuthPlugin = async ({ client }) => { const anthropic = path.includes("/llm/a/") && (path.endsWith("/messages") || path.endsWith("/messages/count_tokens")) const adapted = anthropic ? wrapAnthropicTools(anthropicBody(body)) : { body: droidBody(path, body), names: new Set() } const out = adapted.body - if (out !== body) h.delete("content-length") + // the caller's length is of the body it sent, not of this one + if (out !== init?.body) h.delete("content-length") const res = await fetch(url, { ...init, method: init?.method ?? (input instanceof Request ? input.method : "POST"), headers: h, body: out }) return path.endsWith("/messages") ? unwrapAnthropicTools(res, adapted.names) : res } @@ -1501,4 +1575,4 @@ export const FactoryAuthPlugin = async ({ client }) => { } // for tests -export const _internal = { limitWindows, windowEnd, dollars, vendorError, CORE, droidBody, DROID_LINE } +export const _internal = { limitWindows, windowEnd, dollars, vendorError, CORE, droidBody, DROID_LINE, geminiBody } diff --git a/packages/factory/models.test.mjs b/packages/factory/models.test.mjs index c7e6ec1..511809b 100644 --- a/packages/factory/models.test.mjs +++ b/packages/factory/models.test.mjs @@ -61,9 +61,6 @@ test("every model in droid 0.240.0's picker is offered, or left out for a reason const reason = { // droid picks these itself, client side auto: "router", "auto-fast": "router", - // Gemini goes on a route of Factory's own - "gemini-3.1-pro-preview": "gemini", "gemini-3.8-flash": "gemini", "gemini-3.7-flash": "gemini", - "gemini-3.6-flash": "gemini", "gemini-3.5-flash": "gemini", "gemini-3-flash-preview": "gemini", // not released (unreleased:!0) or not in the registry "garnet-07-15": "unreleased", "atlas-07-21": "unreleased", "aster-07-15": "unreleased", inkling: "unreleased", // asks the user to accept Factory's high-cost terms first @@ -80,3 +77,31 @@ test("every model in droid 0.240.0's picker is offered, or left out for a reason expect(entry("gpt-6-astra-ultrafast")).toContain('explicitOptInRequirement:{kind:"high_cost"') expect(got["gpt-6-astra-ultrafast"]).toBeUndefined() }) + +// yetone/magpie#2080: droid 0.241.1 offers Gemini 4 Argon; the plugin +// offered no Gemini at all. The cases are droid 0.241.1's entries. +const DROID_241 = readFileSync(new URL("./testdata/droid-0.241.1-gemini.txt", import.meta.url), "utf8") + +test("droid 0.241.1's Gemini models are offered on Factory's Gemini route, as droid has them", async () => { + const got = await models() + const picker = JSON.parse(DROID_241.match(/^var y=(\[[^\]]*\]);/m)[1]) + const gemini = picker.filter((id) => id.startsWith("gemini-")) + expect(gemini).toEqual(["gemini-4-argon", "gemini-3.1-pro-preview", "gemini-3.8-flash", "gemini-3.7-flash", "gemini-3.6-flash", "gemini-3.5-flash", "gemini-3-flash-preview"]) + // I(total, output) states the total context, as P does in 0.240.0 + expect(DROID_241).toContain("function I(o,t){return O({maxInputTokens:o-t,maxOutputTokens:t})}") + for (const id of gemini) { + const text = DROID_241.split("\n").find((l) => l.startsWith(`"${id}":{id:"${id}",`)) + const m = got[id] + expect(m).toBeDefined() + expect(text).toContain('provider:"google"') + expect(m.name).toBe(text.match(/,name:"([^"]+)"/)[1]) + const [, context, output] = text.match(/contextLimits:[Ik]\((\d+e\d+|\d+),(\d+)\)/) + expect(m.limit).toEqual({ context: Number(context), output: Number(output) }) + expect(Object.keys(m.variants)).toEqual(JSON.parse(text.match(/reasoningEffort:\{supported:(\[[^\]]*\])/)[1])) + // droid takes images unless an entry says images:!1 + expect(text).not.toContain("images:!1") + expect(m.attachment).toBe(true) + expect(m.provider).toEqual({ npm: "@ai-sdk/google", api: "https://api.factory.ai/api/llm/g/v1" }) + } + expect(got["gemini-4-argon"].variants.high).toEqual({ thinkingConfig: { includeThoughts: true, thinkingLevel: "high" } }) +}) diff --git a/packages/factory/testdata/droid-0.241.1-gemini.txt b/packages/factory/testdata/droid-0.241.1-gemini.txt new file mode 100644 index 0000000..a1c79e2 --- /dev/null +++ b/packages/factory/testdata/droid-0.241.1-gemini.txt @@ -0,0 +1,13 @@ +// Excerpts, byte for byte, of droid 0.241.1 (@factory/cli-darwin-arm64@0.241.1, +// bin/droid, its bundled model registry): the picker order, the context +// helper Gemini 4 Argon's limits use, and the entries of its Gemini models. +// The Gemini 3 entries' k(1e6,65536) is the same total context and output. +var y=["auto","auto-fast","claude-fable-5.1","claude-fable-5","claude-opus-5-5","claude-opus-5-5-fast","claude-opus-5","claude-opus-5-fast","claude-opus-4-8","claude-opus-4-8-fast","claude-opus-4-7","claude-opus-4-7-fast","claude-opus-4-6","claude-opus-4-6-fast","claude-opus-4-5-20251101","claude-sonnet-5-5","claude-sonnet-5","claude-sonnet-4-6","claude-sonnet-4-5-20250929","claude-haiku-5-5","claude-haiku-4-5-20251001","gpt-6.1-sol","gpt-6-astra","gpt-6-astra-ultrafast","gpt-6-sol","gpt-6-luna","gpt-5.6-sol","gpt-5.6-sol-fast","gpt-5.6-terra","gpt-5.6-luna","gpt-5.5","gpt-5.5-fast","gpt-5.5-pro","gpt-5.4","gpt-5.4-fast","gpt-5.4-mini","gpt-5.4-mini-fast","gpt-5.3-codex","gpt-5.3-codex-fast","gpt-5.2","gemini-4-argon","garnet-07-15","gemini-3.1-pro-preview","gemini-3.8-flash","gemini-3.7-flash","gemini-3.6-flash","gemini-3.5-flash","gemini-3-flash-preview","inkling","mistral-large-4","mistral-medium-3.5","glm-5.3-flash","glm-5.3","glm-5.2","glm-5.2-fast","kimi-k3","qwen3.8-max","nemotron-3-ultra","deepseek-v4.1-flash","deepseek-v4-flash-0731","deepseek-v4-pro","minimax-m3","muse-spark-1.2","grok-4.7","grok-4.6","grok-4.5","atlas-07-21","aster-07-15","minimax-m2.7","kimi-k2.5","gpt-5.2-codex","glm-5.1","glm-5","glm-4.7","gpt-5.1-codex-max"]; +function I(o,t){return O({maxInputTokens:o-t,maxOutputTokens:t})} +"gemini-4-argon":{id:"gemini-4-argon",name:"Gemini 4 Argon",shortName:"Gemini 4 Argon",provider:"google",systemPromptReminders:b,apiProviders:["google"],regionOverrides:{us:h},reasoningEffort:{supported:["low","medium","high"],default:"medium"},tier:"standard",featureFlag:J.Gemini4Argon,unreleased:!0,images:!0,pdf:!0,contextLimits:I(1e6,65536),thinking:N(),apiRequest:v({supportsMedium:!0,omitSamplingParameters:!0,maxOutputTokens:65536,preserveNativeContent:!0}),disabledForPilots:!1,cost:{tokenMultiplier:1.6,outputTokenMultiplier:5,cacheReadTokenMultiplier:0.05,promotions:[{discount:0.5,startsAt:new Date("2026-10-13T16:00:00Z"),expiresAt:new Date("2026-12-01T08:00:00Z"),label:"50% off"}]},newUntil:new Date("2026-10-18T16:00:00Z")} +"gemini-3.1-pro-preview":{id:"gemini-3.1-pro-preview",newUntil:new Date("2000-01-01T00:00:00Z"),name:"Gemini 3.1 Pro",shortName:"Gemini 3.1 Pro",provider:"google",systemPromptReminders:b,apiProviders:["google"],reasoningEffort:{supported:["low","medium","high"],default:"high"},tier:"standard",pdf:!0,contextLimits:k(1e6,65536),thinking:N(),apiRequest:v({supportsMedium:!0}),disabledForPilots:!1,cost:{tokenMultiplier:0.8},regionOverrides:{us:h},matchPatterns:[/gemini[^a-z0-9]*3\.?1[^a-z0-9]*pro/i]} +"gemini-3.8-flash":{id:"gemini-3.8-flash",name:"Gemini 3.8 Flash",shortName:"Gemini 3.8 Flash",provider:"google",systemPromptReminders:b,apiProviders:["google"],regionOverrides:{eu:{apiProviders:["google"]}},reasoningEffort:{supported:["low","medium","high"],default:"high"},tier:"standard",pdf:!0,contextLimits:k(1e6,65536),thinking:N(),apiRequest:v({supportsMedium:!0}),disabledForPilots:!1,cost:{tokenMultiplier:0.6,outputTokenMultiplier:5,promotions:[Mt]},matchPatterns:[/gemini[^a-z0-9]*3[.-]?8[^a-z0-9]*flash/i],newUntil:new Date("2026-09-07T00:00:00Z")} +"gemini-3.7-flash":{id:"gemini-3.7-flash",name:"Gemini 3.7 Flash",shortName:"Gemini 3.7 Flash",provider:"google",systemPromptReminders:b,apiProviders:["google"],regionOverrides:{eu:{apiProviders:["google"]}},reasoningEffort:{supported:["low","medium","high"],default:"high"},tier:"standard",pdf:!0,contextLimits:k(1e6,65536),thinking:N(),apiRequest:v({supportsMedium:!0}),disabledForPilots:!1,cost:{tokenMultiplier:0.6,outputTokenMultiplier:5,promotions:[Mt]},matchPatterns:[/gemini[^a-z0-9]*3[.-]?7[^a-z0-9]*flash/i],newUntil:new Date("2026-08-18T00:00:00Z")} +"gemini-3.6-flash":{id:"gemini-3.6-flash",name:"Gemini 3.6 Flash",shortName:"Gemini 3.6 Flash",provider:"google",systemPromptReminders:b,apiProviders:["google"],regionOverrides:{eu:{apiProviders:["google"]}},reasoningEffort:{supported:["low","medium","high"],default:"high"},tier:"standard",pdf:!0,contextLimits:k(1e6,65536),thinking:N(),apiRequest:v(),disabledForPilots:!1,cost:{tokenMultiplier:0.6,outputTokenMultiplier:5},matchPatterns:[/gemini[^a-z0-9]*3[.-]?6[^a-z0-9]*flash/i],newUntil:new Date("2026-07-29T00:00:00Z")} +"gemini-3.5-flash":{id:"gemini-3.5-flash",newUntil:new Date("2000-01-01T00:00:00Z"),name:"Gemini 3.5 Flash",shortName:"Gemini 3.5 Flash",provider:"google",systemPromptReminders:b,apiProviders:["google"],regionOverrides:{eu:{apiProviders:["google"]}},reasoningEffort:{supported:["minimal","low","medium","high"],default:"high"},tier:"standard",pdf:!0,contextLimits:k(1e6,65536),thinking:N(),apiRequest:v(),disabledForPilots:!1,cost:{tokenMultiplier:0.6},matchPatterns:[/gemini[^a-z0-9]*3\.?5[^a-z0-9]*flash/i]} +"gemini-3-flash-preview":{id:"gemini-3-flash-preview",newUntil:new Date("2000-01-01T00:00:00Z"),name:"Gemini 3 Flash",shortName:"Gemini 3 Flash",provider:"google",systemPromptReminders:b,apiProviders:["google"],reasoningEffort:{supported:["minimal","low","medium","high"],default:"high"},tier:"standard",pdf:!0,contextLimits:k(1e6,65536),thinking:N(),apiRequest:v(),disabledForPilots:!1,cost:{tokenMultiplier:0.2},regionOverrides:{us:h},matchPatterns:[/gemini[^a-z0-9]*3[^a-z0-9]*flash/i]}