Skip to content

[Enhancement]: Add first-class Gemini 3.8 Flash support #15516

Description

@marlonka

What features would you like to see added?

This should be a very small/easy follow-up to the existing Gemini 3.7 Flash integration. Based on Google's documentation, Gemini 3.8 Flash does not appear to require new LibreChat-specific behavior; the main work should be registering the new model everywhere 3.7 is currently enumerated and making sure token/cache costs are tracked correctly.

Google released Gemini 3.8 Flash (gemini-3.8-flash) as a GA model on September 2, 2026.

It would be great to add first-class support for it in LibreChat for both:

  • Gemini Developer API / Google AI Studio
  • Google Cloud Gemini Enterprise Agent Platform

This should largely follow the existing Gemini 3.7 Flash integration:

24d111f

Gemini 3.8 Flash has:

  • Model ID: gemini-3.8-flash
  • 1,048,576-token context window
  • 65,536 max output tokens
  • Thinking levels: low, medium, high
  • Default thinking level: medium
  • minimal thinking is not supported and returns an API validation error
  • Text, image, video, audio, and PDF input; text output
  • Function calling, structured outputs, code execution, file search, URL context, Google Search grounding, Google Maps grounding, and Computer Use (Preview)
  • Context caching supported

More details

Since Gemini 3.7 Flash is already integrated, this should mostly be a model-registration and pricing/accounting update rather than a new integration path.

Likely changes include:

  • Add gemini-3.8-flash to the Gemini API and Google Cloud Gemini Enterprise Agent Platform GOOGLE_MODELS examples in .env.example.
  • Add it to the default Google model list in packages/data-provider/src/config.ts.
  • Add its 1,048,576-token context window to the Google model token map in packages/api/src/utils/tokens.ts.
  • Register gemini-3.8-flash alongside 3.7 Flash in the existing Gemini Flash-family handling in packages/api/src/endpoints/google/llm.ts, reusing the same thinking/parameter behavior unless testing shows a model-specific difference.
  • Add Gemini 3.8 Flash pricing/cache pricing to packages/data-schemas/src/methods/tx.ts using the same rates and dated pricing logic as Gemini 3.7 Flash so token costs are tracked correctly.
  • Add/update tests analogous to the Gemini 3.7 Flash tests.
  • Verify any other model-enumerated 3.7 entries (including @librechat/agents prefill handling) and add 3.8 only where the same behavior applies.

Pricing

Gemini 3.8 Flash uses the same pricing as Gemini 3.7 Flash, so there should be very little pricing-specific work beyond registering the new model alongside 3.7.

Standard paid pricing per 1M tokens:

Through Dec 31, 2026 Starting Jan 1, 2027
Input $0.75 $1.50
Output incl. thinking $3.75 $7.50
Cached input $0.075 $0.15

Google also lists the same matching 3.7 Flash rates for Batch/Flex ($0.375 input / $1.875 output through Dec 31, 2026) and Priority ($1.35 input / $6.75 output through Dec 31, 2026), with the corresponding Jan 1, 2027 increases.

For LibreChat's existing transaction pricing, this should therefore be able to reuse the same values / promotional-rate handling already implemented for Gemini 3.7 Flash rather than introducing any new pricing behavior.

References

Which components are impacted by your request?

  • Endpoints
  • General

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions