Module agentforge4j.llm
Package com.agentforge4j.llm
package com.agentforge4j.llm
LLM implementation support: client resolution, service discovery, and provider wiring.
The reusable LLM contract lives in com.agentforge4j.llm.api. This package contains
implementation-layer types used to construct, register, and resolve provider clients without
making the runtime depend on vendor SDKs.
Key types:
LlmClientFactory— constructs clients fromLlmClientConfigurationLlmClientResolver— selects a client by provider idLlmClientConfiguration— provider client configuration
Core invocation contracts such as LlmClient,
LlmExecutionRequest, and
LlmInvocationException are defined in the API module.
-
ClassDescriptionBase
LlmClientfor HTTP JSON APIs: shared validation, transport, logging, and error wrapping.In-memoryModelTierResolverbacked by a static provider→tier→model map.DefaultLlmClientResolver: builds an immutable map of provider id toLlmClient.Settings used to construct anLlmClientfor one provider: provider id, default model, and HTTP connect timeout.Provider-owned mapping from a provider'sagentforge4j.llm.<providerId>.*configuration subtree to a neutralLlmClientConfiguration.Factory for creatingLlmClientinstances for one provider.Inputs passed toLlmClientFactory.create(LlmClientFactoryContext): the JSON mapper, the neutral providerLlmClientConfiguration, and theLlmSecretResolvera provider uses to resolve its credential reference.Resolves a provider id string to the configuredLlmClient.Shared validation forLlmExecutionRequestacross HTTP and non-HTTP clients.Thrown for provider configuration-time failures: an unknown provider, a missing or invalid provider option, an unresolvable credential reference, or a duplicate provider contributor.Validated, provider-specific configuration transport for the LLM SPI.A resolved LLM provider credential.An opaque reference to an LLM provider credential, carried through neutral provider configuration so a raw credential value never has to travel through the wiring layer.Resolves anLlmSecretReferenceto a liveLlmSecretat the point of use.Small builder for the canonical dotted provider-option map emitted byLlmClientConfigurationAdapterimplementations.Provider-scoped lookup of a single raw property value, backingRawProviderConfiguration.Immutable neutral view over a provider'sagentforge4j.llm.<providerId>.*configuration subtree, handed to aLlmClientConfigurationAdapter.Wraps an LLM client with retry logic for transient failures (decorrelated jitter backoff).Wraps an LLM client resolver with retrying clients (cached per normalized provider id).The shipped OSS default mapping ofModelTierto a concrete, versioned model string for each of the nine built-in providers.StandardLlmClientConfigurationshape shared by every provider'sLlmClientConfigurationAdapter.