Skip to content

Install

This project requires Python 3.12. Please ensure that this version is installed before continuing.

Note

The application may not run correctly with earlier Python versions.

To check your current Python version, run:

python --version

or

python3 --version

If you do not have Python 3.12 installed, you can download it from the official website: https://www.python.org/downloads/release/python-3120/


Clone the Repository

Use Git to download the project:

git clone https://github.com/se4ai2526-uniba/Turing.git

Set Up the Environment

It is recommended to use a virtual environment to manage dependencies.

Create a Virtual Environment

python -m venv venv

Activate the Virtual Environment

venv\Scripts\activate
source venv/bin/activate

Tip

If the environment fails to activate, ensure you have permission to execute scripts on your system.


Install Dependencies

Install the required packages using:

pip install -e pyproject.toml

Warning

Ensure the virtual environment is activated before installing dependencies, or the packages may be installed globally.


GPU Support

The model is capable of running on a GPU, which can significantly speed up training and inference. To enable GPU acceleration, you need to install a CUDA-compatible version of PyTorch.

Run the following command to install PyTorch with CUDA 13.0 support:

pip3 install torch torchvision --index-url https://download.pytorch.org/whl/cu130

If you are using a different CUDA version, you can find the correct installation command by visiting the official PyTorch installation guide:

PyTorch Installation Guide: https://pytorch.org/get-started/locally/

Requirements

Before installing, ensure that:

  • Your system has a supported NVIDIA GPU
  • The correct CUDA toolkit is installed
  • Your Python environment (virtual environment recommended) is active

Using the right CUDA version ensures that PyTorch can fully utilize your GPU for faster and more efficient computation.

Prometheus and Grafana Integration

This project supports resource monitoring via Prometheus, with visualization provided by Grafana. Follow the steps below to enable this feature.

1. Prerequisite: Install Prometheus

Download the Prometheus server from the official Prometheus Downloads page.

2. Setup and Execution

Choose your operating system below to configure the environment and start the services.

1. Add Prometheus to Environment Variable Open your command line and run the following to add the Prometheus folder to your PATH. (Replace C:\Path\To\Prometheus with your actual installation folder).

setx PATH "%PATH%;C:\Path\To\Prometheus"

Restart Required

You must close and reopen your terminal after running setx for the changes to take effect.

2. Run Prometheus Navigate to the project directory and start the Prometheus server:

prometheus.exe --config.file=turing.yml

1. Add Prometheus to Environment Variable You can add Prometheus to your path by editing your shell configuration (e.g., ~/.bashrc or ~/.zshrc):

export PATH=$PATH:/path/to/prometheus

2. Run Prometheus Navigate to the project directory and start the Prometheus server:

prometheus --config.file=turing.yml
(Note: If you did not add it to your PATH, use ./prometheus instead).

3. Start the API

In a separate terminal window, start your local API:

uvicorn turing.api.app:app --reload
By default, the server runs at http://127.0.0.1:8000.

4. Verification & Dashboards

Once both services are running:

Setup Complete

You have successfully set up the monitoring stack!

You can now view the Grafana Dashboard here: View Public Dashboard

Local Grafana Setup

If you prefer to run Grafana locally, consult the Prometheus documentation for detailed instructions.