Skip to contents

Resolution order: user-registered exact id, built-in exact id, alias, family regex, then a conservative default. The returned list always carries certain, which is FALSE when the answer came from a regex or the default. Treat that as "verify before trusting for cost control".

Usage

gr_model_info(model = NULL)

Arguments

model

Model id.

Value

A named list: id, context_window, max_output, input_usd and output_usd (per 1M tokens, used by gr_estimate_cost()), reasoning, supports_temperature, kind, dimensions, as_of, certain, and source ("registered", "builtin", "alias", "pattern:..." or "default"). certain is FALSE when the answer came from a family regex or the fallback; verify before relying on it for cost control.

Examples

gr_model_info("gpt-4o")[c("context_window", "max_output", "certain")]
#> $context_window
#> [1] 128000
#> 
#> $max_output
#> [1] 16384
#> 
#> $certain
#> [1] TRUE
#> 

# An unrecognised id warns and falls back to conservative limits.
suppressWarnings(gr_model_info("some-model-from-next-year")$certain)
#> [1] FALSE