Configuration for the Gemini model provider.
The gemini sub-block configures the Google Gemini provider, which
serves the Gemini family of models via the GenerateContent API.
| Field | Type | Required | runtime() | Description |
|---|---|---|---|---|
models | list | no | no | Allowlist of models for this provider. Each entry is a plain string or a config object with name and params. When omitted, no allowlist is enforced. |
config | block | no | Connection configuration. | |
config.api_key | string | no | yes | Gemini API key. Wrap in secret(runtime(...)) to keep it out of build artifacts. |
params | block | no | Provider-level inference parameter defaults. Applied to every request unless overridden at the model level. |
The config block is optional. When omitted, the client reads credentials from the
GEMINI_API_KEY environment variable.
The params block sets inference parameter defaults for all models under this provider. All fields
are optional and support runtime().
| Field | Type | runtime() | Description |
|---|---|---|---|
max_tokens | integer | yes | Maximum number of tokens to generate. |
temperature | float | yes | Sampling temperature. |
top_p | float | yes | Nucleus sampling probability. |
top_k | integer | yes | Top-K sampling limit. |
stop_sequences | list of strings | yes | Sequences that stop generation. |
seed | integer | yes | Seed for deterministic sampling. |
provider_params | object | yes | Provider-specific parameters passed directly to the API. |
frequency_penalty and presence_penalty are not part of the Gemini API. Setting them has no
effect and they will be ignored.
| Model | Identifier |
|---|---|
| Gemini 2.5 Flash | gemini-2.5-flash |
| Gemini 2.5 Pro | gemini-2.5-pro |
| Gemini 2.0 Flash | gemini-2.0-flash |
| Gemini 1.5 Flash | gemini-1.5-flash |
| Gemini 1.5 Pro | gemini-1.5-pro |
providers {
gemini {
models = [
"gemini-2.5-flash",
{
name = "gemini-2.5-pro"
params {
max_tokens = 16384
temperature = 0.4
}
}
]
config {
api_key = secret(runtime("GEMINI_API_KEY"))
}
params {
max_tokens = 4096
temperature = 0.5
}
}
}
agent "assistant" {
graph {
type = "react"
}
model {
provider = "gemini"
name = "gemini-2.5-flash"
}
}Always wrap API keys in secret(runtime(...)). This prevents the key from appearing in build
artifacts and the output of agentc inspect.
© 2026 pogue.dev. All rights reserved.
CC BY 4.0Search the agentc documentation