Skip to content

nsgupta1/player-service-app

Repository files navigation

⚾ Player Service

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.

Dependencies

🛠️ Setup Instructions

  1. Verify system dependencies

    1. Python
      • Verify installation: python3 --version
    2. Docker
      • Download and install from docker.com
      • Verify installation, run: docker --version
  2. Clone this repository or Download the code as zip

    • run git clone https://github.com/Intuit-A4A/player-service-python.git

Run the application

Part 1: Application Dependencies

OPTIONAL Create & activate virtual env

   $ python3 -m venv env # use `python -m venv env` on Windows
   $ source env/bin/activate  # use `env\Scripts\activate` on Windows
  1. Install application dependencies
    • Move into the project's root directory, run: cd player-service-app.
    • From the project's root directory, run: pip install -r requirements.txt

Part 2: Run Player Service (without LLM)

  1. Start the Player service

     python3 app.py
  2. Verify the Player service is running

    1. Open your browser and visit http://localhost:8000/v1/players
    2. If the application is running successfully, you will see player data appear in the browser

Part 3: Start LLM Docker Container

Player service integrates with Ollama 🦙, which allows us to run LLMs locally. This app runs tinyllama model.

  1. Pull and run Ollama docker image and download tinyllama model

    • Pull Ollama docker image
    docker pull ollama/ollama
  2. 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
  3. Download and run tinyllama model

    docker exec -it ollama ollama run tinyllama
  4. 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}'
    

Part 4: Verify Player Service and LLM Integration

  1. Ensure Player Service is running

    python3 app.py
  2. Open your browser and visit http://localhost:8000/v1/chat/list-models

    • If the application is running successfully, you will see a json response that include information about tinyllama

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published