LlmCore.LLM.Appliance (llm_core v0.3.0)

Copy Markdown View Source

Generic local inference appliance provider (DGX Spark, future devices).

Assumes an OpenAI-compatible chat completion API exposed over HTTP.

Summary

Functions

Checks if the appliance base URL is configured and the health endpoint responds.

Returns the appliance capability map. Models and max_context are sourced from application config.

Discover configured appliances (future mDNS hook).

Perform a lightweight health check against the appliance.

Returns :local — Appliance is a local inference provider.

Sends a prompt to the appliance chat completions endpoint.

Streams a response from the appliance chat completions endpoint via SSE.

Functions

available?()

@spec available?() :: boolean()

Checks if the appliance base URL is configured and the health endpoint responds.

capabilities()

@spec capabilities() :: LlmCore.LLM.Provider.capabilities()

Returns the appliance capability map. Models and max_context are sourced from application config.

discover()

@spec discover() :: [{String.t() | binary(), URI.t()}]

Discover configured appliances (future mDNS hook).

health(url)

@spec health(String.t() | URI.t()) :: boolean()

Perform a lightweight health check against the appliance.

provider_type()

@spec provider_type() :: :local

Returns :local — Appliance is a local inference provider.

send(prompt, opts \\ [])

@spec send(
  LlmCore.LLM.Provider.prompt(),
  keyword()
) :: {:ok, LlmCore.LLM.Response.t()} | {:error, LlmCore.LLM.Error.t()}

Sends a prompt to the appliance chat completions endpoint.

stream(prompt, opts \\ [])

@spec stream(
  LlmCore.LLM.Provider.prompt(),
  keyword()
) :: {:ok, Enumerable.t()} | {:error, LlmCore.LLM.Error.t()}

Streams a response from the appliance chat completions endpoint via SSE.