Searches the merged model catalog: the shipped snapshot (models.dev plus gptr's reviewed
prices and capabilities), a refreshed copy in tools::R_user_dir("gptr", "cache"), models
declared by registered providers, user configuration and discovered local servers. Offline
by default: only refresh = TRUE touches the network.
Arguments
- query
NULLor a regular expression or alias (for example"sonnet"), matched against the reference, the name and the aliases; the model an alias resolves to is listed first.- provider
NULLor a provider id (for example"anthropic").- refresh
TRUEdownloads the current models.dev catalog with ETag revalidation into the user cache. For a local provider (provider = "ollama","lmstudio", ...) it asks that server for its installed models instead (a 1 second limit per request; for Ollama the native/api/version,/api/tagsand/api/showendpoints). Ollama discovery requires a loopback address under the default local-only policy; only an explicit human setting at user or session scope can relax it (seegptr_config()). The only network use of this function; it never starts or installs a server and never downloads a model.
Value
A gptr_models data frame with columns ref, provider, name, context,
max_output, input_price, output_price (USD per million tokens, selected for today's
date from the available catalog; 0 for verified local inference, NA when unknown),
reasoning, aliases and status. Catalog prices can be stale and are not an account quote.
Details
A catalog entry describes a route, not current account access. Copy its ref into the
model argument of peter() to choose that route. Ollama routes require current installed
model evidence before inference; discovery does not pull models. See
vignette("language-models", package = "gptr") for setup and gptr_providers() for
credentials and reachability.
Examples
gptr_models("sonnet")
#> # Columns 1/2
#> name ref status provider
#> 1 Claude Sonnet 5.5 anthropic/claude-sonnet-5-5 active anthr...
#> 2 Claude Sonnet 5.5 (claude CLI) claude-cli/claude-sonnet-5-5 active claud...
#> # Columns 2/2
#> context max_output input_price output_price reasoning aliases
#> 1 1e+06 128000 2 10 TRUE sonnet
#> 2 2e+05 64000 NA NA TRUE
#>
#> # 2 rows
#> catalog 2026-10-03 (gptr seed + overrides), 22 models; gptr_models(refresh = TRUE) updates it
gptr_models(provider = "anthropic")
#> # Columns 1/2
#> name ref status provider context
#> 1 Claude Fable 5.1 anthropic/claude-fable-5-1 active anthropic 1e+06
#> 2 Claude Haiku 4.5 anthropic/claude-haiku-4-5 active anthropic 2e+05
#> 3 Claude Opus 5.5 anthropic/claude-opus-5-5 active anthropic 1e+06
#> 4 Claude Sonnet 5.5 anthropic/claude-sonnet-5-5 active anthropic 1e+06
#> # Columns 2/2
#> max_output input_price output_price reasoning aliases
#> 1 128000 10 50 TRUE
#> 2 64000 1 5 TRUE haiku
#> 3 128000 4 20 TRUE opus
#> 4 128000 2 10 TRUE sonnet
#>
#> # 4 rows
#> catalog 2026-10-03 (gptr seed + overrides), 22 models; gptr_models(refresh = TRUE) updates it