# `LlmCore.Provider.Registry`
[🔗](https://github.com/fosferon/llm_core/blob/v0.3.0/lib/llm_core/provider/registry.ex#L1)

In-memory accessors for provider definitions loaded from TOML configuration.

The registry reads provider metadata from `LlmCore.Config.Store` so callers
can inspect capabilities, resolve modules, find providers by alias, and get
fuzzy suggestions — all without touching disk.

## Querying Providers

    # All configured providers (keyed by id)
    LlmCore.Provider.Registry.all()
    #=> %{"anthropic" => %Definition{...}, "openai" => %Definition{...}, ...}

    # Only available providers (enabled, API key present / binary found)
    LlmCore.Provider.Registry.available()

    # By exact id
    {:ok, def} = LlmCore.Provider.Registry.fetch("anthropic")

    # By implementing module
    {:ok, def} = LlmCore.Provider.Registry.lookup_by_module(LlmCore.LLM.OpenAI)

    # By alias (returns all matching)
    defs = LlmCore.Provider.Registry.lookup_alias("claude")

    # Fuzzy suggestions (Jaro distance)
    LlmCore.Provider.Registry.suggest_alias("claud")
    #=> ["claude"]

    # Capable providers for requirements
    LlmCore.Provider.Registry.suggest_capable(%{streaming: true, tool_use: true})
    #=> [%{alias: "claude", provider: "anthropic", cost_tier: "premium", ...}]

# `all`

```elixir
@spec all() :: %{optional(String.t()) =&gt; LlmCore.Provider.Definition.t()}
```

Returns the map of all provider definitions keyed by provider id.

# `available`

```elixir
@spec available() :: [LlmCore.Provider.Definition.t()]
```

Returns only providers that are currently available (enabled and healthy).

# `fetch`

```elixir
@spec fetch(String.t()) ::
  {:ok, LlmCore.Provider.Definition.t()} | {:error, :not_found}
```

Fetches a provider by id.

# `lookup_alias`

```elixir
@spec lookup_alias(String.t()) :: [LlmCore.Provider.Definition.t()]
```

Fetches provider definitions whose alias list contains the given alias.

# `lookup_by_module`

```elixir
@spec lookup_by_module(module()) ::
  {:ok, LlmCore.Provider.Definition.t()} | {:error, :not_found}
```

Finds a provider definition by the implementing module.

# `suggest_alias`

```elixir
@spec suggest_alias(
  String.t(),
  keyword()
) :: [String.t()]
```

Suggests provider aliases that closely match the given term.

# `suggest_capable`

```elixir
@spec suggest_capable(
  map(),
  keyword()
) :: [map()]
```

Suggests providers capable of meeting the given capability requirements.
Returns metadata so callers can surface cost tiers/model availability.

---

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