Defaults and limits¶
The values the module uses when you configure nothing, and the caps that are fixed in the code and cannot be raised through configuration.
Default models¶
Config.Model left empty selects these:
| Provider | Constant | Value |
|---|---|---|
claude |
chat.DefaultModelClaude |
claude-opus-5 |
openai |
chat.DefaultModelOpenAI |
gpt-5.6-sol |
gemini |
chat.DefaultModelGemini |
gemini-3.7-flash |
claude-local |
— | none in this module; the claude CLI picks its own |
openai-compatible |
— | none; Config.Model is required |
All three are chosen by one rule: the most capable model the provider makes
generally available that supports structured output, tool use and multimodal
input. That favours capability over cost, and it moves when vendors release,
pin Config.Model if you would rather it did not. The reasoning is in
Providers.
Two consequences are worth carrying in your head. Two of the three defaults
refuse Config.Temperature (claude-opus-5 and gpt-5.6-sol) while
gemini-3.7-flash still accepts it, up to a maximum of 2. And gemini-3.7-flash
is a genuine step below the other two, because Google ships no
generally-available Pro-tier model.
Those two facts pull in opposite directions, which is the honest position: the one default that still takes sampling controls is also the least capable.
Default limits and timeouts¶
| Constant | Value | What it bounds |
|---|---|---|
chat.DefaultMaxSteps |
20 |
ReAct iterations in one Chat or StreamChat call, when Config.MaxSteps is zero |
chat.DefaultMaxTokensClaude |
8192 |
tokens per response on Claude, when Config.MaxTokens is zero |
chat.DefaultMaxTokensGemini |
8192 |
tokens per response on Gemini, when Config.MaxTokens is zero |
chat.DefaultMaxTokensOpenAI |
4096 |
tokens per response on OpenAI, when Config.MaxTokens is zero |
chat.DefaultChatRequestTimeout |
5 * time.Minute |
one HTTP request to a provider, when Config.RequestTimeout is zero and no Config.HTTPClient is injected |
chat.MaxBaseURLLength |
2048 |
the accepted length of Config.BaseURL, in bytes |
chat.SnapshotVersion |
1 |
the snapshot format version written by chat.NewSnapshot |
chat.DefaultCompactionTurns |
200 |
retained turns above which chat.CompactOldest summarises, when no WithTurnBudget is set |
DefaultCompactionTurns is far larger than a truncation budget would be, and
deliberately so: dropping turns is free, summarising them costs a round-trip, so
a conversation should be allowed to get genuinely long before it starts paying
for one. Compaction's other budget is a share of the model's own reported input
limit rather than a constant, because a number right for a 200k window is wrong
for an 800k one.
The request timeout is generous on purpose (a large single-shot generation on a flagship model runs well past a typical 30-second HTTP default) but it is bounded on purpose too, so a model stuck in a loop fails instead of hanging forever.
Caps you cannot configure¶
These are fixed in the code. There is no field, option or environment variable that raises them; changing one means changing the module.
| Cap | Value | Applies to |
|---|---|---|
| Attachment size | 20 MiB | one chat.Media item; a larger attachment is rejected with chat.ErrMediaRejected before any network call |
| Attachments per call | 16 | the whole variadic passed to Add, Ask, Chat or StreamChat |
| Parallel tool concurrency | 5 | the default for Config.MaxParallelTools when it is zero or negative |
| Encryption key length | 32 bytes | chat.WithEncryption; any other length fails chat.NewFileStore |
| Snapshot file mode | 0600 |
files written by FileStore |
| Snapshot directory mode | 0700 |
the directory FileStore creates |
| Identifier echoed in errors | 32 characters | how much of a rejected snapshot ID appears in the message, so an attacker-supplied value cannot amplify a log |
Rate limits, per-minute token budgets and monthly quotas are not in this
list because the module has none. Those belong to the provider, and the module
surfaces the refusal as chat.ErrThrottled rather than pacing calls itself.
The effort ladder¶
Config.Effort accepts exactly five values, in ascending order:
| Constant | Value | Notes |
|---|---|---|
chat.EffortLow |
low |
the least reasoning the provider will accept |
chat.EffortMedium |
medium |
|
chat.EffortHigh |
high |
|
chat.EffortXHigh |
xhigh |
clamps to high on Gemini, which has four levels |
chat.EffortMax |
max |
clamps to high on Gemini; the most direct cost dial in Config |
Anything else is dropped at construction with the valid list in the hint, and
the provider's own default effort is used. Effort.Valid() reports whether a
value is on the ladder, and Effort.Rank() gives its position so an adapter can
clamp onto a shorter ladder by index.
Media types the module will send¶
An attachment's type is sniffed from its bytes with net/http.DetectContentType
and must appear in the allowlist below; a declared Media.MIMEType is only ever
a cross-check, and the sniffed type is what is sent.
| Group | Types | Accepted by |
|---|---|---|
| Images | image/jpeg, image/png, image/gif, image/webp |
gemini, claude, openai |
| Documents | application/pdf |
gemini, claude, openai |
| Video | video/mp4, video/webm, video/avi |
gemini only |
| Audio | audio/mpeg, audio/wave, audio/aiff, application/ogg |
gemini only |
claude-local accepts no media at all: passing any attachment returns
chat.ErrMediaUnsupported. Formats the standard library cannot positively
identify (mov, flv, wmv, 3gpp, flac, m4a) are rejected as
unidentifiable even where the vendor would accept them, because the sniffer, not
the vendor, is the constraint.
Support values¶
chat.Support is three-valued, and SupportUnknown is its zero value, so an
unpopulated capability map reads as "nobody could say" rather than "no".
| Constant | String() |
Meaning |
|---|---|---|
chat.SupportUnknown |
unknown |
not declared, or not discoverable (proceed and let the provider answer) |
chat.SupportNo |
no |
the model does not accept it; the setting is dropped at construction |
chat.SupportYes |
yes |
supported |
Related¶
- Configuration fields: which field each default belongs to.
- Errors: the sentinel each rejection carries.
- Check what a model supports: asking before you set a value.