Skip to content

Repository files navigation

CI front

Introduction

Spring Boot (kotlin) + angular application that leverages Spring-AI with OpenAi and Anthropic APIs . Github actions produce a linux/arm64 ready docker image that can run on a Raspberry Pi for example.

Don't forget to export the SPRING_AI_OPENAI_API_KEY and/or the SPRING_AI_ANTHROPIC_API_KEY environment variables on your host system.

Steps

  • Create a docker network: docker network create mpalourd-ai
  • Build the image: ./gradlew bootBuildImage.
  • Run a Vector database
$ docker run -it --rm -d \
    --name pgvector \
    --network=mpalourd-ai \
    -e POSTGRES_PASSWORD=postgres \
    -e POSTGRES_DB=pgvector \
    -e PGDATA=/var/lib/postgresql/data/pgdata \
    -v ~/pgmount/pgvector:/var/lib/postgresql/data \
     pgvector/pgvector:pg16
  • Run the image :
docker run \
  --network=mpalourd-ai
  -e SPRING_AI_OPENAI_API_KEY=$SPRING_AI_OPENAI_API_KEY \
  -e SPRING_AI_ANTHROPIC_API_KEY=$SPRING_AI_ANTHROPIC_API_KEY \
  -e EXTERNAL_API_URL=https://xxxxxx \
  -e EXTERNAL_API_TOPK=50 \  #not mandatory, 50 by default
  -e EXTERNAL_API_SIMILARITYTHRESHOLD=0.75 \  #not mandatory, 0.75 by default
  -e MPALOURDAI_DEFAULTSYSTEMFILEPATH=/container/defaultsystem.txt \
  -v /host/defaultsystem.txt:/container/defaultsystem.txt \
  -p 8080:8080 ghcr.io/mpalourdio/mpalourd-ai:latest

Image ready to test ?

docker pull ghcr.io/mpalourdio/mpalourd-ai:latest.

Failed to create the main Isolate. (code 24) ?

Follow these instructions for Raspberry PI 5.

Running the tracing agent

./gradlew bootJar
java -Dspring.aot.enabled=true -jar -agentlib:native-image-agent=config-output-dir=/tmp/ai build/libs/mpalourd-ai-0.0.1-SNAPSHOT.jar

About

🔬 A Spring Boot (kotlin) + angular + Spring AI (OpenAi) application that compiles with GraalVM and runs on a Raspberry Pi.

Topics

Resources

Stars

2 stars

Watchers

1 watching

Forks

Releases

Sponsor this project

Packages

Used by

Contributors

Languages