adk_local_model_endpoint (erlang_adk v0.9.0)

View Source

Security boundary for keyless, same-machine OpenAI-compatible models.

Ordinary compatible endpoints require HTTPS. This module implements the one explicit exception: an operator-owned HTTP endpoint on a numeric loopback address, with no credential and no Live adapter. Materialization adds the transport's private-address permission together with an internal policy marker; public profile callers cannot supply either value.

Summary

Functions

Check the profile-wide invariants that cannot be established by validating the endpoint map alone.

Re-check the materialized policy at the compatible adapter boundary. This also protects trusted direct configurations from accidentally pairing the local opt-in marker with a credential, a non-loopback URL, or the default private-address rejection policy.

Types

endpoint/0

-type endpoint() ::
          #{scheme := http,
            host := binary(),
            port := pos_integer(),
            base_path := binary(),
            policy := loopback_keyless}.

Functions

is_endpoint(Endpoint)

-spec is_endpoint(term()) -> boolean().

materialize(Endpoint)

-spec materialize(term()) -> {ok, map()} | {error, term()}.

normalize(Endpoint)

-spec normalize(term()) -> {ok, endpoint()} | {error, term()}.

validate_profile(Endpoint, RequestAdapter, LiveAdapter, Credential, RequestOptions)

-spec validate_profile(term(), term(), term(), term(), term()) -> ok | {error, term()}.

Check the profile-wide invariants that cannot be established by validating the endpoint map alone.

validate_runtime(Config)

-spec validate_runtime(term()) -> ok | {error, term()}.

Re-check the materialized policy at the compatible adapter boundary. This also protects trusted direct configurations from accidentally pairing the local opt-in marker with a credential, a non-loopback URL, or the default private-address rejection policy.