Large-Language Model (LLM) part of Talk2PowerSystem (Talk2PowerSystem_LLM) is a core component of the Talk2PowerSystem project, providing all the necessary coding and scripting to support the integration and operation of a Large-Language Model (LLM). This project focuses on enabling robust LLM functionalities, including data preprocessing, model training, inference, and seamless integration with other parts of the Talk2PowerSystem ecosystem.
-
Data Preprocessing: Scripts to clean, normalize, and format data for LLM training.
-
Model Training: Pipelines and utilities for fine-tuning and training LLM models.
-
Inference Engine: Code for running real-time queries and generating model predictions.
-
System Integration: Tools and interfaces to connect the LLM with other components of the Talk2PowerSystem project.
-
Testing and Evaluation: Automated tests and performance evaluation scripts to ensure model reliability and accuracy.
The repository is organized as follows:
-
src/- Main source code including training, inference, and integration scripts. -
data/- Data sets and preprocessing scripts. -
docs/- Documentation, guides, and technical notes. -
tests/- Unit and integration tests for various modules. -
config/- Configuration files for model parameters and environment settings. -
evaluation_results/- Directory, which holds the evaluation results of the system. -
helm-chart/- Directory, which holds resources for easier deployment on Kubernetes environments.
-
You should install conda.
minicondawill suffice.
To set up the project locally, follow these steps:
-
Clone the repository:
git clone https://github.com/statnett/Talk2PowerSystem_LLM.git
-
Create a conda environment and install dependencies
conda create --name Talk2PowerSystemLLM --file conda-linux-64.lock conda activate Talk2PowerSystemLLM poetry install
conda activate Talk2PowerSystemLLM
poetry install --with test
poetry run pytest --cov=talk2powersystemllm --cov-report=term-missing tests/unit_tests/bash ./docker/generate-manifest.sh
docker buildx build --file docker/Dockerfile --tag talk2powersystem .
docker buildx build --file tests/acceptance_tests/docker-compose/DockerfileAcceptanceTests --tag talk2powersystem-acceptance-tests .
docker buildx build --file tests/acceptance_tests/docker-compose/DockerfileGraphDB --tag graphdb .
docker compose -f tests/acceptance_tests/docker-compose/docker-compose.yaml run --rm talk2powersystem-acceptance-tests poetry run pytest tests/acceptance_tests/
docker compose -f tests/acceptance_tests/docker-compose/docker-compose.yaml down -v --remove-orphansThe chat bot releases follow the Semantic Versioning Standard.
However, poetry follows the PEP 440 Standard, so in order to create a pre-release we need to do update the version manually.
The official releases versions are in the form of major.minor.patch.
The pre-releases versions are in the form of major.minor.patch-rc<N>.
The development versions are in the form of major.minor.patch-dev0.
Steps to create an official release (from the main branch):
-
conda activate Talk2PowerSystemLLM -
poetry version <major|minor|patch>. -
git add pyproject.toml -
git commit -m "Bumping version from <previous-version> to <current-version>" -
git push -u origin main -
Create a release from the GitHub interface. The tag and the release title must match the version from poetry!
-
Edit the
versioninpyproject.toml- increase thepatchand add-dev0after it. For example, if the version is2.0.0, the next version must be2.0.1-dev0. -
git add pyproject.toml -
git commit -m "Bumping version from <previous-version> to <current-version>" -
git push -u origin main
Steps to create a pre-release (from the main branch):
-
conda activate Talk2PowerSystemLLM -
Edit the
versioninpyproject.toml- If the current version is a pre-release version, then you must increase the release candidate number. For example, if the current version is1.2.0-rc1, the next version must be1.2.0-rc2. If the current version is a development version, then the next pre-release version must follow the semantic versioning convention on how to increment the major, minor and patch parts of the version and add-rc1at the end. For example, if the current version is1.1.0-dev0and the next release will be a major one, the next version must be2.0.0-rc1. -
git add pyproject.toml -
git commit -m "Bumping version from <previous-version> to <current-version>" -
git push -u origin main -
Create a release from the GitHub interface. The tag and the release title must match the version from poetry!
We release changes on demand. First, we create pre-releases, then we deploy them, and test the changes. Until the changes don’t meet the acceptance criteria, new pre-releases are created with fixes. If the changes meet the acceptance criteria, an official release is created, which is deployed.