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,
output_usd and cached_input_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.
Details
An alias ("chatgpt-4o-latest", say) takes the entry of the model it names,
a registered override of that model included, and reports the alias as its
id. A family-regex match and the default both warn with class
gr_unknown_model; under gr_options(unknown_model_action = "error") both
stop instead, because neither id is in the registry.
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