Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GPT4All Java Bindings and supported models list #216

Merged
merged 27 commits into from
Jul 3, 2023
Merged

Conversation

raulraja
Copy link
Contributor

@raulraja raulraja commented Jul 3, 2023

Fixes #215

This PR introduces the official GPT4ALL Java bindings, which provide access to GPT4All functionality. With the introduction of these bindings, we no longer need to maintain the llama.cpp binaries. The changes in this PR remove references to llama.cpp and replace them with the new GPT4ALL Java bindings.

The key changes in this PR are as follows:

  • Added the Gpt4AllModel class, which represents a GPT4All model and provides methods to fetch supported models from a JSON file.
  • Removed the GPT4AllModel interface, as it is no longer needed.
  • Removed the LLModel interface and its implementations (LlamaModel and GPTJModel), as they are no longer used.
  • Updated the GPT4All interface to use the new GPT4ALL Java bindings.
  • Modified the GPT4All.invoke() function to load the GPT4All model using the new bindings.
  • Updated the createCompletion() and createChatCompletion() functions in the GPT4All interface to use the new GPT4ALL Java bindings for generating completions.
  • Updated the main() function in the Chat.kt example to use the new GPT4ALL Java bindings and the Gpt4AllModel.supportedModels() function to display the supported models.
  • Removed references to llama.cpp and related binaries from the codebase.
  • Updated the build configuration to include the Kotlin Serialization plugin.

raulraja and others added 26 commits June 21, 2023 22:22
# Conflicts:
#	core/src/commonMain/kotlin/com/xebia/functional/xef/llm/openai/OpenAIEmbeddings.kt
# Conflicts:
#	core/src/commonMain/kotlin/com/xebia/functional/xef/auto/CoreAIScope.kt
#	core/src/commonMain/kotlin/com/xebia/functional/xef/llm/models/functions/CFunction.kt
#	core/src/commonMain/kotlin/com/xebia/functional/xef/llm/openai/models.kt
#	kotlin/src/commonMain/kotlin/com/xebia/functional/xef/auto/DeserializerLLMAgent.kt
#	kotlin/src/commonMain/kotlin/com/xebia/functional/xef/auto/serialization/functions/FunctionSchema.kt
#	scala/src/main/scala/com/xebia/functional/xef/scala/auto/package.scala
… and java depends on openai module for defaults. xef core does not depend on open ai
# Conflicts:
#	core/src/commonMain/kotlin/com/xebia/functional/xef/auto/AI.kt
#	core/src/commonMain/kotlin/com/xebia/functional/xef/auto/AIRuntime.kt
#	core/src/commonMain/kotlin/com/xebia/functional/xef/auto/AiDsl.kt
#	core/src/commonMain/kotlin/com/xebia/functional/xef/auto/CoreAIScope.kt
#	core/src/commonMain/kotlin/com/xebia/functional/xef/llm/models/chat/Message.kt
#	core/src/commonMain/kotlin/com/xebia/functional/xef/llm/models/chat/Role.kt
#	core/src/commonMain/kotlin/com/xebia/functional/xef/llm/models/text/CompletionRequest.kt
#	examples/kotlin/src/main/kotlin/com/xebia/functional/xef/auto/CustomRuntime.kt
#	java/src/main/java/com/xebia/functional/xef/java/auto/AIScope.java
#	openai/src/commonMain/kotlin/com/xebia/functional/xef/auto/llm/openai/DeserializerLLMAgent.kt
#	openai/src/commonMain/kotlin/com/xebia/functional/xef/auto/llm/openai/ImageGenerationAgent.kt
#	openai/src/commonMain/kotlin/com/xebia/functional/xef/auto/llm/openai/MockAIClient.kt
#	openai/src/commonMain/kotlin/com/xebia/functional/xef/auto/llm/openai/OpenAIClient.kt
#	openai/src/commonMain/kotlin/com/xebia/functional/xef/auto/llm/openai/OpenAIEmbeddings.kt
#	openai/src/commonMain/kotlin/com/xebia/functional/xef/auto/llm/openai/OpenAIRuntime.kt
#	scala/src/main/scala/com/xebia/functional/xef/scala/auto/package.scala
… local models. Local models can be use in the AI DSL and interleaved with any model.
@raulraja raulraja linked an issue Jul 3, 2023 that may be closed by this pull request
@raulraja
Copy link
Contributor Author

raulraja commented Jul 3, 2023

@xebia-functional/team-ai

diesalbla
diesalbla previously approved these changes Jul 3, 2023
Base automatically changed from gpt-4all-aiclient to main July 3, 2023 18:26
@raulraja raulraja dismissed diesalbla’s stale review July 3, 2023 18:26

The base branch was changed.

# Conflicts:
#	core/src/commonMain/kotlin/com/xebia/functional/xef/auto/CoreAIScope.kt
#	core/src/commonMain/kotlin/com/xebia/functional/xef/auto/PromptConfiguration.kt
#	core/src/commonMain/kotlin/com/xebia/functional/xef/llm/Chat.kt
#	core/src/commonMain/kotlin/com/xebia/functional/xef/llm/ChatWithFunctions.kt
#	examples/kotlin/src/main/kotlin/com/xebia/functional/xef/auto/gpt4all/Chat.kt
#	examples/kotlin/src/main/kotlin/com/xebia/functional/xef/auto/manual/NoAI.kt
#	gpt4all-kotlin/build.gradle.kts
#	gpt4all-kotlin/src/jvmMain/kotlin/com/xebia/functional/gpt4all/GPT4All.kt
#	gpt4all-kotlin/src/jvmMain/kotlin/com/xebia/functional/gpt4all/GPT4AllModel.kt
#	gpt4all-kotlin/src/jvmMain/kotlin/com/xebia/functional/gpt4all/HuggingFaceLocalEmbeddings.kt
#	openai/src/commonMain/kotlin/com/xebia/functional/xef/auto/llm/openai/DeserializerLLMAgent.kt
#	openai/src/commonMain/kotlin/com/xebia/functional/xef/auto/llm/openai/OpenAIClient.kt
#	openai/src/commonMain/kotlin/com/xebia/functional/xef/auto/llm/openai/OpenAIEmbeddings.kt
@raulraja raulraja merged commit b47e93e into main Jul 3, 2023
@raulraja raulraja deleted the gpt4all-java-bindings branch July 3, 2023 18:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Keep ggml and llama.cpp dependencies up to date.
3 participants