LLMDB.Provider (LLM DB v2025.12.4)
View SourceProvider struct with Zoi schema validation.
Represents an LLM provider with metadata including identity, base URL, environment variables, and documentation.
Summary
Functions
Creates a new Provider struct from a map, validating with Zoi schema.
Creates a new Provider struct from a map, raising on validation errors.
Returns the Zoi schema for Provider
Types
@type t() :: %LLMDB.Provider{ alias_of: nil | atom(), base_url: nil | binary(), config_schema: nil | [ %{ optional(:default) => nil | any(), :name => binary(), :type => binary(), optional(:doc) => nil | binary(), required: boolean() } ], doc: nil | binary(), env: nil | [binary()], exclude_models: nil | [binary()], extra: nil | map(), id: atom(), name: nil | binary() }
Functions
Creates a new Provider struct from a map, validating with Zoi schema.
Examples
iex> LLMDB.Provider.new(%{id: :openai, name: "OpenAI"})
{:ok, %LLMDB.Provider{id: :openai, name: "OpenAI"}}
iex> LLMDB.Provider.new(%{})
{:error, _validation_errors}
Creates a new Provider struct from a map, raising on validation errors.
Examples
iex> LLMDB.Provider.new!(%{id: :openai, name: "OpenAI"})
%LLMDB.Provider{id: :openai, name: "OpenAI"}
Returns the Zoi schema for Provider