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".
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.
See also
gr_register_model(), gr_models(), gr_budget()
Other cost and token functions:
gr_budget(),
gr_count_tokens(),
gr_estimate_cost(),
gr_model_limits(),
gr_models(),
gr_register_model(),
gr_set_tokenizer(),
gr_tokenizer(),
gr_truncate_tokens()
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