From d407e35bfd1f016b8ad79d8bedf99fd778f9652c Mon Sep 17 00:00:00 2001 From: Emmanuel Hugonnet Date: Mon, 14 Oct 2024 10:31:33 +0200 Subject: [PATCH] Preparing the release Signed-off-by: Emmanuel Hugonnet --- .idea/.gitignore | 8 -- .idea/DigmaJCEFProjectPersistence.xml | 11 -- .idea/aws.xml | 11 -- .idea/compiler.xml | 82 ----------- .idea/encodings.xml | 35 ----- .idea/jarRepositories.xml | 20 --- .idea/misc.xml | 26 ---- .idea/uiDesigner.xml | 124 ---------------- .idea/vcs.xml | 6 - CODEOWNERS | 1 + CODE_OF_CONDUCT.md | 134 ++++++++++++++++++ CONTRIBUTING.md | 58 ++++++++ README.md | 37 ++++- SECURITY.md | 32 +++++ .../helidon-car-booking-portable-ext/pom.xml | 48 ++++++- examples/helidon-car-booking/pom.xml | 65 +++++++-- examples/helidon-car-booking/run-local.sh | 11 ++ 17 files changed, 369 insertions(+), 340 deletions(-) delete mode 100644 .idea/.gitignore delete mode 100644 .idea/DigmaJCEFProjectPersistence.xml delete mode 100644 .idea/aws.xml delete mode 100644 .idea/compiler.xml delete mode 100644 .idea/encodings.xml delete mode 100644 .idea/jarRepositories.xml delete mode 100644 .idea/misc.xml delete mode 100644 .idea/uiDesigner.xml delete mode 100644 .idea/vcs.xml create mode 100644 CODEOWNERS create mode 100644 CODE_OF_CONDUCT.md create mode 100644 CONTRIBUTING.md create mode 100644 SECURITY.md create mode 100755 examples/helidon-car-booking/run-local.sh diff --git a/.idea/.gitignore b/.idea/.gitignore deleted file mode 100644 index 13566b8..0000000 --- a/.idea/.gitignore +++ /dev/null @@ -1,8 +0,0 @@ -# Default ignored files -/shelf/ -/workspace.xml -# Editor-based HTTP Client requests -/httpRequests/ -# Datasource local storage ignored files -/dataSources/ -/dataSources.local.xml diff --git a/.idea/DigmaJCEFProjectPersistence.xml b/.idea/DigmaJCEFProjectPersistence.xml deleted file mode 100644 index 7106797..0000000 --- a/.idea/DigmaJCEFProjectPersistence.xml +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - - - - - - \ No newline at end of file diff --git a/.idea/aws.xml b/.idea/aws.xml deleted file mode 100644 index b63b642..0000000 --- a/.idea/aws.xml +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/.idea/compiler.xml b/.idea/compiler.xml deleted file mode 100644 index da2d3e9..0000000 --- a/.idea/compiler.xml +++ /dev/null @@ -1,82 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/.idea/encodings.xml b/.idea/encodings.xml deleted file mode 100644 index 92519c8..0000000 --- a/.idea/encodings.xml +++ /dev/null @@ -1,35 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/.idea/jarRepositories.xml b/.idea/jarRepositories.xml deleted file mode 100644 index 712ab9d..0000000 --- a/.idea/jarRepositories.xml +++ /dev/null @@ -1,20 +0,0 @@ - - - - - - - - - - - \ No newline at end of file diff --git a/.idea/misc.xml b/.idea/misc.xml deleted file mode 100644 index 408f87e..0000000 --- a/.idea/misc.xml +++ /dev/null @@ -1,26 +0,0 @@ - - - - - - - - - - - - - - \ No newline at end of file diff --git a/.idea/uiDesigner.xml b/.idea/uiDesigner.xml deleted file mode 100644 index 2b63946..0000000 --- a/.idea/uiDesigner.xml +++ /dev/null @@ -1,124 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/.idea/vcs.xml b/.idea/vcs.xml deleted file mode 100644 index 35eb1dd..0000000 --- a/.idea/vcs.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/CODEOWNERS b/CODEOWNERS new file mode 100644 index 0000000..17c2244 --- /dev/null +++ b/CODEOWNERS @@ -0,0 +1 @@ +.github @smallrye/llm \ No newline at end of file diff --git a/CODE_OF_CONDUCT.md b/CODE_OF_CONDUCT.md new file mode 100644 index 0000000..531490a --- /dev/null +++ b/CODE_OF_CONDUCT.md @@ -0,0 +1,134 @@ + +# Contributor Covenant Code of Conduct + +## Our Pledge + +We as members, contributors, and leaders pledge to make participation in our +community a harassment-free experience for everyone, regardless of age, body +size, visible or invisible disability, ethnicity, sex characteristics, gender +identity and expression, level of experience, education, socio-economic status, +nationality, personal appearance, race, caste, color, religion, or sexual +identity and orientation. + +We pledge to act and interact in ways that contribute to an open, welcoming, +diverse, inclusive, and healthy community. + +## Our Standards + +Examples of behavior that contributes to a positive environment for our +community include: + +* Demonstrating empathy and kindness toward other people +* Being respectful of differing opinions, viewpoints, and experiences +* Giving and gracefully accepting constructive feedback +* Accepting responsibility and apologizing to those affected by our mistakes, + and learning from the experience +* Focusing on what is best not just for us as individuals, but for the overall + community + +Examples of unacceptable behavior include: + +* The use of sexualized language or imagery, and sexual attention or advances of + any kind +* Trolling, insulting or derogatory comments, and personal or political attacks +* Public or private harassment +* Publishing others' private information, such as a physical or email address, + without their explicit permission +* Other conduct which could reasonably be considered inappropriate in a + professional setting + +## Enforcement Responsibilities + +Community leaders are responsible for clarifying and enforcing our standards of +acceptable behavior and will take appropriate and fair corrective action in +response to any behavior that they deem inappropriate, threatening, offensive, +or harmful. + +Community leaders have the right and responsibility to remove, edit, or reject +comments, commits, code, wiki edits, issues, and other contributions that are +not aligned to this Code of Conduct, and will communicate reasons for moderation +decisions when appropriate. + +## Scope + +This Code of Conduct applies within all community spaces, and also applies when +an individual is officially representing the community in public spaces. +Examples of representing our community include using an official e-mail address, +posting via an official social media account, or acting as an appointed +representative at an online or offline event. + +## Enforcement + +Instances of abusive, harassing, or otherwise unacceptable behavior may be +reported to the community leaders responsible for enforcement: +Farah Juma - fjuma@redhat.com. +All complaints will be reviewed and investigated promptly and fairly. + +All community leaders are obligated to respect the privacy and security of the +reporter of any incident. + +## Enforcement Guidelines + +Community leaders will follow these Community Impact Guidelines in determining +the consequences for any action they deem in violation of this Code of Conduct: + +### 1. Correction + +**Community Impact**: Use of inappropriate language or other behavior deemed +unprofessional or unwelcome in the community. + +**Consequence**: A private, written warning from community leaders, providing +clarity around the nature of the violation and an explanation of why the +behavior was inappropriate. A public apology may be requested. + +### 2. Warning + +**Community Impact**: A violation through a single incident or series of +actions. + +**Consequence**: A warning with consequences for continued behavior. No +interaction with the people involved, including unsolicited interaction with +those enforcing the Code of Conduct, for a specified period of time. This +includes avoiding interactions in community spaces as well as external channels +like social media. Violating these terms may lead to a temporary or permanent +ban. + +### 3. Temporary Ban + +**Community Impact**: A serious violation of community standards, including +sustained inappropriate behavior. + +**Consequence**: A temporary ban from any sort of interaction or public +communication with the community for a specified period of time. No public or +private interaction with the people involved, including unsolicited interaction +with those enforcing the Code of Conduct, is allowed during this period. +Violating these terms may lead to a permanent ban. + +### 4. Permanent Ban + +**Community Impact**: Demonstrating a pattern of violation of community +standards, including sustained inappropriate behavior, harassment of an +individual, or aggression toward or disparagement of classes of individuals. + +**Consequence**: A permanent ban from any sort of public interaction within the +community. + +## Attribution + +This Code of Conduct is adapted from the [Contributor Covenant][homepage], +version 2.1, available at +[https://www.contributor-covenant.org/version/2/1/code_of_conduct.html][v2.1]. + +Community Impact Guidelines were inspired by +[Mozilla's code of conduct enforcement ladder][Mozilla CoC]. + +For answers to common questions about this code of conduct, see the FAQ at +[https://www.contributor-covenant.org/faq][FAQ]. Translations are available at +[https://www.contributor-covenant.org/translations][translations]. + +[homepage]: https://www.contributor-covenant.org +[v2.1]: https://www.contributor-covenant.org/version/2/1/code_of_conduct.html +[Mozilla CoC]: https://github.com/mozilla/diversity +[FAQ]: https://www.contributor-covenant.org/faq +[translations]: https://www.contributor-covenant.org/translations + diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 0000000..83110a6 --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,58 @@ +Contributing to smallrye-llm +================================== + +Welcome to the smallrye-llm project! We welcome contributions from the community. This guide will walk you through the steps for getting started on our project. + +- [Contributing Guidelines](#contributing-guidelines) +- [Issues](#issues) + - [Good First Issues](#good-first-issues) +- [Setting up your Developer Environment](#setting-up-your-developer-environment) +- [Community](#community) + +## Contributing Guidelines + +Please refer to our Wiki for the https://github.com/smallrye/smallrye/[Contribution Guidelines]. + + +## Issues +The smallrye-llm project uses GitHub to manage issues. All issues can be found [here](https://github.com/smallrye/smallrye-llm/issues). + +To create a new issue, comment on an existing issue, or assign an issue to yourself, you'll need to first [create a GitHub account](https://github.com/). + + +### Good First Issues +Want to contribute to the smallrye-llm project but aren't quite sure where to start? Check out our issues with the `good first issue` label. These are a triaged set of issues that are great for getting started on our project. These can be found [here](https://github.com/smallrye/smallrye-llm/labels/good%20first%20issue). + +Once you have selected an issue you'd like to work on, make sure it's not already assigned to someone else, and assign it to yourself. + +It is recommended that you use a separate branch for every issue you work on. To keep things straightforward and memorable, you can name each branch using the GitHub issue number. This way, you can have multiple PRs open for different issues. For example, if you were working on [issue-125](https://github.com/smallrye/smallrye-llm/issues/125), you could use issue-125 as your branch name. + +## Setting up your Developer Environment +You will need: + +* Python 3.12+ +* Git +* An [IDE](https://en.wikipedia.org/wiki/Comparison_of_integrated_development_environments#Java) +(e.g., [Apache NetBeans](https://netbeans.apache.org/)) + +To setup your development environment you need to: + +1. First `cd` to the directory where you cloned the project (eg: `cd smallrye-llm`) + +2. To build `smallrye-llm` run: + + ``` + mvn clean install + ``` + +3. To run the tests: + + ``` + mvn test + ``` + +## Code Reviews + +All submissions, including submissions by project members, need to be reviewed by at least one smallrye-llm committer before being merged. + +The [GitHub Pull Request Review Process](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/reviewing-changes-in-pull-requests/about-pull-request-reviews) is followed for every pull request. \ No newline at end of file diff --git a/README.md b/README.md index e1ff4ea..060da27 100644 --- a/README.md +++ b/README.md @@ -1,16 +1,41 @@ -# smallrye-llm +# 🚀 Smallrye LLM + Experimentation around LLM and MicroProfile -## How to run examples. +## How to run examples + +### Use LM Studio -### Install LM Sutdio +#### Install LM Sutdio https://lmstudio.ai/ -### Download model +#### Download model Mistral 7B Instruct v0.2 -### Run +#### Run + +On left goto "local server", select the model in dropdown combo on the top, then start server + +### Use Ollama + +Running Ollama with the llama3.1 model: + +```shell +$CONTAINER_ENGINE= podman | docker +$CONTAINER_ENGINE run -d --rm --name ollama --replace --pull=always -p 11434:11434 -v ollama:/root/.ollama --stop-signal=SIGKILL docker.io/ollama/ollama +$CONTAINER_ENGINE exec -it ollama ollama run llama3.1 +``` + +### Run the examples + +Go to each example READEM.md to see how to execute the example. + +## Contributing +If you want to contribute, please have a look to [CONTRIBUTING.md](CONTRIBUTING.md) + +## License + +This project is licensed under the Apache License 2.0 - see the [LICENSE](LICENSE) file for details. -On left goto "local server", select the model in dropdown combo on the top, then start server \ No newline at end of file diff --git a/SECURITY.md b/SECURITY.md new file mode 100644 index 0000000..0382d7e --- /dev/null +++ b/SECURITY.md @@ -0,0 +1,32 @@ +# Reporting of CVEs and Security Issues + +## The Smallrye LLM community takes security bugs very seriously + +We aim to take immediate action to address serious security-related problems that involve our project. + +Note that we will only fix such issues in the most recent minor release of Smallrye LLM. + +## Reporting of Security Issues + +When reporting a security vulnerability it is important to not accidentally broadcast to the world that +the issue exists, as this makes it easier for people to exploit it. The software industry uses the term +embargo to describe the time a +security issue is known internally until it is public knowledge. + +Our preferred way of reporting security issues in Smallrye LLM is listed below. + +### Email the Smallrye LLM team + +To report a security issue, please email ehugonne@redhat.com and/or +yann.blazart@bycode.fr. A member of the Smallrye LLM team will +open the required issues. + +### Other considerations + +If you would like to work with us on a fix for the security vulnerability, please include your GitHub username +in the above email, and we will provide you access to a temporary private fork where we can collaborate on a +fix without it being disclosed publicly, **including in your own publicly visible git repository**. + +Do not open a public issue, send a pull request, or disclose any information about the suspected vulnerability +publicly, **including in your own publicly visible git repository**. If you discover any publicly disclosed +security vulnerabilities, please notify us immediately through the emails listed in the section above. diff --git a/examples/helidon-car-booking-portable-ext/pom.xml b/examples/helidon-car-booking-portable-ext/pom.xml index bf4d283..fa825de 100644 --- a/examples/helidon-car-booking-portable-ext/pom.xml +++ b/examples/helidon-car-booking-portable-ext/pom.xml @@ -1,7 +1,7 @@ + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 io.smallrye.llm.examples @@ -13,6 +13,7 @@ SmallRye LLM Examples: Helidon Car Booking Portable Extension + io.helidon.Main 0.34.0 @@ -75,6 +76,19 @@ jersey-media-json-binding runtime + + jakarta.inject + jakarta.inject-api + + + jakarta.enterprise + jakarta.enterprise.cdi-api + compile + + + jakarta.enterprise + jakarta.enterprise.lang-model + io.smallrye @@ -147,6 +161,7 @@ + ${project.artifactId} src/main/resources @@ -164,9 +179,38 @@ copy-libs + prepare-package + + copy-dependencies + + + ${project.build.directory}/libs + false + false + true + true + runtime + + okio + + + org.apache.maven.plugins + maven-jar-plugin + + + + true + libs + + ${mainClass} + false + + + + io.smallrye jandex-maven-plugin diff --git a/examples/helidon-car-booking/pom.xml b/examples/helidon-car-booking/pom.xml index deb293e..062fbea 100644 --- a/examples/helidon-car-booking/pom.xml +++ b/examples/helidon-car-booking/pom.xml @@ -1,7 +1,7 @@ + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 io.smallrye.llm.examples @@ -13,6 +13,7 @@ SmallRye LLM Examples: Helidon Car Booking + io.helidon.Main 0.34.0 @@ -70,6 +71,23 @@ jakarta.json.bind jakarta.json.bind-api + + jakarta.annotation + jakarta.annotation-api + + + jakarta.inject + jakarta.inject-api + + + jakarta.enterprise + jakarta.enterprise.cdi-api + compile + + + jakarta.enterprise + jakarta.enterprise.lang-model + org.glassfish.jersey.media jersey-media-json-binding @@ -91,7 +109,6 @@ dev.langchain4j langchain4j - ${dev.langchain4j.version} dev.langchain4j @@ -147,6 +164,7 @@ + ${project.artifactId} src/main/resources @@ -159,20 +177,49 @@ - org.apache.maven.plugins - maven-dependency-plugin + io.smallrye + jandex-maven-plugin - copy-libs + make-index - io.smallrye - jandex-maven-plugin + org.apache.maven.plugins + maven-jar-plugin + + + + true + libs + + ${mainClass} + false + + + + + + org.apache.maven.plugins + maven-dependency-plugin - make-index + copy-libs + prepare-package + + copy-dependencies + + + ${project.build.directory}/libs + false + false + true + true + runtime + + okio + diff --git a/examples/helidon-car-booking/run-local.sh b/examples/helidon-car-booking/run-local.sh new file mode 100755 index 0000000..31a23c1 --- /dev/null +++ b/examples/helidon-car-booking/run-local.sh @@ -0,0 +1,11 @@ +#bin/bash + +ENGINE="${CONTAINER_ENGINE:-podman}" + +$ENGINE stop ollama +$ENGINE run -d --name ollama --replace --pull=always --restart=always -p 11434:11434 -v ollama:/root/.ollama --stop-signal=SIGKILL docker.io/ollama/ollama +$ENGINE exec -it ollama ollama run llama3.1 << EOF +/bye +EOF + +java -Dsun.misc.URLClassPath.disableJarChecking=true --add-opens jdk.naming.rmi/com.sun.jndi.rmi.registry=ALL-UNNAMED --add-opens java.base/java.lang=ALL-UNNAMED --add-opens java.base/sun.security.action=ALL-UNNAMED --add-opens java.base/sun.net=ALL-UNNAMED -jar target/helidon-car-booking.jar \ No newline at end of file