Llm4sOpenAIModule
Registers llm4s-openai's providers: the three that share OpenAIClient - OpenAI (id openai), Azure OpenAI (azure) and Requesty (requesty) - and the OpenAI embedding provider (openai).
OpenRouter, DeepSeek and Z.ai speak the same wire format without an SDK, so they are llm4s-openai-compatible's, on its shared OpenAICompatibleClient (#1132). This module depends on that one for OpenAIConfig.
Declared in this module's META-INF/services/org.llm4s.llmconnect.spi.Llm4sProviderModule, so adding the llm4s-openai dependency is all it takes for ProviderRegistry.default to resolve provider = "openai", "azure" and "requesty", and EMBEDDING_MODEL=openai/<model>. Where discovery cannot run - a fat jar whose services files were overwritten rather than merged - register it explicitly:
given ProviderRegistry = ProviderRegistry.ofModules(new Llm4sOpenAIModule)
A class rather than an object because java.util.ServiceLoader instantiates the class named in the services file through its public no-arg constructor.
Attributes
- Graph
-
- Supertypes