LlmCore.LLM.Native.Config (llm_core v0.8.1)

Copy Markdown View Source

The [native] configuration for the Native agentic loop.

llm_core ships no native cascade, default models, or model-routing patterns: which providers a deployment can run, and in what order, is that deployment's decision. Configure it in any config layer (bundled base, home, project, LLM_CORE_CONFIG):

[native]
cascade = ["my_local", "my_cloud"]

[native.default_models]
my_cloud = "some-model-id"

[[native.model_routing]]
pattern = "some-substring"
provider = "my_cloud"

When cascade is missing or empty, the Native loop falls back to the single provider named by [routing] default (see LlmCore.Router). If that is also missing or cannot run the native loop, resolution fails with a structured {:no_native_provider, details} error instead of choosing a provider.

Precedence: config :llm_core, :native, ... (explicit Elixir app env) beats the merged TOML layers. The override replaces the whole [native] section; keys are not merged. The configuration is read on every call, so a config reload takes effect immediately; with the config store not running it reads as empty.

Summary

Functions

Returns the effective native config; every key is present, empty by default.

Normalizes a string- or atom-keyed [native] map into the internal shape.

Types

t()

@type t() :: %{
  cascade: [String.t()],
  default_models: %{optional(String.t()) => String.t()},
  model_routing: [%{optional(String.t()) => String.t()}]
}

Functions

get()

@spec get() :: t()

Returns the effective native config; every key is present, empty by default.

normalize(raw)

@spec normalize(map()) :: t()

Normalizes a string- or atom-keyed [native] map into the internal shape.