Skip to main content

Sign AI models with identity. Verify anywhere. Part of the AURE Provenance stack by Constant Systems.

Project description

modelsign

CI License Python 3.9+

Sign AI models with identity. Verify anywhere. Part of the AURE Provenance stack by Constant Systems.

modelsign cryptographically binds model files to a signed identity card — who made this model, what it's based on, what it claims to be. Ed25519 signatures, zero ML dependencies, works with any model format.

Note: modelsign is distinct from the OpenSSF model-signing package on PyPI. We are an independent implementation using Ed25519 + RFC 8785 canonical JSON. Designed and maintained by James Kerr / Constant Systems.

Install

pip install modelsign

Quick Start

# Generate your signing key
modelsign keygen

# Sign a model with a name
modelsign sign model.safetensors --name "My-Llama-8B-v1"

# Verify it
modelsign verify model.safetensors

# Inspect the identity card
modelsign inspect model.safetensors.sig

Rich Identity Cards

Sign with full provenance:

# Create an identity card
cat > card.json << 'EOF'
{
  "name": "Llama-3.1-8B-Chat-QJ",
  "architecture": "LlamaForCausalLM",
  "base_model": "meta-llama/Llama-3.1-8B-Instruct",
  "version": "1.0.0",
  "creator": "ConstantQJ",
  "license": "Llama 3.1 Community",
  "intended_use": "Chat assistant",
  "training": {
    "dataset": "custom-chat-v2",
    "epochs": 3,
    "hardware": "DGX Spark GB10"
  },
  "eval_metrics": {
    "mmlu": 0.68,
    "humaneval": 0.53
  }
}
EOF

modelsign sign model.safetensors --identity card.json

Python SDK

from modelsign import (
    ModelCard, validate_card, canonical_json,
    generate_keypair, load_private_key, load_public_key,
    sign_bytes, build_file_message, verify_bytes,
    hash_file, SigFile, write_sig, read_sig,
)

What It Protects Against

  • Post-signing tampering of model weights
  • Substitution of one model for another
  • Metadata swap (changing identity claims invalidates signature)

What It Does NOT Cover

  • Key compromise (your key, your responsibility)
  • Model safety, fairness, or legal compliance
  • Cryptographic timestamping (timestamps are metadata, not proofs)

How It Compares

modelsign OpenSSF Model Signing (OMS)
Focus Simple signing + rich identity Supply-chain integrity via Sigstore
Identity card Embedded (architecture, training, eval metrics) Minimal (being expanded)
Setup pip install modelsign Sigstore toolchain + transparency log
Signing Offline, Ed25519, one command Keyless via OIDC + Rekor transparency
Best for Individual fine-tunes, HF uploads, quick sharing Enterprise supply-chain, NGC publishing
Network required No Yes (Sigstore/Rekor)

modelsign and OMS are complementary. Use modelsign for fast, offline, identity-rich signing. Use OMS when you need transparency logs and keyless verification at enterprise scale.

Identity Card Schema

Field Required Description
name Yes Model name
architecture No Model class (e.g., LlamaForCausalLM)
base_model No Parent model name/path
parent_signature No Hash of parent's .sig (provenance chain)
version No Semantic version
creator No Person or organization
license No SPDX identifier or name
intended_use No What the model is for
restrictions No What it should NOT be used for
training No {dataset, dataset_hash, epochs, hardware}
quantization No Method (e.g., GPTQ-4bit)
eval_metrics No Benchmark results ({mmlu: 0.68})
extra No Any additional metadata

License

Apache 2.0 — QJ / ConstantOne (CIP1 LLC)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

modelsign-1.0.4.tar.gz (26.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

modelsign-1.0.4-py3-none-any.whl (21.5 kB view details)

Uploaded Python 3

File details

Details for the file modelsign-1.0.4.tar.gz.

File metadata

  • Download URL: modelsign-1.0.4.tar.gz
  • Upload date:
  • Size: 26.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.3

File hashes

Hashes for modelsign-1.0.4.tar.gz
Algorithm Hash digest
SHA256 43cbd20242d6d2901b966ebbd0423c64d352441e64a83e43d2896af4b2329177
MD5 0d6738cefa3ecb297ef31252d1faa6fc
BLAKE2b-256 56cd7ca2413034d06939d7183436f8a4838042c66b886690530c94269f6d53fd

See more details on using hashes here.

File details

Details for the file modelsign-1.0.4-py3-none-any.whl.

File metadata

  • Download URL: modelsign-1.0.4-py3-none-any.whl
  • Upload date:
  • Size: 21.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.3

File hashes

Hashes for modelsign-1.0.4-py3-none-any.whl
Algorithm Hash digest
SHA256 38efc867b39ecc0490bf4f130ba252380bf4c4b0bc0dc3ff4d261df9dcb04243
MD5 eb41d8d928b61eadd36892fe55a3f032
BLAKE2b-256 63a1c054932552b4038784c64dfd2cafde251ebd4b89a4bf3e213892c25e4bb6

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page