LibreChat/packages/data-provider/src
Danny Avila 24d111fde9
feat: Add Gemini 3.7 Flash Support (#14818)
*  feat: Add Gemini 3.7 Flash Support

Adds first-class support for Google's Gemini 3.7 Flash (`gemini-3.7-flash`)
for both the Gemini API (AI Studio) and Google Cloud Gemini Enterprise Agent
Platform, following the Gemini 3.6 Flash integration (#14369).

- Context window (1,048,576) in googleModels; API + cache pricing in tx.ts.
- Model dropdown (config.ts) and GOOGLE_MODELS examples for both integrations.
- Register the model in the Flash-family handler so it inherits the existing
  strip of deprecated sampling params (temperature/topP/topK), rejected
  penalty params, and thinkingBudget, and defaults to `medium` thinking.
- Generalize that handler's enumerated table from a [id, level] tuple to a
  rule object, so a model can also declare thinking levels it rejects. Gemini
  3.7 Flash errors on `minimal` (which the Google endpoint offers in its
  thinkingLevel slider), so an explicit `minimal` is substituted with the
  nearest supported level, `low`. Explicit low/medium/high pass through
  unchanged.
- Apply Google's introductory pricing ($0.75 in / $3.75 out / $0.075 cached,
  per 1M) to Gemini 3.7 Flash and correct Gemini 3.6 Flash to the same rates.
  Both revert to $1.50 / $7.50 / $0.15 on 2027-01-01; noted at both call sites.

Resolves #14802

Ref: https://ai.google.dev/gemini-api/docs/models/gemini-3.7-flash
Ref: https://ai.google.dev/gemini-api/docs/pricing

* 📝 docs: Match the House Style for Promotional Rate Comments

Align the Gemini 3.6/3.7 Flash introductory-pricing notes with the existing
Sonnet 5 convention in the same file: one comment per group, naming the models
and the exact values to restore, so the manual follow-up is unambiguous.

No rate changes.

* ⬆️ chore: Bump `@librechat/agents` to 3.4.7 for Gemini 3.7 Flash Prefill

Unblocks this PR. `NO_PREFILL_GEMINI_MODELS` is model-enumerated in the agents
SDK, so 3.4.6 does not know `gemini-3.7-flash` forbids a trailing `model`-role
turn — editing an assistant reply and resubmitting would reach Google as a
prefill and return HTTP 400 on a model this PR adds to the default list.

3.4.7 (danny-avila/agents#412, released via #413) adds it. Verified the
published tarball: `3.4.6...3.4.7` touches only
`dist/{cjs,esm}/llm/google/utils/common.*` — the prefill array and its comment.
`dist/types` is byte-identical, so there is no API surface change.

Raises the declared range in both workspaces alongside the lock. `^3.4.6`
already permitted 3.4.7, but the fix is required rather than merely compatible,
so the floor should say so.
2026-08-14 01:12:42 -04:00
..
react-query 🪟 fix: Surface MCP Initialization Errors (#14529) 2026-07-30 13:22:11 -04:00
types 🔖 feat: Bound Parent Activity Phases With an Exclusive End Index (#14768) 2026-08-12 23:43:35 -04:00
accessPermissions.ts
actions.ts fix: Bind Action Servers to Metadata Ports (#14575) 2026-08-02 13:41:31 -04:00
api-endpoints.ts 🪢 feat: add Langfuse session links (#14776) 2026-08-12 22:25:23 -04:00
artifacts.ts
azure.ts
balance.spec.ts
balance.ts
bedrock.ts ✳️ feat: Claude Opus 5 Support (#14422) 2026-07-24 21:45:32 -04:00
cloudfront-config.spec.ts
codeEnvRef.spec.ts
codeEnvRef.ts
config.spec.ts 🎙️ fix: Align Speech Engine Configuration With Runtime (#14736) 2026-08-12 13:22:28 -04:00
config.ts feat: Add Gemini 3.7 Flash Support (#14818) 2026-08-14 01:12:42 -04:00
createPayload.ts feat: Reliable Interrupt & Steer Escalation and Recovery (#14558) 2026-07-31 20:07:56 -04:00
data-service.ts 🪢 feat: add Langfuse session links (#14776) 2026-08-12 22:25:23 -04:00
feedback.spec.ts 🛡️ fix: validate message feedback payloads (#14500) 2026-07-28 22:17:30 -04:00
feedback.ts 🛡️ fix: validate message feedback payloads (#14500) 2026-07-28 22:17:30 -04:00
file-config.spec.ts 📎 fix: Alias Shell Script MIME Variants to application/x-sh (#14817) 2026-08-14 01:12:23 -04:00
file-config.ts 📎 fix: Alias Shell Script MIME Variants to application/x-sh (#14817) 2026-08-14 01:12:23 -04:00
generate.ts
headers-helpers.ts
index.ts
keys.ts 🪢 feat: add Langfuse session links (#14776) 2026-08-12 22:25:23 -04:00
limits.ts
mcp.ts 🔌 feat: Add Agent Plugins (Experimental) (#14704) 2026-08-09 08:10:22 -04:00
messages.spec.ts 🪺 fix: Keep Preempt-Abandoned Siblings Nested, Make Message Tree Order-Robust (#14587) 2026-08-02 07:04:52 -04:00
messages.ts 🪺 fix: Keep Preempt-Abandoned Siblings Nested, Make Message Tree Order-Robust (#14587) 2026-08-02 07:04:52 -04:00
models.ts 🧵 feat: Background-Native Code Execution Tools (#14532) 2026-07-30 17:53:47 -04:00
parameterSettings.spec.ts
parameterSettings.ts 🧠 feat: Add GPT-5.6 reasoning.mode + reasoning.context (Responses API) (#14233) 2026-07-13 09:52:42 -04:00
parsers.ts 🧭 feat: Mid-Run Steering and Queued Messages for Agent Runs (#14220) 2026-07-14 10:11:10 -04:00
permissions.ts
request.ts 🛟 fix: Keep File Uploads Alive With SSE Heartbeats (#14295) 2026-07-21 19:27:09 -04:00
roles.spec.ts
roles.ts
schemas.spec.ts 🧠 feat: Add GPT-5.6 reasoning.mode + reasoning.context (Responses API) (#14233) 2026-07-13 09:52:42 -04:00
schemas.ts 🔗 feat: Shared Conversation Badge and Stable Share Links (#14712) 2026-08-09 08:14:54 -04:00
splitMCPToolKey.spec.ts 🔗 fix: Normalize MCP Tool Keys at Every Producer, Resolve Raw Names via Aliases (#14553) 2026-08-01 07:39:24 -04:00
types.ts 🔖 feat: Bound Parent Activity Phases With an Exclusive End Index (#14768) 2026-08-12 23:43:35 -04:00
upload.spec.ts 🛟 fix: Keep File Uploads Alive With SSE Heartbeats (#14295) 2026-07-21 19:27:09 -04:00
upload.ts 🛟 fix: Keep File Uploads Alive With SSE Heartbeats (#14295) 2026-07-21 19:27:09 -04:00
utils.ts