[Python] Default max_batch_size in the Gemini and OpenAI model handlers #41361
All Vouch review confidence checks passed
Residual risk 0.20 = Change Risk (0.38) × (1 − Review Confidence (0.47)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.38 · 145 lines diff across 1 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.02 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Shallow Review Depth
shallow_review_depth
0.344
Diff Size
diff_size
0.298
Ai Authored
ai_authored
0.050
Real PR Conversation Timeline
1 comments
"Review active on #41361"
general
weight: 0.35
Mola-maker
Fixes #41360
GeminiModelHandlerandOpenAIModelHandlerset no defaultmax_batch_size, so default batches grow to about 1,000 prompts, and to 10,000 inputs withembedding_from_string, which is over the 2,048 inputs the embeddings endpoint accepts. Per-prompt requests are only sent 32 at a time, and a failed request retries the whole batch.This PR defaults
max_batch_sizeto 32, or to 2,048 withembedding_from_string, and never belowmin_batch_size. An explicitmax_batch_sizebehaves as before.Testing:
gemini_inference_test.pyandopenai_inference_test.py. They fail on master.This is from the same pass over the remote LLM handlers as #40914 and #41359. I'm happy to change the default values if you'd pick different ones, and if something else in this area would be more useful for me to work on, I'd be glad to.
R: @jrmccluskey
cc: @claudevdm