This is a Companion Demo Project that leverages Spring Cloud AWS Bedrock Starter.
Make use of an existing or sign up for a new, AWS account. You will need credentials with appropriate IAM role and permissions. (We've tested this with an IAM user with a role that has a PowerUserAccess AWS managed policy attached).
Download and install the following CLIs
Download and install a JDK and Maven
sdk install java 21.0.1-librca
sdk install maven 3.9.5
Accept these as the default versions
Include the right Maven dependency into your project
<dependency>
<groupId>io.clue2solve</groupId>
<artifactId>spring-cloud-aws-bedrock-starter</artifactId>
<version>0.0.2-SNAPSHOT</version>
</dependency>
or build the Starter from sources and install it into your local Maven repository
gh repo clone https://github.com/pacphi/spring-cloud-aws-bedrock-starter
gh repo clone https://github.com/pacphi/BedrockSpringBootStarterDemo
cd spring-cloud-aws-bedrock-starter
mvn clean install
cd ../BedrockSpringBootStarterDemo
mvn clean install
export AWS_ACCESS_KEY_ID=
export AWS_SECRET_ACCESS_KEY=
Make certain you are using authorized AWS credentials
Review Set up Amazon Bedrock instructions.
mvn spring-boot:run
Press Ctrl+C to quit
❯ http POST :8080/claude/invoke data="How much on average does an African lion weigh in pounds"
HTTP/1.1 200
Connection: keep-alive
Content-Length: 440
Content-Type: application/json
Date: Thu, 30 Nov 2023 14:26:55 GMT
Keep-Alive: timeout=60
Here are some key details about the average weight of African lions:
- Male African lions typically weigh 330 to 550 pounds (150 to 250 kg).
- Female African lions typically weigh 265 to 395 pounds (120 to 180 kg).
- On average, male African lions are larger and heavier than females.
- The average weight for an adult male African lion is about 420 pounds (190 kg).
- The average weight for an adult female African lion is about 280
❯ http POST :8080/jurassic/invoke
❯ http POST :8080/llama/invoke
❯ http POST :8080/titan/invoke
❯ http POST :8080/stablediffusion/invoke
Or with the hoppscotch desktop application: