# `GeminiCliSdk.Models`
[🔗](https://github.com/nshkrdotcom/gemini_cli_sdk/blob/v0.2.0/lib/gemini_cli_sdk/models.ex#L1)

Centralized model name constants and helpers.

All model references throughout the SDK flow through this module.
Override defaults via Application configuration:

    # config/config.exs
    config :gemini_cli_sdk,
      default_model: "gemini-2.5-pro",
      fast_model: "gemini-2.5-flash"

## Built-in Models

| Function | Default | Description |
|----------|---------|-------------|
| `default_model/0` | `"gemini-2.5-pro"` | Most capable model |
| `fast_model/0` | `"gemini-2.5-flash"` | Optimized for speed |

## Aliases

Short aliases expand to full model names via `resolve/1`:

| Alias | Resolves To |
|-------|-------------|
| `"pro"` | `default_model()` |
| `"default"` | `default_model()` |
| `"flash"` | `fast_model()` |
| `"fast"` | `fast_model()` |

# `available_models`

```elixir
@spec available_models() :: [String.t()]
```

Returns a list of all built-in model identifiers.

# `default_model`

```elixir
@spec default_model() :: String.t()
```

Returns the default (most capable) model name.

# `fast_model`

```elixir
@spec fast_model() :: String.t()
```

Returns the fast model name, optimized for speed.

# `known?`

```elixir
@spec known?(String.t()) :: boolean()
```

Returns `true` if the model name is a known built-in model or alias.

# `resolve`

```elixir
@spec resolve(String.t()) :: String.t()
```

Resolves a model name, expanding aliases.

Accepts full model names as-is, or aliases like `"pro"`, `"flash"`,
`"default"`, `"fast"`.

## Examples

    iex> GeminiCliSdk.Models.resolve("pro")
    "gemini-2.5-pro"

    iex> GeminiCliSdk.Models.resolve("gemini-2.5-flash")
    "gemini-2.5-flash"

    iex> GeminiCliSdk.Models.resolve("custom-model")
    "custom-model"

# `validate`

```elixir
@spec validate(term()) :: :ok | {:error, String.t()}
```

Validates a model value.

Accepts any non-empty binary string or `nil` (meaning use CLI default).
Does not restrict to known models -- new models work without SDK updates.

## Examples

    iex> GeminiCliSdk.Models.validate("gemini-2.5-pro")
    :ok

    iex> GeminiCliSdk.Models.validate(nil)
    :ok

    iex> GeminiCliSdk.Models.validate(123)
    {:error, "Invalid model: 123. Must be a non-empty string or nil."}

---

*Consult [api-reference.md](api-reference.md) for complete listing*
