Documentation / guides
Capabilities
Gate optional request features with secret-free model capabilities.
Capabilities is local gating and informational metadata. It is never serialized onto the provider wire. A custom model starts with every capability off; options explicitly opt features in.
API surface
type Capabilities struct {
AcceptsImages bool
Tools bool
Thinking bool
StructuredOutput bool
StructuredOutputWithTools bool
PromptCaching bool
}
| Capability | Used by |
|---|---|
AcceptsImages | Request validation when any message contains an image, including nested tool-result blocks |
Tools | Tool request admission and model catalogue metadata |
Thinking | Extended-thinking request policy |
StructuredOutput | OutputSchema admission |
StructuredOutputWithTools | Structured output when ordinary tools are also exposed; implies Tools and StructuredOutput |
PromptCaching | Codec opt-in for explicit cache_control breakpoints |
descriptor := model.CustomModel(
model.ProviderName("acme"), model.APIFormatAnthropic,
"https://api.example.test", "reasoner",
model.WithThinking(), model.WithPromptCaching(),
)
if !descriptor.Caps.Thinking {
panic("the option was not applied")
}
Model.Validate rejects StructuredOutputWithTools unless both prerequisite booleans are true. It does not decide whether a provider really supports a label; that policy belongs to the integration layer.
Proof
- Source:
inference/model/capabilities.go,inference/model/model.go - Tests:
inference/model/model_test.goverifies fail-safe defaults and each option.
Related: Feature validation, Structured output requests.