Giter VIP home page Giter VIP logo

2024-langchain4j-demo's Introduction

LangChain4J demo

Author: Julien Dubois

Video

This demo is supporting a video called "LangChain4J - use the power of LLMs in Java!", available at https://youtu.be/x8kkjmCZTaw.

Goal

This is a Spring Boot project that demonstrates how to use LangChain4J to create Java applications using LLMs.

It contains 7 demos:

  • How to generate an image using Dalle-3.
  • How to generate a text using GPT-4 and Mistral 7B.
  • How to use a chat conversation with memory of the context.
  • How to ingest data into a vector database, and use it.

Configuration

Azure OpenAI

You need to set the following environment variables:

  • AZURE_OPENAI_ENDPOINT: your Azure OpenAI URL endpoint.
  • AZURE_OPENAI_API_KEY: your Azure OpenAI API key.

MistralAI

You can use a local version of Mistral 7B, and you need to set following environment variables:

  • MISTRAL_AI_BASE_URL: your MistralAI URL endpoint (for example http://localhost:1234/v1/ when running locally).
  • MISTRAL_AI_KEY: your MistralAI API key (which you would not use when running the model locally, so you can use foo as a value).

Azure AI Search

You need to set the following environment variables:

  • AZURE_SEARCH_ENDPOINT: your Azure AI Search URL endpoint.
  • AZURE_SEARCH_KEY: your Azure AI Search API key.

Running the demos

You can run the demos using the following command:

./mvnw spring-boot:run

Then you can access the base URL, where you find the Web UI:

http://localhost:8080/

2024-langchain4j-demo's People

Contributors

jdubois avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.