BAUER GROUP - AI Model Management Toolkit
Today, Tomorrow, Together | Building Better Software Together
A swiss-army knife for AI model development and operations. aimm is a toolkit, not
a single script: one core provides configuration precedence, secret redaction, retry
classification, hashing and a stable exit-code contract, and each tool mounts on top of it
as a Typer sub-app.
Tool #1 is aimm hf-backup: it backs up repositories from Hugging Face or
ModelScope to S3-compatible storage and can prove afterwards that the bytes are still
the right bytes. Pick the hub with --source; everything after the download — pinning,
integrity, the key layout, verify, restore, prune — is identical for both.
The three names
This trips people up, so it is stated up front. They are deliberately different and none of them is a typo:
| Thing | Value |
|---|---|
Distribution name (what you pip install) |
bg-ai-model-management |
Import package (what you import) |
bg_ai_model_management |
| CLI command (what you type) | aimm |
The CLI name is also the plugin contract: tools mount through the setuptools entry-point
group aimm.tools, every environment variable is prefixed AIMM_, and the profile
file is aimm.yaml. Those five identifiers are public API and do not change.
What hf-backup does
- Pins before it reads. A revision is resolved to an immutable 40-character commit SHA
once, and every subsequent enumeration and transfer runs against that SHA. A push to
mainmid-run cannot produce a torn snapshot. - Three transfer paths, chosen per file.
inline(a singlePutObjectfrom RAM),stream(Hugging Face straight into a hand-rolled multipart upload, no disk at all) anddisk(staged download, for the cases where streaming is not safe).--modeforces either extreme. - Integrity you can check, not assume. LFS files are anchored on Hugging Face's own
sha256; non-LFS files on the git blob id. Both go into a per-revision manifest that is itself digest-protected. - Restore never contacts Hugging Face. The manifest is the only authority, so the backup survives the upstream repo being deleted, renamed or gated.
- Retention that refuses to do the stupid thing. The newest complete revision is always kept, a revision a ref points at is protected, and a plan with no survivors is refused outright.
- Exit codes are a scheduling interface.
0clean,20drift found,6corrupt. See below — this is the part that matters for cron. - Backend-agnostic. MinIO, Ceph RGW, AWS S3, Cloudflare R2 and Wasabi are equal-ranked presets, and a runtime capability probe beats the preset table.
Install
pip install bg-ai-model-management
Python 3.12 or newer. See docs/installation.md.
60-second quickstart against MinIO
Start a MinIO, point aimm at it, back a real model up, verify it, restore it.
# 1. A throwaway MinIO on localhost:9000
docker run -d --name minio -p 9000:9000 \
-e MINIO_ROOT_USER=minioadmin -e MINIO_ROOT_PASSWORD=minioadmin \
minio/minio server /data
# 2. Credentials come from the environment, never from a flag
export AIMM_S3__ACCESS_KEY_ID=minioadmin
export AIMM_S3__SECRET_ACCESS_KEY=minioadmin
export AIMM_S3__ENDPOINT_URL=http://localhost:9000
export AIMM_S3__BUCKET=hf-backup
# 3. Check that everything is reachable before moving bytes
aimm hf-backup doctor --preset minio --ensure-bucket
# 4. Back up a real (tiny) model repository
aimm hf-backup sync hf-internal-testing/tiny-random-gpt2 --preset minio
# 5. Prove it landed intact
aimm hf-backup verify hf-internal-testing/tiny-random-gpt2 --preset minio --level deep
# 6. Bring it back to local disk — this step never talks to Hugging Face
aimm hf-backup restore hf-internal-testing/tiny-random-gpt2 \
--dest ./restored --preset minio
--ensure-bucket is opt-in on purpose and is only appropriate for a scratch bucket. In
production, buckets are provisioned as infrastructure; the tool should not be able to
create them.
Longer walkthrough: docs/quickstart.md.
Commands
Global options apply to every command: --profile, --log-level, --log-format,
--json, --run-id, --no-color, --version.
| Command | What it does |
|---|---|
aimm tools |
List the mounted tools |
aimm hf-backup sync |
Back up one or more repositories at a pinned commit |
aimm hf-backup verify |
Check a stored revision against its manifest (quick, deep, upstream) |
aimm hf-backup restore |
Materialise a stored revision on local disk |
aimm hf-backup prune |
Delete revisions the retention policy no longer covers |
aimm hf-backup catalog list |
List repositories stored under the prefix |
aimm hf-backup catalog revisions |
List the stored revisions of one repository |
aimm hf-backup catalog show |
Show one manifest, after verifying its digest |
aimm hf-backup doctor |
Probe the environment; print resolved settings with secrets masked |
Every flag is documented in docs/cli.md.
Exit codes
Every command returns a stable exit code. Three of them carry the operational meaning:
| Code | Meaning |
|---|---|
0 |
success — nothing to report |
20 |
differences found. verify did its job and found drift or an incomplete revision. This is a finding, not a crash |
6 |
integrity failure. Stored bytes do not hash to what the manifest says. Escalate |
A monitoring job that treats "non-zero" as one bucket will page someone at 03:00 for a
20 that only needed a re-sync, and will under-react to a 6 that means data loss. The
full table is in docs/troubleshooting.md.
Adding tool #2
The extension seam is a setuptools entry point that yields a typer.Typer. That is the
whole mechanism — no registry, no base class, no plugin framework:
[project.entry-points."aimm.tools"]
hf-backup = "bg_ai_model_management.tools.hfbackup.cli:app"
my-tool = "my_package.cli:app"
The loader mounts every registered entry point at startup, and a tool that fails to import
is logged and skipped rather than taking aimm --help down with it. A tool can live in a
different distribution package entirely and still mount. See
docs/development.md.
Documentation
| Document | Contents |
|---|---|
| Installation | supported Pythons, venv advice, verifying the install |
| Quickstart | first successful sync in under five minutes |
| Configuration | profile YAML, backends, every environment variable, the precedence chain |
| CLI reference | every command, every flag, every exit code |
| Transfer strategy | inline / stream / disk, how the path is chosen, tuning |
| Integrity | what is verified against what, and the honest limits |
| Backends | MinIO, Ceph RGW, AWS, R2, Wasabi — presets and probes |
| Operations | scheduling, retention, disaster recovery, monitoring |
| Troubleshooting | symptom to cause to fix, keyed on exit codes |
| Development | dev setup, the MinIO rig, how to add tool #2 |
| Architecture | module map, data flows, concurrency, security model |
| Decision records | ADRs 0001-0006, including the reversals |
License
MIT © BAUER GROUP
Metadata
Release files for bg-ai-model-management 1.2.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| bg_ai_model_management-1.2.1.tar.gz | 269.3 kB | Without provenance | Details for bg_ai_model_management-1.2.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| bg_ai_model_management-1.2.1-py3-none-any.whl | Python 3 | none | any | Details for bg_ai_model_management-1.2.1-py3-none-any.whl |
Total release size: 371.5 kB
Release files / bg_ai_model_management-1.2.1.tar.gz
| Download URL | bg_ai_model_management-1.2.1.tar.gz |
|---|---|
| Size | 269.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
d2ba0d117cd6034cd14e6b6078ec10049081903d1afe06be230be12760e13d59
|
|
BLAKE2b-256 checksum How to use checksums |
9e22817d99d3275226379f347176ec63f13981b5b1267960628af2d736da84b9
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.14
|
Release files / bg_ai_model_management-1.2.1-py3-none-any.whl
| Download URL | bg_ai_model_management-1.2.1-py3-none-any.whl |
|---|---|
| Size | 102.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
4a506af2c95198f673b3098731ac05b808427e4605becbbd24aaadcfe6864688
|
|
BLAKE2b-256 checksum How to use checksums |
0f3d7bce7e6f00590d068aea0e7404b85ca5d6eeb3f57117afc4f075c1d6faaa
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.14
|
Security for bg-ai-model-management 1.2.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.