-
-
Notifications
You must be signed in to change notification settings - Fork 0
Provider Gemini
Direct HTTPS API integration with
generativelanguage.googleapis.com.
provider: gemini
providers:
gemini:
api_key: AIza...
model: gemini-3.5-flashEquivalent CLI / env:
commitbrief config set provider gemini
commitbrief config set providers.gemini.api_key AIza...
commitbrief config set providers.gemini.model gemini-3.5-flash
export GEMINI_API_KEY=AIza...Get an API key from https://aistudio.google.com/.
| Model ID | Default? | Context window |
|---|---|---|
gemini-3.5-flash |
✓ | 1,000,000 tokens |
gemini-3.1-pro-preview |
— | 1,000,000 tokens |
gemini-3.1-flash-lite |
— | 1,000,000 tokens |
gemini-3.1-pro-preview is a preview model — the public pricing
page lists the Pro tier only under that ID. The model constant will
be updated to the stable ID once Google promotes it. The 1M context
window is the documented Gemini 3.x baseline; exact per-model limits
for these preview models were not broken out in the model docs at
integration time, so 1M is used as the safe floor for the
over-context guard.
| Model | Input | Output | Cached input |
|---|---|---|---|
gemini-3.5-flash |
$1.50 | $9.00 | $0.375 |
gemini-3.1-pro-preview |
$2.00 | $12.00 | $0.50 |
gemini-3.1-flash-lite |
$0.25 | $1.50 | $0.0625 |
gemini-3.1-pro-preview has tiered pricing — requests above 200K
input tokens are billed at $4 input / $18 output for the whole
session. The binary snapshots the ≤200K base tier, so the verbose
cost footer may under-report on very large inputs.
Gemini's context-caching API is separate from inline prompt caching and is not currently wired into the CommitBrief integration; the cached-input rate (Gemini's implicit-cache read discount, ~0.25× input) is tracked for accurate reporting when it is.
Rates from https://ai.google.dev/gemini-api/docs/pricing; the
binary's table is in internal/provider/gemini/pricing.go.
The SDK takes int32 for max-output-tokens; CommitBrief bounds the
request to [1, math.MaxInt32] with a default of 4096 so a
malformed config never wraps to a negative number (UC-115 in
v1.0.0-rc.1 security audit).
The Gemini client uses ResponseSchema to constrain the model to
the v1 findings JSON shape. Same retry-once-then-degrade behavior
as the other API providers.
- Providers — overview + comparison.
- Cost preflight — how the estimate is computed.
- JSON schema — the v1 findings schema.
Home · Installation · Quick start · Troubleshooting · GitHub repo · Issues
CommitBrief — local, LLM-powered code review for git diffs. This wiki documents only what ships in the binary.
Getting started
Commands · reviewing
Commands · summarizing
Commands · committing
Commands · setup
Commands · integration
Commands · inspect
Commands · maintenance
Configuration
Providers
Output
Operations
Reference