https://github.com/parakeet-nest/parakeet4j
🦜🪺☕️ Parakeet4J is a Java library, made to simplify the development of small generative AI applications with Ollama 🦙.
https://github.com/parakeet-nest/parakeet4j
ai genai java llm ollama slm
Last synced: 18 days ago
JSON representation
🦜🪺☕️ Parakeet4J is a Java library, made to simplify the development of small generative AI applications with Ollama 🦙.
- Host: GitHub
- URL: https://github.com/parakeet-nest/parakeet4j
- Owner: parakeet-nest
- License: mit
- Created: 2024-06-07T06:32:22.000Z (about 2 years ago)
- Default Branch: main
- Last Pushed: 2024-08-17T20:50:02.000Z (almost 2 years ago)
- Last Synced: 2024-08-18T06:27:25.001Z (almost 2 years ago)
- Topics: ai, genai, java, llm, ollama, slm
- Language: Java
- Homepage:
- Size: 106 KB
- Stars: 2
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# 🦜🪺☕️ Parakeet4J
Parakeet4J is the simplest Java library to create **GenAI apps** with **[Ollama](https://ollama.com/)**.
> A GenAI app is an application that uses generative AI technology. Generative AI can create new text, images, or other content based on what it's been trained on. So a GenAI app could help you write a poem, design a logo, or even compose a song! These are still under development, but they have the potential to be creative tools for many purposes. - [Gemini](https://gemini.google.com)
> ✋ Parakeet4J is only for creating GenAI apps generating **text** (not image, music,...).
## Hello World!
```java
public class Hello
{
public static void main( String[] args )
{
Options options = new Options()
.setTemperature(0.0)
.setRepeatLastN(2);
var systemContent = "You are a useful AI agent, expert with programming";
var userContent = "Generate a Hello World program in GoLang.";
List messages = List.of(
new Message("system", systemContent),
new Message("user", userContent)
);
Query queryChat = new Query("deepseek-coder", options).setMessages(messages);
var resultAnswer = ChatStream("http://0.0.0.0:11434", queryChat,
chunk -> {
System.out.print(chunk.getMessage().getContent());
return null;
});
if(resultAnswer.exception().isEmpty()) {
System.out.println("🙂: " +
resultAnswer.getAnswer().getMessage().getContent()
);
} else {
System.out.println("😡: " +
resultAnswer.exception().toString()
);
}
}
}
```
## Install
This library project use the [GitHub Maven Registry](https://docs.github.com/en/packages/working-with-a-github-packages-registry/working-with-the-apache-maven-registry). So, to use it in your projects, use the following steps.
### First
Create (or update) a file: `~/.m2/settings.xml` with the following content
```xml
github
github
central
https://repo1.maven.org/maven2
github
https://maven.pkg.github.com/parakeet-nest/parakeet4j
true
github
your GitHub handle
your GitHub token
```
### Then
Add this section to your `pom.xml` file:
```xml
org.parakeetnest.parakeet4j
parakeet4j
0.0.7
```