PtcRunner.LLM.DefaultRegistry (PtcRunner v0.10.1)

Copy Markdown View Source

Default model registry with built-in aliases for common LLM providers.

Supports multiple providers with unified aliases:

  • "haiku" -> Uses default provider (configurable)
  • "bedrock:haiku" -> AWS Bedrock
  • "openrouter:haiku" -> OpenRouter

Provider Formats

  • "alias" - Use default provider with alias (e.g., "haiku")
  • "provider:alias" - Specific provider with alias (e.g., "bedrock:haiku")
  • "provider:full/path" - Direct model ID (e.g., "openrouter:anthropic/claude-haiku-4.5")
  • "ollama:model" - Local Ollama model

Configuration

config :ptc_runner, :default_provider, :bedrock

Or via environment variable:

export LLM_DEFAULT_PROVIDER=bedrock

Summary

Functions

Get detailed info for a model by alias name.

Functions

get_model_info(alias_name)

@spec get_model_info(String.t()) :: map() | nil

Get detailed info for a model by alias name.

Returns a map with :alias, :description, and :providers keys, or nil if the alias is not found. This is a plain function on DefaultRegistry only — not part of the Registry behaviour.

Examples

iex> info = PtcRunner.LLM.DefaultRegistry.get_model_info("haiku")
iex> info.alias
"haiku"
iex> info.description
"Claude Haiku 4.5 - Fast, cost-effective"
iex> Map.has_key?(info.providers, :openrouter)
true

iex> PtcRunner.LLM.DefaultRegistry.get_model_info("nonexistent")
nil