Repository navigation
💠 feat: Add Gemini 4 Argon Support - #17200
Conversation
|
Lighthouse CI failed. The last 80 log lines contain the measured budgets and assertion failures. |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 19570afb3a
ℹ️ 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".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 706983a3d6
ℹ️ 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".
0cf1ea8 to
381b92e
Compare
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 381b92e3dd
ℹ️ 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".
Registers gemini-4-argon (GA 2026-10-13) for both the Gemini API and Google Cloud Gemini Enterprise Agent Platform, following the Gemini 3.8 Flash integration. - Model dropdown (config.ts) and both GOOGLE_MODELS examples - Shared 1,048,576-token context window in googleModels; output stays capped at the 65,535 synchronous limit by googleSettings - Thinking rule: medium default, minimal substituted with low, ignored sampling params and rejected thinkingBudget stripped; the allowlisted cyber-permissive variant defaults to high - Introductory rates ($2 in / $10 out / $0.10 implicit cache read per 1M) with the 2026-12-01 revert to $4 / $20 / $0.20 noted at both call sites; no long-context premium tier - Tests: thinking default and levels, minimal substitution, legacy param strip, Vertex eu multi-region, OpenAI-compatible addParams strip, context window, value key and rates Refs #17074
Adds a Gemini-compatible mock endpoint whose addParams carry sampling params, an E2E_REPORT_LLM_CONFIG fake-model marker that reports the resolved agent request, and scenarios asserting that an Argon turn sends no ignored sampling params (with gemini-2.5-pro as the control) and is billed at the Argon rates.
The hook's agents are the unresolved agent configs, so the report now reads the graph's agent context. The scenarios select the Gemini model explicitly and key billed rates by model so a mismatch names the model.
Argon is served only from the global, us and eu multi-regions, so with GOOGLE_LOC unset a Vertex request now uses global instead of the us-central1 regional default; a configured location is kept as is. Argon also rejects a candidate count, so candidateCount, candidate_count and its OpenAI alias n are stripped for Argon on the native and Gemini-compatible paths.
…4 Argon A configured regional location such as europe-west1 does not serve Argon, so it now resolves to the multi-region that contains it (europe-* to eu, us-* to us) wherever the location comes from, GOOGLE_LOC or addParams. A region outside us and eu is kept rather than sent to global, so data never leaves the configured geography silently.
381b92e to
68166e8
Compare
Pull Request
Summary
Google released Gemini 4 Argon (
gemini-4-argon) as GA on 2026-10-13 for both the Gemini API and Google Cloud Gemini Enterprise Agent Platform. LibreChat had no entry for it: the model was missing from the default Google list, its usage was priced at the genericgeminifallback ($0.50 / $1.50 per 1M, a 4-7x under-count), and requests could still carryminimalthinking andthinkingBudget, which Argon rejects with HTTP 400.This registers Argon the way the Gemini 3.8 Flash integration (#15519) did: in the default model list and both
GOOGLE_MODELSexamples, with the shared 1,048,576-token context window, the Flash-family request rule (defaultmediumthinking,minimalsubstituted withlow, ignored sampling params andthinkingBudgetstripped), and the introductory rates of $2 input / $10 output / $0.10 implicitly cached input per 1M, with the 2026-12-01 change to $4 / $20 / $0.20 noted at both call sites. The allowlistedgemini-4-argon-cyber-permissivevariant defaults tohigh, as Google documents. Argon also rejects a candidate count, socandidateCount,candidate_countand the OpenAI aliasnare stripped for it. On Vertex, Argon is served only from theglobal,usandeumulti-regions, so withGOOGLE_LOCunset it now usesglobalinstead of theus-central1default, and a configured regional location moves to the multi-region that contains it (europe-*toeu,us-*tous). A configured multi-region, includingeu, is kept as is, and a region outsideusandeuis never moved toglobal. Output stays at the 65,535 synchronous cap, so the shared 1M window leaves a positive input budget. Long decode beyond 64K is out of scope, as the issue allows.Related to #17074
Depends on LibreChat-AI/agents#620, which lets Argon take image, audio, video and PDF input on the Gemini API client and drops a trailing model turn that Argon rejects. This PR bumps
@librechat/agentsonce that is released.Type of change
Testing
Tested environments/configuration:
GOOGLE_LOC=eu,gemini-4-argonAutomated tests:
packages/api:google/llm.spec.ts,utils/tokens.spec.ts,openai/config.google.spec.ts(224 passed), covering the thinking default, explicit levels,minimalsubstitution, legacy and sampling param removal, the cyber-permissive default, theeumulti-region endpoint on Vertex, theglobaldefault whenGOOGLE_LOCis unset, regional-to-multi-region resolution fromGOOGLE_LOCandaddParams, the candidate-count strip, and the OpenAI-compatibleaddParamsstrippackages/data-schemas:tx.spec.ts(290 passed), covering the value key, rates, cache rates and the absence of a long-context tierapi/utils/tokens.spec.js(185 passed)e2e/specs/mock/scenarios/gemini-argon.spec.ts(desktop light, desktop dark, mobile): a Gemini-compatible gateway whoseaddParamscarry sampling values sends none of them forgemini-4-argonwhilegemini-2.5-prokeeps them, the context budget stays positive, and an Argon turn is recorded at the $2 / $10 ratesnpx tsc --noEmitinpackages/api,packages/data-schemasandpackages/data-providerScreenshots / recordings
No layout or styling change;
gemini-4-argonis a new entry in the Google model list.Risk / compatibility
The December 1 price change is a comment, matching the existing Flash entries, so
tx.tsneeds its rates updated on that date.Checklist