Repository navigation
feat(gemini)!: judge Gemini models the map has no sampling flag for by the version in their name - #47684
feat(gemini)!: judge Gemini models the map has no sampling flag for by the version in their name#47684ryan-crabbe-berri wants to merge 8 commits into
Conversation
…y the version in their name Google ignores temperature, top_p and top_k on Gemini 3.6 Flash, 3.5 Flash-Lite and every later model. The model map carries supports_sampling_params: false for the rows we know about, but a chat row without the flag, or a model newer than the map, kept forwarding the knobs silently. When no row answers, read the version out of the model name and apply the same drop-or-400 contract. A row whose mode is not chat keeps forwarding, since the notice covers the text models. gemini-4-argon has a chat row without the flag, so it now drops the knobs under drop_params and returns the 400 naming drop_params without it, like the flagged rows.
|
@greptileai review |
|
bugbot run |
[Medium impact] The PR changes sampling-parameter behavior across Google Gemini calls and Vertex batch uploads. Fix the existing test callers before merging Findings
SummaryThe PR adds a model-map rule that rejects or drops sampling settings for newer Gemini text models while preserving explicit flags. The latest change makes Vertex batch rows use the deployment's model and removes Google provider prefixes Existing tests still call The earlier unnumbered live-check finding is addressed by the supplied Messages, Responses, and Vertex batch runs
Reviews (4) · Last reviewed commit: "fix(vertex_ai): gate a batch row's sampl..." · Reviewed by Greptile |
Merging this PR will not alter performance1 warning
Comparing Footnotes |
…le too The proxy registers a batch deployment's model_info onto the backend model's map row, so vertex_ai/gemini-4-argon carried mode: batch on a batch proxy and the version rule treated it as a non-chat row and kept forwarding the knobs. A live upload on the PR tip stored temperature, top_p and top_k in the bucket on both legs. Batch rows are chat requests, so a batch row is judged by the version like a chat row, and the batch transformation now has the regression
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
…on rule never set A model judged by its version has no supports_sampling_params flag in the map, so the batch and top_k rejection said something a reader could not find. The message now says Google ignores the knobs and names both escape hatches
|
@greptileai re review |
|
bugbot run |
…rule The hand-rolled version regex and raw model map lookup in the Vertex config move into a gemini-sampling-params-ignored rule in the model map. The rule fills supports_sampling_params false onto Google rows that lack the flag and resolves unmapped Gemini 3.6+, 3.5 flash-lite and 4+ ids, while an explicit flag on a row still wins The Gemini and Vertex configs now read the flag through the shared tri-state reader for their own route, so a batch deployment whose stamped row says mode batch is judged by the same rule as a chat row. Fill-missing backfill now also covers rows whose mode is batch and rows without a litellm_provider, and get_model_info returns supports_sampling_params
|
@greptileai re review |
|
bugbot run |
…b runs on A batch file row whose model kept a gemini/ prefix, copied from an AI Studio call, was looked up under that prefix on the Vertex route. The AI Studio row exists, so the provider check rejected it and the fallback rule never ran, the lookup raised, and the reader fell open: temperature, top_p and top_k were stored even under drop_params. The row runs on the deployment's Vertex model either way, which the stored GCS path already binds it to, so the row is now shaped and gated for that model, falling back to its own id only for a direct SDK upload that names no deployment, with the Google namespace stripped the way a live call strips it
|
@greptileai re review |
|
bugbot run |
…ng_version_fallback # Conflicts: # litellm/llms/vertex_ai/files/transformation.py
…pling knobs A batch deployment with `litellm_params: drop_params: true` still rejected rows that carried temperature, top_p or top_k for a Gemini model flagged `supports_sampling_params: false`, because the batch mapper passed `drop_params=False` to the rejection check while the live chat path reads the deployment's drop_params. Both gates now read the same flag, so the knobs are dropped instead of the upload failing with a 400 The upload stream's `deployment_model` argument defaults to None again, so the two-argument callers (direct SDK uploads and the existing batch tests) keep working, and a row whose body.model is missing or not a string is still reported as a 400 naming the line when the deployment names no model
… deployment isolation test supports_sampling_params became a cost-map schema field in #47645, so the router writes a deployment's value onto the shared backend row the same way it does supports_vision and friends. That shared row is the only place the Gemini sampling check reads the per-deployment escape hatch from, so the flag is not deployment-scoped like supports_regex_lookaround and supports_assistant_prefill are. The case only passed before because get_model_info never emitted the field, and this branch now surfaces it, so the parametrization is reduced to the flags that really stay on the deployment that set them
|
@greptileai re review |
|
bugbot run |
There was a problem hiding this comment.
✅ Bugbot reviewed your changes and found no new issues!
Comment @cursor review or bugbot run to trigger another review on this PR
Reviewed by Cursor Bugbot for commit 1c9304a. Configure here.
| } | ||
| }, | ||
| { | ||
| "name": "gemini-sampling-params-ignored", |
There was a problem hiding this comment.
Non-blocking, gemini-flash-latest and gemini-flash-lite-latest cost the same as 3.6 Flash and 3.5 Flash-Lite yet still forward the knobs, so i'd flag both rows
|
|
||
|
|
||
| @pytest.mark.parametrize("flag", ["supports_regex_lookaround", "supports_assistant_prefill", "supports_sampling_params"]) | ||
| @pytest.mark.parametrize("flag", ["supports_regex_lookaround", "supports_assistant_prefill"]) |
There was a problem hiding this comment.
Non-blocking, i'd scope supports_sampling_params per deployment in a follow-up, reading deployment_model_info like bedrock_model_supports_regex_lookaround, since the 400 now points users there
|
Update, spend-logs-guard ran on my review and passed, so there's no need to merge main in |
#47645 taught LiteLLM to drop temperature, top_p and top_k for the Gemini models Google says ignore them, or to return a clear 400 without drop_params, but only for the model map rows someone flagged by hand. A Gemini model newer than the map, or a chat row nobody flagged like gemini-4-argon, still forwarded the knobs and came back 200 looking like it worked. Now the model map ships a rule that marks Gemini 3.6 Flash, 3.5 Flash-Lite and everything later as ignoring the knobs, LiteLLM fills it onto the Google rows nobody flagged and onto names the map has never seen, and the same contract applies, so a new Gemini release behaves right the day it appears and an explicit flag on a row still wins
Details
TLDR
Intentional product change: gemini-4-argon on AI Studio and Vertex, plus the cyber-permissive Vertex variant, now drops the knobs under drop_params and returns a 400 without it, where before the knobs were forwarded and Google ignored them. Any future Gemini name at 3.6 or later gets the same treatment before the model map catches up. Callers who want temperature and top_p forwarded anyway list them in allowed_openai_params, or set
supports_sampling_params: truein the deployment's model_info, which the map then honors as an explicit flagThe second commit came out of the live batch run. The proxy registers a batch deployment's
model_infoonto the backend model's map row, so on a batch proxy the gemini-4-argon row readmode: batch, the first cut treated that as a non-chat row and kept forwarding, and the uploaded row still carried the knobs. A batch row is a chat request, so a row stampedmode: batchis now judged by the version like a chat row. The third commit rewords the 400 that the batch upload and a lone top_k get, since it claimed a model map flag that a version-judged model does not have, and it now names both escape hatchesThe fourth commit moves the version cut out of the Vertex code and into the model map as a fallback generalization rule, the same mechanism the Claude and Gemini chat baselines already use, so the Gemini and Vertex configs read the sampling flag for their own route the same way the Anthropic and Bedrock configs do. Along the way fill-missing backfill now also covers rows whose mode is batch and rows without a provider, and get_model_info returns the sampling flag
The fifth commit fixes a Bugbot finding on the fourth. A batch row whose model id kept a
gemini/prefix, say copied from an AI Studio call, was looked up under that prefix on the Vertex route. The AI Studio row exists, so the provider check rejected it, the rule never ran, the lookup raised and the reader fell open, storing the knobs even under drop_params. A batch row runs on the deployment's Vertex model whatever id it was written with, and the stored GCS path already binds it to that model, so the row is now shaped and gated for the deployment's model. A direct SDK upload names no deployment, so there the row's own id is used with itsgemini/orvertex_ai/namespace stripped, the way a live call strips itMain was then merged in (b2dddd4). It brought #31915's per-deployment drop_params for batch rows into the same mapper, and the sixth commit closes the gap that left. A batch deployment with
drop_params: truein its litellm_params still refused a row carrying the knobs for a flagged model, because the batch rejection check was hard-wired to the no-drop path while the live chat path reads the deployment's setting. Both now read the same setting, so such a deployment drops the knobs instead of failing the upload. The same commit gives the upload stream's deployment model a default again, which Greptile caught breaking the two-argument callers, and keeps a row whose body.model is missing or not a string failing as a 400 that names the line when the deployment names no modelThe seventh commit trims the deployment isolation test.
supports_sampling_paramsbecame a model map schema field in #47645, so the Router copies a deployment's value onto the shared backend row the same way it copies supports_vision, and that shared row is where the Gemini check reads the per-deployment escape hatch from. The test's third case claimed the flag stays on the deployment that set it, and it only passed because get_model_info never returned the field. This PR returns it, so the case is dropped and the behavior is listed under CaveatsUser Flow
Before: a developer tuning a gemini-4-argon app through the proxy sets temperature 0 and gets a 200, but Google ignored the setting and the answers stay random
"model": "gemini/gemini-4-argon","temperature": 0,"top_p": 0.9and"top_k": 20"drop_params": trueAfter: the same request comes back with a clear 400 naming drop_params, and with drop_params on the knobs are stripped before the call
"model": "gemini/gemini-4-argon","temperature": 0,"top_p": 0.9and"top_k": 20litellm.drop_params=True...""drop_params": trueto the request, or the proxy admin turns it on in the config, and resendRelevant issues
Follow-up to #47645, refs #47015
Pre-Submission checklist
Please complete all items before asking a LiteLLM maintainer to review your PR
uv run pytest tests/unit/<your_test_file>.py -v. Leave the suites (make test-unit-*,make test-unit) to CI: it finishes in ~15 minutes where a laptop takes an hour or moreDelays in PR merge?
If you're seeing a delay in your PR being merged, ping the LiteLLM Team on Slack (#pr-review).
Screenshots / Proof of Fix
Both legs run the same proxy config against real Vertex AI (project
vertex-check-481318, locationglobal), so every 200 below is a paid Google call. Before is a git archive of the merge base on main, After is a git archive of the PR tip for the chat, Messages, Responses and AI Studio cases, each started withpython litellm/proxy/proxy_cli.py --config qa_fallback_vertex_config.yaml --port <port> --num_workers 2 --detailed_debugandLITELLM_LOCAL_MODEL_COST_MAP=Trueso the model map in the tree is the one in effect. gemini-4-argon is a real model whose model map rows carry nosupports_sampling_paramsflag on either leg, so the only thing that differs between the legs is the rule. The wire lines quoted under each case are thePOST Request Sent from LiteLLMentries from that proxy's debug log, which show exactly what reached GoogleEach leg runs the chat completions cases first, then the same request through
/v1/messagesand/v1/responses, which the proxy bridges into the same Gemini call, then one AI Studio case. Every case is one curl with the master key. The response is piped through a small filter that prints the id, model, text and finish reason of a success, or the error object of a failure, followed by the HTTP statusThe AI Studio case sends the knobs to gemini/gemini-4-argon without drop_params. Its Before run was captured against the same merge base while an AI Studio key was on the QA machine, and its After run needs no key because the 400 is returned before anything is sent to Google. No AI Studio key was reachable from the QA machine for this re-run, so the drop_params path is shown live on Vertex only, and the AI Studio route, which goes through the same Gemini config, is covered by the unit tests
The four batch cases at the end of each leg run the same trees against a second config that holds one batch deployment for Vertex AI pointed at gemini-4-argon and at the real GCS bucket the e2e suite uses (
litellm-e2e-vertex-batchin the same project) with that suite's service account key asvertex_credentials, once as written below and once withlitellm_settings: drop_params: trueadded. Two rows go through each, one whose model is written as vertex_ai/gemini-4-argon and one that keeps the AI Studio id gemini/gemini-4-argon, as a row copied from an AI Studio batch file would. Each row is uploaded withPOST /v1/files?model=vertex-batchandpurpose=batch, and when the upload succeeds the stored row is read back withGET /v1/files/<id>/content, which returns the converted Vertex rows exactly as they sit in the bucket. The After batch cases were captured at c2c76fc, the tip before main was merged in. The commits since then touch the batch path only for a deployment that setsdrop_params: truein its own litellm_params, which a unit test covers, and the bucket credentials were not reachable from the QA machine when the chat cases were re-run at the tip, so the batch leg was not repeatedBefore (49b5444)
vertex_ai/gemini-4-argon, sampling knobs, no drop_params
{ "id": "SmndavnhM6Gb4_UPuYGTwAc", "model": "vertex_ai/gemini-4-argon", "content": "Blue", "finish_reason": "stop" } HTTP 200vertex_ai/gemini-4-argon, sampling knobs, drop_params true
{ "id": "Tmndavq_A9CQ4_UP9varoQ8", "model": "vertex_ai/gemini-4-argon", "content": "Blue", "finish_reason": "stop" } HTTP 200control: vertex_ai/gemini-3.5-flash keeps the knobs, no drop_params
{ "id": "UWndauuoH-iQ4_UP7vfF6Ag", "model": "vertex_ai/gemini-3.5-flash", "content": "Blue", "finish_reason": "stop" } HTTP 200POST /v1/messages, vertex_ai/gemini-4-argon, sampling knobs, no drop_params
{ "id": "xWzdaqekHeiQ4_UP7vfF6Ag", "model": "vertex_ai/gemini-4-argon", "text": "Blue", "stop_reason": "end_turn" } HTTP 200POST /v1/messages, vertex_ai/gemini-4-argon, sampling knobs, drop_params true
{ "id": "yGzdarCBGd6Y4_UPhPjhuQM", "model": "vertex_ai/gemini-4-argon", "text": "Blue", "stop_reason": "end_turn" } HTTP 200POST /v1/responses, vertex_ai/gemini-4-argon, sampling knobs, no drop_params
{ "id": "resp_tXmD7wVuOtSVUv_5TqS9HP_rk09-qWtlAudz9jqdF9HEWw_hiLk6VyckgJQiOHdytZtfaQb3t-n0YG6epxgadc1SIsFMNbH7BpONjzPmv95S5IcnZqQFYufW1RFNiYOpor6F8P13M9SQGKkPFMdA43RX5Ks87TXgnVjA3rRVu6XRughc37IR5vZIk0rB888cubuVeoP64o9vNJ_RnWuKmRJy6edGwjrJg2XQER1K3v1_flCexhFTD7Ikah5IkntPtGIfw7XUYKreGmK0JL3iY39hd7bh89SfcGZLphqZUWHW_ftjDr25bUFZBQRRHlLJE7lCDykcxejVOIwo5J8iRhzj9uPyjtkWrtGXXA_GqeKJ3JWs_2dHvxGOgmwiz-cLIIImD6BhgM4wZqUrxFTpEugPyN58P_q1lH8=", "model": "vertex_ai/gemini-4-argon", "output_text": "Blue", "status": "completed" } HTTP 200POST /v1/responses, vertex_ai/gemini-4-argon, sampling knobs, drop_params true
{ "id": "resp_9Eq64joy8f2kKqnQ891LcOcjqB9qUY1ZpxZNuMzYMffw-ygUO86MyB6PJiwtAxZ_LDj6oJUZjUmHzhqjjxxbEqoUIknYBTKVOAYZLXO-ul-JSBytizFg-_yp_jXxxtEzkAfih_cr5kH_2S5UrX6aA1hIfELq1XYIpurGlSO8ZOg8Inm6lSAukcLMBrG_5saR5FIEl84HgM8mSym-950qHTZalRu9ToGy-bcLPn3YJgqjz4OBLYX3pnKAbwj4wFdlbgcvjOIVhqX31TdGzBP8xKKDw_mra9cKXGaj_Bb1HzsHZV11MPMVBTz-SRCSBzMOCodVyunBncnbNiy9HQxdS-jjulWSJ6g4UQaxNj4MtnLHfgD9SoZBGE3lvZ6nyuAMkQv0rcRcdG2s0Oc7wSM_Xio-L8ke7VMVhg0=", "model": "vertex_ai/gemini-4-argon", "output_text": "Blue", "status": "completed" } HTTP 200gemini/gemini-4-argon (AI Studio), sampling knobs, no drop_params
{ "id": "qP_XaqOLBeLj_uMPouTMkA4", "model": "gemini/gemini-4-argon", "content": "Blue", "finish_reason": "stop" } HTTP 200POST /v1/files purpose=batch, vertex_ai/gemini-4-argon row with sampling knobs, no drop_params
cat batch_row_argon.jsonl {"custom_id": "req-1", "method": "POST", "url": "/v1/chat/completions", "body": {"model": "vertex_ai/gemini-4-argon", "messages": [{"role": "user", "content": "Name one color. One word."}], "max_tokens": 8, "temperature": 0, "top_p": 0.9, "top_k": 20}} curl -s 'http://localhost:4652/v1/files?model=vertex-batch' -H 'Authorization: Bearer sk-qa-1234' -F purpose=batch -F file=@batch_row_argon.jsonl -w '\nHTTP %{http_code}\n'{"id":"file-bGl0ZWxsbTpnczovL2xpdGVsbG0tZTJlLXZlcnRleC1iYXRjaC9saXRlbGxtLXZlcnRleC1maWxlcy9wdWJsaXNoZXJzL2dvb2dsZS9tb2RlbHMvZ2VtaW5pLTQtYXJnb24vMjYzNzlhMmUtYzg5Yi00YjBjLTk0ZDEtY2Y4MjE2OWU0MzgzO21vZGVsLHZlcnRleC1iYXRjaA","bytes":269,"created_at":1792541343,"filename":"litellm-vertex-files/publishers/google/models/gemini-4-argon/26379a2e-c89b-4b0c-94d1-cf82169e4383","object":"file","purpose":"batch","status":"uploaded","expires_at":null,"status_details":null} HTTP 200curl -s http://localhost:4652/v1/files/file-bGl0ZWxsbTpnczovL2xpdGVsbG0tZTJlLXZlcnRleC1iYXRjaC9saXRlbGxtLXZlcnRleC1maWxlcy9wdWJsaXNoZXJzL2dvb2dsZS9tb2RlbHMvZ2VtaW5pLTQtYXJnb24vMjYzNzlhMmUtYzg5Yi00YjBjLTk0ZDEtY2Y4MjE2OWU0MzgzO21vZGVsLHZlcnRleC1iYXRjaA/content -H 'Authorization: Bearer sk-qa-1234'{"request": {"contents": [{"role": "user", "parts": [{"text": "Name one color. One word."}]}], "generationConfig": {"max_output_tokens": 8, "temperature": 0, "top_p": 0.9, "top_k": 20}, "labels": {"litellm_custom_id": "req-1", "litellm_custom_id_raw": "b32_ojsxcljr"}}}POST /v1/files purpose=batch, vertex_ai/gemini-4-argon row with sampling knobs, drop_params true in litellm_settings
cat batch_row_argon.jsonl {"custom_id": "req-1", "method": "POST", "url": "/v1/chat/completions", "body": {"model": "vertex_ai/gemini-4-argon", "messages": [{"role": "user", "content": "Name one color. One word."}], "max_tokens": 8, "temperature": 0, "top_p": 0.9, "top_k": 20}} curl -s 'http://localhost:4653/v1/files?model=vertex-batch' -H 'Authorization: Bearer sk-qa-1234' -F purpose=batch -F file=@batch_row_argon.jsonl -w '\nHTTP %{http_code}\n'{"id":"file-bGl0ZWxsbTpnczovL2xpdGVsbG0tZTJlLXZlcnRleC1iYXRjaC9saXRlbGxtLXZlcnRleC1maWxlcy9wdWJsaXNoZXJzL2dvb2dsZS9tb2RlbHMvZ2VtaW5pLTQtYXJnb24vMTg5Njc0NzAtYTdjOC00MDM0LTlmZWUtOWE0NmE1MjVjMzg5O21vZGVsLHZlcnRleC1iYXRjaA","bytes":269,"created_at":1792541344,"filename":"litellm-vertex-files/publishers/google/models/gemini-4-argon/18967470-a7c8-4034-9fee-9a46a525c389","object":"file","purpose":"batch","status":"uploaded","expires_at":null,"status_details":null} HTTP 200curl -s http://localhost:4653/v1/files/file-bGl0ZWxsbTpnczovL2xpdGVsbG0tZTJlLXZlcnRleC1iYXRjaC9saXRlbGxtLXZlcnRleC1maWxlcy9wdWJsaXNoZXJzL2dvb2dsZS9tb2RlbHMvZ2VtaW5pLTQtYXJnb24vMTg5Njc0NzAtYTdjOC00MDM0LTlmZWUtOWE0NmE1MjVjMzg5O21vZGVsLHZlcnRleC1iYXRjaA/content -H 'Authorization: Bearer sk-qa-1234'{"request": {"contents": [{"role": "user", "parts": [{"text": "Name one color. One word."}]}], "generationConfig": {"max_output_tokens": 8, "temperature": 0, "top_p": 0.9, "top_k": 20}, "labels": {"litellm_custom_id": "req-1", "litellm_custom_id_raw": "b32_ojsxcljr"}}}batch upload, row written as gemini/gemini-4-argon through the Vertex batch deployment, no drop_params
cat batch_row_argon_gemini_prefix.jsonl {"custom_id": "req-1", "method": "POST", "url": "/v1/chat/completions", "body": {"model": "gemini/gemini-4-argon", "messages": [{"role": "user", "content": "Name one color. One word."}], "max_tokens": 8, "temperature": 0, "top_p": 0.9, "top_k": 20}} curl -s 'http://localhost:4670/v1/files?model=vertex-batch' -H 'Authorization: Bearer sk-qa-1234' -F purpose=batch -F file=@batch_row_argon_gemini_prefix.jsonl -w '\nHTTP %{http_code}\n'{"id":"file-bGl0ZWxsbTpnczovL2xpdGVsbG0tZTJlLXZlcnRleC1iYXRjaC9saXRlbGxtLXZlcnRleC1maWxlcy9wdWJsaXNoZXJzL2dvb2dsZS9tb2RlbHMvZ2VtaW5pLTQtYXJnb24vZmE3NjNkNDQtNzhhNy00Yzc1LTgxYjYtNmIzMzdkNTNhMjQwO21vZGVsLHZlcnRleC1iYXRjaA","bytes":269,"created_at":1792892478,"filename":"litellm-vertex-files/publishers/google/models/gemini-4-argon/fa763d44-78a7-4c75-81b6-6b337d53a240","object":"file","purpose":"batch","status":"uploaded","expires_at":null,"status_details":null} HTTP 200curl -s http://localhost:4670/v1/files/file-bGl0ZWxsbTpnczovL2xpdGVsbG0tZTJlLXZlcnRleC1iYXRjaC9saXRlbGxtLXZlcnRleC1maWxlcy9wdWJsaXNoZXJzL2dvb2dsZS9tb2RlbHMvZ2VtaW5pLTQtYXJnb24vZmE3NjNkNDQtNzhhNy00Yzc1LTgxYjYtNmIzMzdkNTNhMjQwO21vZGVsLHZlcnRleC1iYXRjaA/content -H 'Authorization: Bearer sk-qa-1234'{"request": {"contents": [{"role": "user", "parts": [{"text": "Name one color. One word."}]}], "generationConfig": {"max_output_tokens": 8, "temperature": 0, "top_p": 0.9, "top_k": 20}, "labels": {"litellm_custom_id": "req-1", "litellm_custom_id_raw": "b32_ojsxcljr"}}}batch upload, row written as gemini/gemini-4-argon through the Vertex batch deployment, drop_params true
cat batch_row_argon_gemini_prefix.jsonl {"custom_id": "req-1", "method": "POST", "url": "/v1/chat/completions", "body": {"model": "gemini/gemini-4-argon", "messages": [{"role": "user", "content": "Name one color. One word."}], "max_tokens": 8, "temperature": 0, "top_p": 0.9, "top_k": 20}} curl -s 'http://localhost:4671/v1/files?model=vertex-batch' -H 'Authorization: Bearer sk-qa-1234' -F purpose=batch -F file=@batch_row_argon_gemini_prefix.jsonl -w '\nHTTP %{http_code}\n'{"id":"file-bGl0ZWxsbTpnczovL2xpdGVsbG0tZTJlLXZlcnRleC1iYXRjaC9saXRlbGxtLXZlcnRleC1maWxlcy9wdWJsaXNoZXJzL2dvb2dsZS9tb2RlbHMvZ2VtaW5pLTQtYXJnb24vYTYwZTdlNDMtNzFmZC00NjM4LTkzMGItZDg2M2NlNTJlYmY2O21vZGVsLHZlcnRleC1iYXRjaA","bytes":269,"created_at":1792892479,"filename":"litellm-vertex-files/publishers/google/models/gemini-4-argon/a60e7e43-71fd-4638-930b-d863ce52ebf6","object":"file","purpose":"batch","status":"uploaded","expires_at":null,"status_details":null} HTTP 200curl -s http://localhost:4671/v1/files/file-bGl0ZWxsbTpnczovL2xpdGVsbG0tZTJlLXZlcnRleC1iYXRjaC9saXRlbGxtLXZlcnRleC1maWxlcy9wdWJsaXNoZXJzL2dvb2dsZS9tb2RlbHMvZ2VtaW5pLTQtYXJnb24vYTYwZTdlNDMtNzFmZC00NjM4LTkzMGItZDg2M2NlNTJlYmY2O21vZGVsLHZlcnRleC1iYXRjaA/content -H 'Authorization: Bearer sk-qa-1234'{"request": {"contents": [{"role": "user", "parts": [{"text": "Name one color. One word."}]}], "generationConfig": {"max_output_tokens": 8, "temperature": 0, "top_p": 0.9, "top_k": 20}, "labels": {"litellm_custom_id": "req-1", "litellm_custom_id_raw": "b32_ojsxcljr"}}}After (1c9304a)
vertex_ai/gemini-4-argon, sampling knobs, no drop_params
{ "error": { "message": "litellm.UnsupportedParamsError: vertex_ai does not support parameters: ['temperature', 'top_p'], for model=gemini-4-argon. To drop these, set `litellm.drop_params=True` or for proxy:\n\n`litellm_settings:\n drop_params: true`\n. \n If you want to use these params dynamically send allowed_openai_params=['temperature', 'top_p'] in your request.\n\nLiteLLM: model group 'vertex_ai/gemini-4-argon' failed with the error above. No fallback was attempted.", "type": "invalid_request_error", "param": null, "code": "400" } } HTTP 400vertex_ai/gemini-4-argon, sampling knobs, drop_params true
{ "id": "iu_fat7iHq6c998Pg_m8sAg", "model": "vertex_ai/gemini-4-argon", "content": "Blue", "finish_reason": "stop" } HTTP 200control: vertex_ai/gemini-3.5-flash keeps the knobs, no drop_params
{ "id": "je_fare_NdCQ4_UP9varoQ8", "model": "vertex_ai/gemini-3.5-flash", "content": "Blue", "finish_reason": "stop" } HTTP 200POST /v1/messages, vertex_ai/gemini-4-argon, sampling knobs, no drop_params
{ "error": { "type": "invalid_request_error", "message": "litellm.UnsupportedParamsError: vertex_ai does not support parameters: ['temperature', 'top_p'], for model=gemini-4-argon. To drop these, set `litellm.drop_params=True` or for proxy:\n\n`litellm_settings:\n drop_params: true`\n. \n If you want to use these params dynamically send allowed_openai_params=['temperature', 'top_p'] in your request.\n\nLiteLLM: model group 'vertex_ai/gemini-4-argon' failed with the error above. No fallback was attempted." } } HTTP 400POST /v1/messages, vertex_ai/gemini-4-argon, sampling knobs, drop_params true
{ "id": "j-_fao2dFqGb4_UPuYGTwAc", "model": "vertex_ai/gemini-4-argon", "text": "Blue", "stop_reason": "end_turn" } HTTP 200POST /v1/responses, vertex_ai/gemini-4-argon, sampling knobs, no drop_params
{ "error": { "message": "litellm.UnsupportedParamsError: vertex_ai does not support parameters: ['temperature', 'top_p'], for model=gemini-4-argon. To drop these, set `litellm.drop_params=True` or for proxy:\n\n`litellm_settings:\n drop_params: true`\n. \n If you want to use these params dynamically send allowed_openai_params=['temperature', 'top_p'] in your request.\n\nLiteLLM: model group 'vertex_ai/gemini-4-argon' failed with the error above. No fallback was attempted.", "type": "invalid_request_error", "param": null, "code": "400" } } HTTP 400POST /v1/responses, vertex_ai/gemini-4-argon, sampling knobs, drop_params true
{ "id": "resp_i05baGlQLbPBj7yVVkEcaC8Pzh9ZUXwmTH-gkPsMfwjgdi4n8sATBYdsR3KY0TOYMd7SUzuESBaigLe9kpzobo_jqstlAg-AozTd_X0Rf5WFaFcQKNkhgzNnpwJLLbr3zqwcuxTmCmUiceOyi5vLGN7qP5HAeaowfMQcF97QPZ58by70HxyF8TbhkHkury0rBe6S34wKfqTXTVRw-eWOsHpq1CP25uCkAe1UIPJ2HKlXUK0oRUdW8WnBkGk40LwNL7nf1y2ovnoNfo1mUpP5BIKTLVd1ievP8v5FDLtdwdJkkMjwSBRGDi5nblYsgYQFELQVzI8eyNkMHU9sDwUAsPhoK0yuvSjWYwtf43YarTwhuZnOEImSL67XK8cA5vYXqD_mnWq7jBcjC0t6E2UozbdtFSjn15-Gnf0=", "model": "vertex_ai/gemini-4-argon", "output_text": "Blue", "status": "completed" } HTTP 200gemini/gemini-4-argon (AI Studio), sampling knobs, no drop_params
{ "error": { "message": "litellm.UnsupportedParamsError: gemini does not support parameters: ['temperature', 'top_p'], for model=gemini-4-argon. To drop these, set `litellm.drop_params=True` or for proxy:\n\n`litellm_settings:\n drop_params: true`\n. \n If you want to use these params dynamically send allowed_openai_params=['temperature', 'top_p'] in your request.\n\nLiteLLM: model group 'gemini/gemini-4-argon' failed with the error above. No fallback was attempted.", "type": "invalid_request_error", "param": null, "code": "400" } } HTTP 400The four batch cases below were captured at c2c76fc, the tip before main was merged in, as the proof intro explains
POST /v1/files purpose=batch, vertex_ai/gemini-4-argon row with sampling knobs, no drop_params
cat batch_row_argon.jsonl {"custom_id": "req-1", "method": "POST", "url": "/v1/chat/completions", "body": {"model": "vertex_ai/gemini-4-argon", "messages": [{"role": "user", "content": "Name one color. One word."}], "max_tokens": 8, "temperature": 0, "top_p": 0.9, "top_k": 20}} curl -s 'http://localhost:4677/v1/files?model=vertex-batch' -H 'Authorization: Bearer sk-qa-1234' -F purpose=batch -F file=@batch_row_argon.jsonl -w '\nHTTP %{http_code}\n'{"error":{"message":"Batch input file line 1 could not be converted to a Vertex AI request: litellm.UnsupportedParamsError: gemini-4-argon does not support temperature, top_p, top_k: Google ignores sampling params on this model, so LiteLLM treats it as `supports_sampling_params: false`. To drop unsupported params, set `litellm.drop_params = True`, or set `supports_sampling_params: true` in the model's model_info to forward them anyway.","type":"invalid_request_error","param":null,"code":"400"}} HTTP 400POST /v1/files purpose=batch, vertex_ai/gemini-4-argon row with sampling knobs, drop_params true in litellm_settings
cat batch_row_argon.jsonl {"custom_id": "req-1", "method": "POST", "url": "/v1/chat/completions", "body": {"model": "vertex_ai/gemini-4-argon", "messages": [{"role": "user", "content": "Name one color. One word."}], "max_tokens": 8, "temperature": 0, "top_p": 0.9, "top_k": 20}} curl -s 'http://localhost:4678/v1/files?model=vertex-batch' -H 'Authorization: Bearer sk-qa-1234' -F purpose=batch -F file=@batch_row_argon.jsonl -w '\nHTTP %{http_code}\n'{"id":"file-bGl0ZWxsbTpnczovL2xpdGVsbG0tZTJlLXZlcnRleC1iYXRjaC9saXRlbGxtLXZlcnRleC1maWxlcy9wdWJsaXNoZXJzL2dvb2dsZS9tb2RlbHMvZ2VtaW5pLTQtYXJnb24vODdlNGUxOTUtODEzMC00NzcwLTg1ZGEtZWY0MTRmNTZjODhjO21vZGVsLHZlcnRleC1iYXRjaA","bytes":224,"created_at":1792896492,"filename":"litellm-vertex-files/publishers/google/models/gemini-4-argon/87e4e195-8130-4770-85da-ef414f56c88c","object":"file","purpose":"batch","status":"uploaded","expires_at":null,"status_details":null} HTTP 200curl -s http://localhost:4678/v1/files/file-bGl0ZWxsbTpnczovL2xpdGVsbG0tZTJlLXZlcnRleC1iYXRjaC9saXRlbGxtLXZlcnRleC1maWxlcy9wdWJsaXNoZXJzL2dvb2dsZS9tb2RlbHMvZ2VtaW5pLTQtYXJnb24vODdlNGUxOTUtODEzMC00NzcwLTg1ZGEtZWY0MTRmNTZjODhjO21vZGVsLHZlcnRleC1iYXRjaA/content -H 'Authorization: Bearer sk-qa-1234'{"request": {"contents": [{"role": "user", "parts": [{"text": "Name one color. One word."}]}], "generationConfig": {"max_output_tokens": 8}, "labels": {"litellm_custom_id": "req-1", "litellm_custom_id_raw": "b32_ojsxcljr"}}}batch upload, row written as gemini/gemini-4-argon through the Vertex batch deployment, no drop_params
cat batch_row_argon_gemini_prefix.jsonl {"custom_id": "req-1", "method": "POST", "url": "/v1/chat/completions", "body": {"model": "gemini/gemini-4-argon", "messages": [{"role": "user", "content": "Name one color. One word."}], "max_tokens": 8, "temperature": 0, "top_p": 0.9, "top_k": 20}} curl -s 'http://localhost:4677/v1/files?model=vertex-batch' -H 'Authorization: Bearer sk-qa-1234' -F purpose=batch -F file=@batch_row_argon_gemini_prefix.jsonl -w '\nHTTP %{http_code}\n'{"error":{"message":"Batch input file line 1 could not be converted to a Vertex AI request: litellm.UnsupportedParamsError: gemini-4-argon does not support temperature, top_p, top_k: Google ignores sampling params on this model, so LiteLLM treats it as `supports_sampling_params: false`. To drop unsupported params, set `litellm.drop_params = True`, or set `supports_sampling_params: true` in the model's model_info to forward them anyway.","type":"invalid_request_error","param":null,"code":"400"}} HTTP 400batch upload, row written as gemini/gemini-4-argon through the Vertex batch deployment, drop_params true
cat batch_row_argon_gemini_prefix.jsonl {"custom_id": "req-1", "method": "POST", "url": "/v1/chat/completions", "body": {"model": "gemini/gemini-4-argon", "messages": [{"role": "user", "content": "Name one color. One word."}], "max_tokens": 8, "temperature": 0, "top_p": 0.9, "top_k": 20}} curl -s 'http://localhost:4678/v1/files?model=vertex-batch' -H 'Authorization: Bearer sk-qa-1234' -F purpose=batch -F file=@batch_row_argon_gemini_prefix.jsonl -w '\nHTTP %{http_code}\n'{"id":"file-bGl0ZWxsbTpnczovL2xpdGVsbG0tZTJlLXZlcnRleC1iYXRjaC9saXRlbGxtLXZlcnRleC1maWxlcy9wdWJsaXNoZXJzL2dvb2dsZS9tb2RlbHMvZ2VtaW5pLTQtYXJnb24vY2RmMzMyNjUtYTQ2YS00ODI0LWFiYWItNTU3ZjcyNWJkMDA1O21vZGVsLHZlcnRleC1iYXRjaA","bytes":224,"created_at":1792896493,"filename":"litellm-vertex-files/publishers/google/models/gemini-4-argon/cdf33265-a46a-4824-abab-557f725bd005","object":"file","purpose":"batch","status":"uploaded","expires_at":null,"status_details":null} HTTP 200curl -s http://localhost:4678/v1/files/file-bGl0ZWxsbTpnczovL2xpdGVsbG0tZTJlLXZlcnRleC1iYXRjaC9saXRlbGxtLXZlcnRleC1maWxlcy9wdWJsaXNoZXJzL2dvb2dsZS9tb2RlbHMvZ2VtaW5pLTQtYXJnb24vY2RmMzMyNjUtYTQ2YS00ODI0LWFiYWItNTU3ZjcyNWJkMDA1O21vZGVsLHZlcnRleC1iYXRjaA/content -H 'Authorization: Bearer sk-qa-1234'{"request": {"contents": [{"role": "user", "parts": [{"text": "Name one color. One word."}]}], "generationConfig": {"max_output_tokens": 8}, "labels": {"litellm_custom_id": "req-1", "litellm_custom_id_raw": "b32_ojsxcljr"}}}Type
🆕 New Feature
Caveats (if any)
Medium
supports_sampling_params: truein one deployment's model_info reaches every deployment of that backend model in the process, because the Router writes it onto the shared model map row the way it writes supports_vision. The escape hatch has worked that way since fix(gemini)!: honor supports_sampling_params on the Gemini and Vertex path and flag Gemini 3.6 Flash, 3.5 Flash-Lite and later #47645 made the flag a map field, this PR only makes it visible through get_model_info. Keeping the flag on the deployment that set it would need the Gemini check to read the deployment's model_info at every gate, which is follow-up workLow
Final Attestation