Skip to content

⚡ feat: Add Gemini 3.5 Flash Support#13231

Merged
danny-avila merged 4 commits into
devfrom
danny-avila/gemini-3-5-flash
May 21, 2026
Merged

⚡ feat: Add Gemini 3.5 Flash Support#13231
danny-avila merged 4 commits into
devfrom
danny-avila/gemini-3-5-flash

Conversation

@danny-avila

Copy link
Copy Markdown
Owner

Summary

I added native Google/Vertex support for Gemini 3.5 Flash and wired its model metadata, request defaults, and pricing behavior.

  • Added gemini-3.5-flash to the default Google model list.
  • Set Gemini 3.5 Flash context metadata to 1,048,576 tokens and raised Google max output configuration to 65,536 tokens.
  • Defaulted Gemini 3.5 Flash requests to MEDIUM thinking level while preserving explicit thinking levels.
  • Removed legacy sampling and thinking-budget parameters from native Gemini 3.5 Flash request config.
  • Added token pricing, cache pricing, and focused regression tests for model matching and request shaping.

Closes #13199

Change Type

  • New feature (non-breaking change which adds functionality)

Testing

  • npm run build:data-provider
  • npm run build:data-schemas
  • npm run build:api
  • cd packages/api && npx jest src/endpoints/google/llm.spec.ts --runInBand --coverage=false
  • cd packages/data-schemas && npx jest src/methods/tx.spec.ts --runInBand --coverage=false
  • cd api && npx jest utils/tokens.spec.js --runInBand --coverage=false
  • npx prettier --check packages/api/src/endpoints/google/llm.ts packages/api/src/endpoints/google/llm.spec.ts packages/api/src/utils/tokens.ts api/utils/tokens.spec.js packages/data-provider/src/config.ts packages/data-provider/src/schemas.ts packages/data-schemas/src/methods/tx.ts packages/data-schemas/src/methods/tx.spec.ts

Test Configuration:

  • Node.js v20.19.5
  • macOS local worktree

Checklist

  • My code adheres to this project's style guidelines
  • I have performed a self-review of my own code
  • My changes do not introduce new warnings
  • I have written tests demonstrating that my changes are effective or that my feature works
  • Local unit tests pass with my changes

Copilot AI review requested due to automatic review settings May 21, 2026 15:35

Copy link
Copy Markdown
Owner Author

@codex review

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds first-class support for the gemini-3.5-flash model across LibreChat’s Google/Vertex integration, including token limits, request shaping (thinking defaults + legacy param removal), and pricing.

Changes:

  • Registers gemini-3.5-flash in default Google model lists and token-limit metadata (1,048,576 context; Google max output up to 65,536).
  • Applies Gemini 3.5 Flash–specific request overrides: default thinkingLevel=MEDIUM (when thinking enabled) and strips legacy sampling/thinking-budget params.
  • Extends token + cache pricing tables and adds targeted regression tests for pricing, model matching, and config shaping.

Reviewed changes

Copilot reviewed 8 out of 8 changed files in this pull request and generated no comments.

Show a summary per file
File Description
packages/data-schemas/src/methods/tx.ts Adds Gemini 3.5 Flash token + cache pricing entries.
packages/data-schemas/src/methods/tx.spec.ts Verifies Gemini 3.5 Flash pricing and model-key mapping behavior.
packages/data-provider/src/schemas.ts Raises Google maxOutputTokens.max to 65,536 for UI/validation alignment.
packages/data-provider/src/config.ts Adds gemini-3.5-flash to default Google model list.
packages/api/src/utils/tokens.ts Adds max-context token metadata for Gemini 3.5 Flash (1,048,576).
packages/api/src/endpoints/google/llm.ts Implements Gemini 3.5 Flash overrides (default thinking level + legacy param stripping).
packages/api/src/endpoints/google/llm.spec.ts Adds tests for default/preserved thinking level and legacy param removal.
api/utils/tokens.spec.js Adds max-token lookup assertion for gemini-3.5-flash.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 875556dc35

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread packages/api/src/endpoints/google/llm.ts Outdated
Comment thread packages/api/src/endpoints/google/llm.ts
Comment thread packages/api/src/endpoints/google/llm.ts Outdated
@github-actions

Copy link
Copy Markdown
Contributor

GitNexus: 🚀 deployed

The LibreChat-pr-13231 index is now live on the MCP server.
Deploy run

Copy link
Copy Markdown
Owner Author

@codex review

@danny-avila

Copy link
Copy Markdown
Owner Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 2dee4c2fdd

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread packages/api/src/endpoints/google/llm.ts
@danny-avila

Copy link
Copy Markdown
Owner Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Chef's kiss.

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@github-actions

Copy link
Copy Markdown
Contributor

GitNexus: 🚀 deployed

The LibreChat-pr-13231 index is now live on the MCP server.
Deploy run

@danny-avila danny-avila marked this pull request as ready for review May 21, 2026 17:51
@danny-avila danny-avila changed the base branch from main to dev May 21, 2026 18:18
@danny-avila danny-avila merged commit 12a4412 into dev May 21, 2026
17 checks passed
@danny-avila danny-avila deleted the danny-avila/gemini-3-5-flash branch May 21, 2026 18:18
fuuuzzy pushed a commit to fuuuzzy/LibreChat that referenced this pull request May 22, 2026
* feat: add Gemini 3.5 Flash support

* fix: refine Gemini 3.5 Flash overrides

* fix: satisfy Gemini thinking config types

* fix: drop empty Gemini thinking config
Gevtolev pushed a commit to Gevtolev/LibreChat that referenced this pull request May 27, 2026
Range: 8310e9a..190cdee

Highlights:
- Security: MCP OAuth hardening (danny-avila#13264, danny-avila#13274, danny-avila#13276, danny-avila#13254, danny-avila#13256),
  SSRF guards, system tenant rejection (danny-avila#13278), data retention semantics (danny-avila#13049)
- LLM: Gemini 3.5 Flash (danny-avila#13231), Gemini Tool Combinations (danny-avila#13273),
  AWS Bedrock API key support (danny-avila#8690) [pending removal in stage-1]
- Streaming/UI: cache preservation, race fixes, optimistic sidebar (danny-avila#13298)
- Observability: Prometheus metrics (danny-avila#13265), OTel SSE tracing (danny-avila#13266),
  build metadata (danny-avila#12756)
- Infra: graceful shutdown (danny-avila#13211), readiness endpoints (danny-avila#13212),
  Redis cluster safe delete (danny-avila#13275)
- CI/format: prettier --write all workspaces (danny-avila#13281), ESLint enforcement (danny-avila#13280)
- Deps: @librechat/agents -> v3.1.96
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Enhancement]: Support for Gemini 3.5 Flash Model (gemini-3.5-flash)

2 participants