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
hr_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 hr_options(unknown_model_action = "error") both
stop instead, because neither id is in the registry.
See also
hr_register_model(), hr_models(), hr_budget()
Other cost and token functions:
hr_budget(),
hr_context_fit(),
hr_context_policy(),
hr_count_tokens(),
hr_estimate_cost(),
hr_load_models(),
hr_model_limits(),
hr_models(),
hr_register_model(),
hr_set_tokenizer(),
hr_tokenizer(),
hr_truncate(),
hr_truncate_tokens()
Examples
hr_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(hr_model_info("some-model-from-next-year")$certain)
#> [1] FALSE