AuthentricsTrial

Developers

Python SDK walkthrough

A linear path from install to your first static analysis. Use it alongside your evaluation API key from this portal and the optional examples repository.

Walkthrough

From install to your first analysis

Follow the steps in order. Each step ends with a small checkpoint so you know you're ready for the next one. This portal uses Google sign-in for your evaluation account; the Python SDK signs in separately to your Authentrics API gateway with the credentials your administrator gives you.

1

Prepare your machine

Python 3.12 on Linux x86_64, or a Linux container if you are on macOS.

  • Python 3.12 is required.
  • Wheels target Linux x86_64. On macOS, use a Linux amd64 container (see step 9).
  • Have your gateway base URL (for example http://your-gateway:8080) and gateway user credentials from your admin.

Install flow may change as packaging evolves — treat registry commands as the source of truth from your team when they differ from this page.

Checkpoint — You can run python3.12 --version and you know your gateway URL and username.
2

Install the Authentrics package

Authenticate to Google Artifact Registry, then pip install from the private index.

Registry auth uses Google Application Default Credentials:

gcloud auth application-default login
pip install keyrings.google-artifactregistry-auth

Install Authentrics:

pip install authentrics \
  --index-url https://us-central1-python.pkg.dev/authentrics/authentrics-repo/simple/

Pin a version when you need reproducibility:

pip install 'authentrics==<x.y.z>' \
  --index-url https://us-central1-python.pkg.dev/authentrics/authentrics-repo/simple/
Checkpoint — python -c "import authentrics; print(authentrics.__version__)" runs without import errors.
3

Point the SDK at your gateway

Set the base URL once per machine or project.

In Python:

import authentrics as ax

session = ax.AuthentricsSession()
session.set_base_url("http://your-gateway:8080")
print(session.get_base_url())

Or with the CLI (persisted for your user):

authrx config set base_url http://your-gateway:8080
authrx config get base_url
authrx config list

Supported keys include base_url and log_level.

Checkpoint — session.get_base_url() prints the URL you expect.
4

Sign in to the gateway

The login API expects your email in the username field.

import authentrics as ax

session = ax.AuthentricsSession()
session.set_base_url("http://your-gateway:8080")

session.login(username="you@company.com", password="…")
# Or: session.login()  # uses AAI_USERNAME / AAI_PASSWORD from the environment

CLI equivalent:

authrx login
authrx login -u you@company.com -p '…'

Provisioning regular users is done by an administrator via the gateway admin API — not through this trial portal.

Checkpoint — Login succeeds and you can call session methods without unauthorized errors.
5

Create a project

Projects hold metadata on the gateway; checkpoints reference files on disk.

project = session.create_project(
    name="My experiment",
    description="ResNet-50 baseline",
)
print(project.id)
Checkpoint — You have a non-empty project.id from the server.
6

Register checkpoints

Tell Authentrics which files on disk belong to this project.

from authentrics import Checkpoint

project = session.add_checkpoints(
    project,
    Checkpoint("Epoch 1", "checkpoints/epoch_1.pt"),
    Checkpoint("Epoch 2", "checkpoints/epoch_2.pt"),
)
Checkpoint — Paths resolve from where you run Python and files exist on disk.
7

Attach your model (ModelInterface)

Implement a thin wrapper so the SDK can load weights, run inference, and read parameters.

You implement ModelInterface: load, save, perform_inference, get_parameters, get_parameters_from_layer_names, and set_parameters. Different analyses require different subsets of those methods.

For a complete, runnable PyTorch example, use the examples repository once NEXT_PUBLIC_SDK_EXAMPLES_REPO_URL is configured.

session.model = MyModelInterface()
Checkpoint — session.model is set and load() works for your checkpoint path.
8

Run your first analysis (static)

Compare two checkpoints locally — weights never leave your machine.

result = session.static_analysis(
    project.id,
    "checkpoints/epoch_1.pt",
    "checkpoints/epoch_3.pt",
)
print(result.weight_summary_score, result.bias_summary_score)

Project and checkpoint metadata sync with the gateway; analysis runs locally.

Checkpoint — You see numeric scores printed and can iterate with plotting or HDF5 export next.
9

Where to go next

Tensor backends, more analyses, saving results, and macOS containers.

  • Switch tensor backends with authentrics.use_backend("numpy") or "torch" when PyTorch is installed.
  • Try activation, correlation, exclude-training, and ZTOM analyses once static analysis feels familiar.
  • Serialize many results with .to_hdf5(path) / from_hdf5 (see SDK docs for per-type support).
  • On macOS, build a linux/amd64 Docker image, mount your repo, and run the SDK inside the container.

Support

Questions: info@authentrics.ai. When reporting an issue, include authentrics.get_system_info() or authrx sys-info.