Gemini.ModelRegistry (GeminiEx v0.11.0)

Copy Markdown View Source

Canonical model registry with capability metadata.

The registry is sourced from the Gemini models catalog pages and provides a stable API for:

  • model lookup by code (including resource-style names and aliases)
  • capability checks (for example :live_api, :function_calling)
  • live-model candidate selection by modality (:text / :audio)

This keeps model selection logic out of tests and centralizes support decisions in one place.

Summary

Functions

Returns capability state for a model code.

Returns all registry entries.

Find an entry by model code.

Find an entry by registry key.

Returns preferred Live API candidates for a modality.

Returns all canonical model codes.

Returns true if a model's capability matches the expected state.

Returns model codes whose capability matches the expected state.

Types

capability()

@type capability() ::
  :live_api
  | :thinking
  | :function_calling
  | :structured_outputs
  | :audio_generation
  | :image_generation
  | :batch_api
  | :caching

entry()

@type entry() :: %{
  key: atom(),
  code: String.t(),
  source_page: String.t(),
  track: :stable | :preview | :experimental | :deprecated | :agent,
  latest_update: String.t() | nil,
  input_modalities: [modality()],
  output_modalities: [modality()],
  capabilities: %{optional(capability()) => support_state()},
  aliases: [String.t()],
  live_modalities: [modality()],
  notes: String.t() | nil
}

modality()

@type modality() :: :text | :image | :video | :audio | :pdf | :embeddings | :music

support_state()

@type support_state() :: :supported | :not_supported | :experimental | :unknown

Functions

capability(model_name, capability)

@spec capability(String.t(), capability()) :: support_state()

Returns capability state for a model code.

entries()

@spec entries() :: [entry()]

Returns all registry entries.

get(model_name)

@spec get(String.t()) :: entry() | nil

Find an entry by model code.

Accepts plain model names, models/..., publisher-prefixed, project-scoped, and endpoint-suffixed (:bidiGenerateContent) forms.

get_by_key(key)

@spec get_by_key(atom()) :: entry() | nil

Find an entry by registry key.

live_candidates(modality, opts \\ [])

@spec live_candidates(
  :text | :audio,
  keyword()
) :: [String.t()]

Returns preferred Live API candidates for a modality.

model_codes()

@spec model_codes() :: [String.t()]

Returns all canonical model codes.

supports?(model_name, capability, expected \\ :supported)

@spec supports?(String.t(), capability(), support_state()) :: boolean()

Returns true if a model's capability matches the expected state.

with_capability(capability, expected \\ :supported)

@spec with_capability(capability(), support_state()) :: [String.t()]

Returns model codes whose capability matches the expected state.