Package com.tnsai.llm
Interface LLMClientProvider
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
SPI for creating LLM clients from provider configuration.
This interface decouples the core framework from concrete LLM provider
implementations. The tnsai-llm module provides the default
implementation via SpiLoader.
- Since:
- 0.0.2
- See Also:
-
Method Summary
-
Method Details
-
create
Creates an LLM client from the given configuration.- Parameters:
provider- the provider name (e.g., "ollama", "openai", "anthropic")model- the model nametemperature- the sampling temperature (0.0-2.0)maxTokens- optional max tokens (null for provider default)topP- optional top-p nucleus sampling (null for provider default)- Returns:
- the created LLM client
- Throws:
IllegalArgumentException- if provider is unknown or model is empty
-
discover
Discovers the first available LLMClientProvider via ServiceLoader.- Returns:
- the provider if available
-