Player Service is a backend application that serves baseball player data. In addition, Player service integrates with Ollama, which allows us to run the tinyllama LLM locally.
- Java 17
- maven.apache.org
- Spring Boot 3.3.4 (with Spring Web MVC, Spring Data JPA)
- H2 Database
- Docker
-
Verify system dependencies
- Java 17
- Verify installation:
java -version
- Verify installation:
- Maven
- Download and install from maven.apache.org
- Verify installation, run:
mvn --version
- Verify java version linked to maven is Java 17
Java version: 17.x.x
- Docker
- Download and install from docker.com
- Verify installation, run:
docker --version
- Java 17
-
Clone this repository or Download the code as zip
- run
git clone https://github.com/Intuit-A4A/backend-java-player-service.git
- run
- Install application dependencies
- From the project's root directory, run:
mvn clean install -DskipTests
- From the project's root directory, run:
-
Start the Player service
mvn spring-boot:run
-
Verify the Player service is running
- Open your browser and visit
http://localhost:8080/v1/players
- If the application is running successfully, you will see player data appear in the browser
- Open your browser and visit
Player service integrates with Ollama 🦙, which allows us to run LLMs locally. This app runs tinyllama model.
-
Pull and run Ollama docker image and download
tinyllama
model- Pull Ollama docker image
docker pull ollama/ollama
-
Run Ollama docker image on port 11434 as a background process
docker run -d -v ollama:/root/.ollama -p 11434:11434 --name ollama ollama/ollama
-
Download and run
tinyllama
modeldocker exec -it ollama ollama run tinyllama
-
Test Ollama API server
curl -v --location 'http://localhost:11434/api/generate' --header 'Content-Type: application/json' --data '{"model": "tinyllama","prompt": "why is the sky blue?", "stream": false}'
-
Ensure Player Service is running from previous instructions. If not:
mvn spring-boot:run
-
Open your browser and visit
http://localhost:8080/v1/chat/list-models
- If the application is running successfully, you will see a json response that include information about tinyllama