View Source HyperLLM.Model (hyper_llm v0.6.0)

Determine the provider and model for a given model name.

Summary

Functions

List all registered provider modules.

Parse a model string into a provider and model.

Types

config()

@type config() :: [Keyword.t()]

t()

@type t() :: %HyperLLM.Model{config: term(), model: term(), provider: term()}

Functions

list_providers()

List all registered provider modules.

Example:

iex> HyperLLM.Model.list_providers()
["anthropic", "cloudflare", "groq", "llama_cpp", "mistral", "ollama", "openai", "x_ai"]

new!(opts)

parse_model(model)

Parse a model string into a provider and model.

Example:

iex> HyperLLM.Model.parse_model("openai/gpt-4o-mini")
{:ok, {HyperLLM.Provider.OpenAI, "gpt-4o-mini"}}

iex> HyperLLM.Model.parse_model("anthropic/claude-3-5-sonnet-20240620")
{:ok, {HyperLLM.Provider.Anthropic, "claude-3-5-sonnet-20240620"}}