ASTRA - Adaptive Stress Testing for Robust AI
ASTRA-RL is a python toolbox for training and evaluating language models and generative AI systems that use textual inputs. It provides a set of tools for training, evaluating, and analyzing language models, with a focus on applying reinforcement learning based refinement techniques to improve evaluator model performance.
To install the ASTRA-RL toolbox, you can use pip. The package is available on PyPI, so you can install it directly from there.
pip install astra-rl
You can then import the library in your Python code:
import astra_rl
# or
import astra_rl as astral
This section provides instructions for setting up the development environment and running tests.
To start, we STRONGLY recommend using uv to manage your Python environment. This will ensure that you have the correct dependencies and versions installed.
-
Clone the repository:
git clone https://github.com/sisl/astra-rl.git cd astra-rl
-
Sync package dependencies:
uv sync --dev
This will create a
.venv
directory in the project root with all the necessary dependencies installed. -
Install pre-commit hooks:
uv run pre-commit install
This will ensure that the linter (
ruff
), formatter (ruff
), and type checker (mypy
) is happy with your code every time you commit.
Assuming you've set up your environment using uv
, you can run the tests using the following command:
pytest
or
uv run pytest
To generate local coverage reports, you can use:
uv run coverage run -m pytest
uv run coverage report # Generate CLI report
uv run coverage html # Generate HTML report
To generate the documentation, you can use the following command:
uv run mkdocs serve
This will build the documentation and start a local server. You can then view the documentation in your web browser.