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.
- Set
NEXT_PUBLIC_SDK_EXAMPLES_REPO_URLto show a link to your examples repo here. - Artifact registry index: https://us-central1-python.pkg.dev/authentrics/authentrics-repo/simple/
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
amd64container (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.
python3.12 --version and you know your gateway URL and username.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-authInstall 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/python -c "import authentrics; print(authentrics.__version__)" runs without import errors.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 listSupported keys include base_url and log_level.
session.get_base_url() prints the URL you expect.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 environmentCLI 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.
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)project.id from the server.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"),
)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()session.model is set and load() works for your checkpoint path.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.
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/amd64Docker 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.

