Candil.Health (Candil v2.1.0)

Copy Markdown View Source

Health checks for LLM/embedding providers.

Probes a provider endpoint and returns connectivity status, latency, and model availability. Used by higher-level diagnostics tools (e.g., Botica.Doctor) to surface actionable status to the user.

Summary

Types

t()

Health status for a single provider

Functions

Runs a quick SELECT-1 equivalent for LLM providers: sends a minimal embedding request to verify the model is actually loaded and responding.

Probes a provider endpoint and returns its health status.

Types

t()

@type t() :: %Candil.Health{
  error: String.t() | nil,
  latency_ms: non_neg_integer() | nil,
  models_available: non_neg_integer() | nil,
  provider: String.t(),
  reachable: boolean()
}

Health status for a single provider

Functions

ping(url, model, opts \\ [])

@spec ping(String.t(), String.t(), keyword()) :: :ok | {:error, String.t()}

Runs a quick SELECT-1 equivalent for LLM providers: sends a minimal embedding request to verify the model is actually loaded and responding.

probe(url, opts \\ [])

@spec probe(
  String.t(),
  keyword()
) :: t()

Probes a provider endpoint and returns its health status.

Options

  • :timeout — request timeout in ms (default: 5_000)
  • :api_key — optional API key for authenticated providers