Llm4sOpenAIModule

org.llm4s.llmconnect.provider.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 but have their own SDK-free clients, so they are not part of this module (#1132).

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.builtin.withModule(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
class Object
trait Matchable
class Any

Members list

Value members

Concrete methods

override def chatProviders: Seq[ProviderDescriptor]

The chat providers this module supplies.

The chat providers this module supplies.

Attributes

Definition Classes

The embedding providers this module supplies.

The embedding providers this module supplies.

Both lists default to empty, so a module contributes whichever halves it has: llm4s-anthropic overrides only chatProviders, a Voyage or Jina module only embeddingProviders, and llm4s-ollama both.

Attributes

Definition Classes