Skip to main content

psAI ops apehex logo

License Latest

A collection of experimental web apps to inspect & engineer the activations of LLMs.

It is a WIP, some apps are not fully functional yet.

The human / LLM detector is improving though:

Screenshot de-generate

Installation

The package is available on pypi:

pip install -U psaiops

All the apps run on a single GPU and can be launched from a Google Colab notebook.

They are showcased in the demo notebook.

Overview

To run a given application all you need is to call the associated app.py:

python psaiops/compose/contrast/app.py

All the apps run with the model gpt-oss-20b by default so it is highly recommanded to use a GPU.

Some of the apps are specific to gpt-oss-20b but most can be used with another model. You can look at the section __main__ at the bottom of the file app.py for more details on the setup.

Apps

Contrastive Steering

A straightforward implementation of the technique contrastive activation addition is available in psaiops.compose.contrast.app.

Latent Maths

Pushing the idea of CAA further, psaiops.compose.maths.app allows to compose several prompts in the latent space with maths operators.

Like CAA you can do the difference between prompts, but also multiply, project, average, etc.

Dataset Combination

The app psaiops.combine.app allows to draw from several datasets to form new samples and datasets.

It is useful to create pairs of prompts and form specific latent directions with the contrastive steering technique.

Debugging And Scoring

To support the creation of apps that operate in the latent space, I've used several tools that allow to view the internals of the models.

In particular, you can take apart LLM generated text from human text:

It is using techniques scattered over several other apps that:

  • use a LLM as critic to estimate how surprising each token is
  • score the input tokens according to the attention they get during the generation
  • view the expert logits and associate the routing with the input tokens
  • view the flow of residuals and assess the contribution of the layers to the final output

Credits

The "de-generate" samples include documents from the LLM internals thanks to:

License

Licensed under the AGPLv3.

Metadata

Release files for psaiops 0.13.4

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

Source distribution (sdist)

Source distribution for psaiops 0.13.4
File Size Uploaded Provenance Actions
psaiops-0.13.4.tar.gz 372.8 kB Without provenance Details for psaiops-0.13.4.tar.gz

Built distribution (wheel)

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

Total release size: 775.5 kB

Release files / psaiops-0.13.4.tar.gz

Download URL psaiops-0.13.4.tar.gz
Size 372.8 kB
Tags Source
SHA-256 checksum
How to use checksums
7a6cf897e9b6c10d25d9ad4a236a903395774f833c4f85a07eb1a137714c36da
BLAKE2b-256 checksum
How to use checksums
81acad8097a098b14ba9181e1617af5de2062a96bedcff9dc37fba148924cae8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.10.12 {"installer":{"name":"uv","version":"0.10.12","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Arch Linux","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Release files / psaiops-0.13.4-py3-none-any.whl

Download URL psaiops-0.13.4-py3-none-any.whl
Size 402.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
d302837a6d8398df03579abba06b8b6626e77b818396636fd1382f584d2f940a
BLAKE2b-256 checksum
How to use checksums
2dfabd30b1e291667ce725aac0b8354d14ed740d09fc3dceb8ebb1c5bbff8331
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.10.12 {"installer":{"name":"uv","version":"0.10.12","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Arch Linux","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Security for psaiops 0.13.4

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.

Release history Release notifications | RSS feed

This release

0.13.4 This release

2 release files No provenance

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