diff --git a/build.gradle b/build.gradle index cd344966b18..85a0c904de9 100644 --- a/build.gradle +++ b/build.gradle @@ -327,7 +327,7 @@ dependencies { // YAML formatting implementation 'org.yaml:snakeyaml:2.3' - // AI + // region AI implementation 'dev.langchain4j:langchain4j:0.34.0' // Even though we use jvm-openai for LLM connection, we still need this package for tokenization. implementation('dev.langchain4j:langchain4j-open-ai:0.34.0') { @@ -336,9 +336,11 @@ dependencies { implementation('dev.langchain4j:langchain4j-mistral-ai:0.34.0') implementation('dev.langchain4j:langchain4j-google-ai-gemini:0.34.0') implementation('dev.langchain4j:langchain4j-hugging-face:0.34.0') - implementation 'ai.djl:api:0.30.0' - implementation 'ai.djl.pytorch:pytorch-model-zoo:0.30.0' - implementation 'ai.djl.huggingface:tokenizers:0.29.0' + + implementation platform('ai.djl:bom:0.30.0') + implementation 'ai.djl:api' + implementation 'ai.djl.huggingface:tokenizers' + implementation 'ai.djl.pytorch:pytorch-model-zoo' implementation 'io.github.stefanbratanov:jvm-openai:0.11.0' // openai depends on okhttp, which needs kotlin - see https://github.com/square/okhttp/issues/5299 for details implementation ('com.squareup.okhttp3:okhttp:4.12.0') { @@ -346,6 +348,7 @@ dependencies { } // GemxFX also (transitively) depends on kotlin implementation 'org.jetbrains.kotlin:kotlin-stdlib-jdk8:2.0.20' + // endregion implementation 'commons-io:commons-io:2.16.1' @@ -735,16 +738,14 @@ jlink { // TODO: Remove the following correction to the merged module // The module descriptor automatically generated by the plugin for the merged module contained some invalid entries. - // This is based on ./gradlew suggestMergedModuleInfo, sort, strip ";"", comment non-used modules, and include the suggested directives here. - // However, we need to fine-tune this manually (non-alphabetic order) + // This is based on ./gradlew suggestMergedModuleInfo, sort, strip ";"", remove non-used modules, and include the suggested directives here. mergedModule { - requires 'javafx.base' - requires 'javafx.controls' - requires 'javafx.fxml' - requires 'javafx.graphics' - requires 'javafx.media' - requires 'javafx.swing' - + requires 'com.google.gson' + requires 'com.fasterxml.jackson.annotation' + requires 'com.fasterxml.jackson.databind' + requires 'com.fasterxml.jackson.core' + requires 'com.fasterxml.jackson.datatype.jdk8' + requires 'jakarta.xml.bind' requires 'java.compiler' requires 'java.datatransfer' requires 'java.desktop' @@ -752,34 +753,43 @@ jlink { requires 'java.management' requires 'java.naming' requires 'java.net.http' + requires 'java.rmi' requires 'java.scripting' requires 'java.security.jgss' requires 'java.security.sasl' requires 'java.sql' requires 'java.sql.rowset' requires 'java.transaction.xa' - requires 'java.rmi' requires 'java.xml' + requires 'javafx.base' + requires 'javafx.controls' + requires 'javafx.fxml' + requires 'javafx.graphics' + requires 'javafx.media' + requires 'javafx.swing' requires 'jdk.jsobject' + requires 'jdk.security.jgss' requires 'jdk.unsupported' requires 'jdk.unsupported.desktop' - requires 'jdk.security.jgss' requires 'jdk.xml.dom' - requires 'com.google.gson' - requires 'org.jsoup' - requires 'org.slf4j' - requires 'jakarta.xml.bind' requires 'org.apache.commons.lang3' + requires 'org.apache.commons.logging' requires 'org.apache.commons.text' - requires 'org.apache.commons.logging'; - uses 'org.mariadb.jdbc.credential.CredentialPlugin' + requires 'org.freedesktop.dbus' + requires 'org.jsoup' + requires 'org.slf4j' + uses 'ai.djl.engine.EngineProvider' + uses 'ai.djl.repository.RepositoryFactory' + uses 'ai.djl.repository.zoo.ZooProvider' + uses 'dev.langchain4j.spi.prompt.PromptTemplateFactory' + uses 'kong.unirest.core.json.JsonEngine' + uses 'org.eclipse.jgit.lib.GpgSigner' + uses 'org.eclipse.jgit.transport.SshSessionFactory' + uses 'org.mariadb.jdbc.LocalInfileInterceptor' uses 'org.mariadb.jdbc.authentication.AuthenticationPlugin' + uses 'org.mariadb.jdbc.credential.CredentialPlugin' uses 'org.mariadb.jdbc.tls.TlsSocketPlugin' - uses 'org.mariadb.jdbc.LocalInfileInterceptor' - uses 'org.eclipse.jgit.transport.SshSessionFactory' - uses 'org.eclipse.jgit.lib.GpgSigner' - uses 'kong.unirest.core.json.JsonEngine'; - uses 'ai.djl.repository.zoo.ZooProvider'; + provides 'org.mariadb.jdbc.tls.TlsSocketPlugin' with 'org.mariadb.jdbc.internal.protocol.tls.DefaultTlsSocketPlugin' provides 'java.sql.Driver' with 'org.postgresql.Driver' provides 'org.mariadb.jdbc.authentication.AuthenticationPlugin' with 'org.mariadb.jdbc.internal.com.send.authentication.CachingSha2PasswordPlugin', @@ -797,9 +807,11 @@ jlink { 'org.bouncycastle.pqc.jcajce.provider.BouncyCastlePQCProvider' provides 'kong.unirest.core.json.JsonEngine' with 'kong.unirest.modules.gson.GsonEngine'; provides 'ai.djl.repository.zoo.ZooProvider' with 'ai.djl.engine.rust.zoo.RsZooProvider', - 'ai.djl.huggingface.zoo.HfZooProvider', - 'ai.djl.pytorch.zoo.PtZooProvider', - 'ai.djl.repository.zoo.DefaultZooProvider'; + 'ai.djl.huggingface.zoo.HfZooProvider', + 'ai.djl.pytorch.zoo.PtZooProvider', + 'ai.djl.repository.zoo.DefaultZooProvider'; + provides 'ai.djl.engine.EngineProvider' with 'ai.djl.engine.rust.RsEngineProvider', + 'ai.djl.pytorch.engine.PtEngineProvider'; } jpackage { diff --git a/src/main/java/module-info.java b/src/main/java/module-info.java index dc1fce79618..54e5cc04851 100644 --- a/src/main/java/module-info.java +++ b/src/main/java/module-info.java @@ -144,7 +144,7 @@ // region AI requires ai.djl.api; - uses ai.djl.repository.zoo.ZooProvider; + requires ai.djl.pytorch_model_zoo; requires ai.djl.tokenizers; requires jvm.openai; requires langchain4j; @@ -152,6 +152,10 @@ requires langchain4j.hugging.face; requires langchain4j.mistral.ai; requires langchain4j.open.ai; + uses ai.djl.engine.EngineProvider; + uses ai.djl.repository.RepositoryFactory; + uses ai.djl.repository.zoo.ZooProvider; + uses dev.langchain4j.spi.prompt.PromptTemplateFactory; // endregion // region: Lucene