Skip to main content

HELMET: Human Evaluated large Language Model Explainability Tool

PyPI version

Contents

Pypi Installation

pip install helmet

Overview

This package exists of two parts;

  1. A python package; helmet, which you can install in your Jupyter Notebook/Sagemaker/Colab
  2. A webapp: helmet-platform, which deploys an API to save al the runs & projects and interacts with the frontend. A frontend should also be deployed.

Configuration files

Platform configuration

project_name = "Project Name"
project_id = "Id" # (get from frontend or code)
platform_url = "https://" # Please do not change this

Model configuration

# This should be the name as is presented on Huggingface 🤗
checkpoint = "meta-llama/Meta-Llama-3-8B-Instruct"
# The embeddings are needed for the XAI part. This varies between models, thus please provide it yourself.
embeddings = "model.embed_tokens"

# This is for wrapper to know what kind of model it is.
model_type = "dec"

Model Args

# This is needed to use Llama-3
access_token = "hf_"

# You can add more here if you like
model_args = {
    "token": access_token
}

Run configuration

run_config = {
    # "cuda" & "cpu" are currently supported
    "device": device,
}

Load/create project

Creating a project can be done by current the following python code in your jupyter notebook.

project_id = get_or_create_project(platform_url, project_name, "text_generation")

This will give you back the ID of the project, that you can then use to load the model.

After you have configured the model, platform & device, you can start loading the model like this:

model = from_pretrained(checkpoint, model_type, embeddings, project_id, device, platform_url, model_args)

Features

  • Load any causal model from Huggingface.
  • Create a project for your experiment
  • Run experimental prompts

Demo

A demo can be found at https://helmet.jeroennelen.nl

Component architecture

Install from source

To use helmet in one of the examples perform the following steps:

  1. Create venv with python -m venv .venv
  2. Activate the venv with source .venv/bin/activate
  3. Install HELMET from source (from git, when located in the home folder of helmet pip install -e .
  4. Install jupyter notebook pip install jupyterlab

To remove:

  1. deactivate
  2. jupyter-kernelspec uninstall venv
  3. rm -r venv

Running webapp locally

For this, please check the README in the webapp

Credits

Some inspiration has been drawn from a couple of other tools:

License

helmet is distributed under the terms of the MIT license.

Metadata

Release files for helmet 1.1.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for helmet 1.1.1
File Size Uploaded Provenance Actions
helmet-1.1.1.tar.gz 11.0 kB Without provenance Details for helmet-1.1.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for helmet 1.1.1
File Interpreter ABI Platform Actions
helmet-1.1.1-py3-none-any.whl Python 3 none any Details for helmet-1.1.1-py3-none-any.whl

Total release size: 23.4 kB

Release files / helmet-1.1.1.tar.gz

Download URL helmet-1.1.1.tar.gz
Size 11.0 kB
Tags Source
SHA-256 checksum
How to use checksums
28650880662d5fefc37970ee56ccc72f92d0bd5fc82fa191ca7ace9ab7d2fb15
BLAKE2b-256 checksum
How to use checksums
5b6286ed4a14dd37bc335b436064745aeadcc28d679b0eb1c2715248fe29daf1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.0.0 CPython/3.9.19

Release files / helmet-1.1.1-py3-none-any.whl

Download URL helmet-1.1.1-py3-none-any.whl
Size 12.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
45d91d466e8a98009e311f9e42fad85426236a1aa29914a88196dd8383bd512c
BLAKE2b-256 checksum
How to use checksums
635d650e7005fec8d21c5d311361be416e8d69a5e2b55b324ce7f6bc08ce5479
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.0.0 CPython/3.9.19

Security for helmet 1.1.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page