# `Rho.Models`
[🔗](https://github.com/GenericJam/rho/blob/v0.1.0/lib/rho/models.ex#L1)

The models rho can call right now (like omp's `/models`): the static
catalog filtered to the providers that have a credential (`Rho.Auth`).

  * Claude (`anthropic:`), OpenAI (`openai:`) and Gemini (`google:`):
    llm_db's models (the catalog req_llm resolves them through; rho
    ships it trimmed to these providers, `Rho.LLMCatalog`), retired and
    deprecated ones left out. Claude: newest first within Opus, Sonnet,
    Haiku, then the rest. OpenAI and Gemini: the chat models that take
    tools, newest release first.
  * ChatGPT (`openai_codex:`): the Codex backend serves its own set,
    which llm_db doesn't list; `priv/models/openai_codex.json` is omp's
    list (its source and version are in the file).

# `model`

```elixir
@type model() :: %{
  provider: Rho.Auth.provider(),
  spec: String.t(),
  name: String.t(),
  context: pos_integer() | nil
}
```

# `by_provider`

```elixir
@spec by_provider(map()) :: [{Rho.Auth.provider(), boolean(), [model()]}]
```

`[{provider, signed_in?, models}]` for every provider, in `Rho.Auth.providers/0`
order; a provider without a credential has no models.

# `catalog`

```elixir
@spec catalog(Rho.Auth.provider()) :: [model()]
```

Every model of `provider` in the catalog, whether signed in or not.

# `images?`

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

Does `spec` take pictures?

# `inputs`

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

What `spec` takes as input (`:text`, `:image`, `:pdf`, ...): llm_db's
`modalities.input`, looked up once per spec and kept (the loop asks on
every request). Every model on the Codex backend takes text and pictures
(omp's catalog); a Claude model llm_db doesn't know (a custom id) takes
pictures and PDFs like every Claude; anything else unknown, text only.

# `same?`

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

Whether two model specs name the same model, ignoring a dated snapshot
suffix (`claude-haiku-4-5` is `claude-haiku-4-5-20251001`).

---

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