This project uses Quarkus, the Supersonic Subatomic Java Framework, integrated with LangChain4j library using Retrieval-Augmented Generation process and providing a REST API to interact with Large Language Models.
- Large Language Models (LLMs) are AI-based systems designed to understand, generate, and manipulate human language, showcasing advanced natural language processing capabilities.
- LangChain4j library offers a declarative approach to interact with diverse LLMs like OpenAI, Hugging Face, Ollama, or Jlama.
- Retrieval-Augmented Generation (RAG) is the process of optimizing the output of a large language model, so it references an authoritative knowledge base outside of its training data sources before generating a response. RAG extends the already powerful capabilities of LLMs to specific domains or an organization's internal knowledge base, all without the need to retrain the model.
- Java 21
- A running container environment, such as Docker or Podman
You can run your application in dev mode that enables live coding using:
mvn quarkus:devNOTE: Quarkus now ships with a Dev UI, which is available in dev mode only at http://localhost:8080/q/dev/.
You can interact with the LLM using the following two ways:
- Make a question:
curl --request POST \
--url http://localhost:8080/doc/help/question \
--header 'Content-Type: application/json' \
--data '{
"question": "Is Runtime Verification useful in Internet of Things ecosystems?",
"style": "informal",
"size": "short"
}'
- Require a summary about a keyphrase:
curl --request POST \
--url http://localhost:8080/doc/help/summary \
--header 'Content-Type: application/json' \
--data '{
"keyPhrase": "Runtime Verification",
"style": "academic"
}'