Behaviour for LLM inference providers.
Each adapter (Ollama, OpenAI, Anthropic, etc.) implements this behaviour to provide a uniform interface for chat completion and model listing.
Adapters receive a ModelProfile that declares model capabilities upfront.
All provider/model-specific serialization decisions are driven by the profile —
no runtime detection, no retry-on-error branching.
Summary
Callbacks
Sends a chat completion request and returns the full response.
Generates embeddings for the given text input.
Lists available models from the provider.
Sends a streaming chat completion request.
Types
@type stream_event() :: {:data, Arcanum.Response.t()} | {:error, term()} | :done
Callbacks
@callback chat( provider :: map(), intent :: Arcanum.Intent.t(), profile :: Arcanum.ModelProfile.t() ) :: {:ok, Arcanum.Response.t()} | {:error, term()}
Sends a chat completion request and returns the full response.
@callback embed(provider :: map(), model :: String.t(), input :: String.t()) :: {:ok, [float()]} | {:error, term()}
Generates embeddings for the given text input.
Lists available models from the provider.
@callback stream( provider :: map(), intent :: Arcanum.Intent.t(), profile :: Arcanum.ModelProfile.t() ) :: {:ok, Enumerable.t()} | {:error, term()}
Sends a streaming chat completion request.
Returns a stream of {:data, response} events, terminated by :done.