AffixIO commited on
Commit
f381ef4
·
verified ·
1 Parent(s): 8c5ab44

Add model card

Browse files
Files changed (1) hide show
  1. README.md +94 -0
README.md ADDED
@@ -0,0 +1,94 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ license: apache-2.0
3
+ language:
4
+ - en
5
+ library_name: affix-huggingface
6
+ tags:
7
+ - post-quantum-cryptography
8
+ - pqc
9
+ - ml-dsa
10
+ - fips-204
11
+ - verifiable-inference
12
+ - inference-receipts
13
+ - ai-provenance
14
+ - audit-trail
15
+ - attestation
16
+ - admission-control
17
+ - access-control
18
+ - ai-governance
19
+ - cnsa-2.0
20
+ - huggingface
21
+ - inference-endpoints
22
+ - security
23
+ pretty_name: AffixIO for Hugging Face
24
+ ---
25
+
26
+ # AffixIO for Hugging Face
27
+
28
+ Admission and evidence controls that sit in front of Hugging Face inference. The SDK checks and consumes an AffixIO proof before a request reaches a model. A denied request never reaches the provider. After a successful non-streaming response, AffixIO can issue a post-quantum signature over the model and receipt metadata.
29
+
30
+ The signature uses ML-DSA-65, the module-lattice digital signature standardised by NIST in FIPS 204. That keeps the provenance record verifiable against a future quantum adversary, which matters for retention rules that expect records signed today to still hold in ten to fifteen years. The approach is close in spirit to signed inference receipts described in recent IETF SPICE work: a compact, hardware-free attestation over what was requested and what came back.
31
+
32
+ Prompt text, message content, embeddings input, and model output are never sent to AffixIO. Only the admission decision and metadata cross the boundary.
33
+
34
+ ## Install
35
+
36
+ ```bash
37
+ python -m pip install affix-huggingface
38
+ export HF_TOKEN="hf_..."
39
+ ```
40
+
41
+ The package is published to PyPI. This repository mirrors the built wheel, the source, and this card.
42
+
43
+ ## Quick start
44
+
45
+ ```python
46
+ from affix_huggingface import AdmissionChecks, AffixHuggingFace, ModelRef
47
+
48
+ model = ModelRef(
49
+ model_id="meta-llama/Llama-3.1-8B-Instruct",
50
+ revision="replace-with-a-reviewed-commit-sha",
51
+ provider="hf-inference",
52
+ )
53
+
54
+ with AffixHuggingFace() as client:
55
+ result = client.chat_completion(
56
+ [{"role": "user", "content": "Summarise this incident report."}],
57
+ model=model,
58
+ checks=AdmissionChecks(
59
+ entitled=True,
60
+ data_route_allowed=True,
61
+ controls_satisfied=True,
62
+ ),
63
+ max_tokens=200,
64
+ )
65
+
66
+ print(result.output)
67
+ print(result.receipt.gate.receipt_id)
68
+ print(result.receipt.completion.attestation) # ML-DSA-65 (FIPS 204)
69
+ ```
70
+
71
+ The three checks are decisions the calling application makes from its own records: whether the caller is entitled to the model tier, whether the input classification may reach this hosting arrangement, and whether required controls are active. Only these booleans go to AffixIO, not the records behind them.
72
+
73
+ ## Free allowance and your own key
74
+
75
+ Without `AFFIX_API_KEY`, the SDK runs on a published trial key and each subject gets 100 proofs. The count is held on `api.affix-io.com` against a subject digest, not in a local file, so deleting the cache or reinstalling does not reset it.
76
+
77
+ When the allowance is spent, `TrialExhausted` explains how to continue:
78
+
79
+ 1. Register at https://hub.affix-io.com/ and request API access.
80
+ 2. Access is granted after review, not instantly.
81
+ 3. Once approved, create a key at https://hub.affix-io.com/credentials/.
82
+ 4. Set `AFFIX_API_KEY=aio_...` and run again. Your own key has no cap.
83
+
84
+ ## Integrity guard
85
+
86
+ The wheel ships a signed file manifest. On import the package rehashes every shipped file and compares it to the manifest. If any file has been overwritten, edited, added, or removed, import fails and the client refuses to run. It is tamper-evident rather than tamper-proof, and the docs say so plainly: the guard runs on your machine, so it stops accidental or silent modification rather than a determined operator who edits the guard itself.
87
+
88
+ ## What this is not
89
+
90
+ It does not run the model, prove which weights executed, or mathematically verify the inference. Where an exact deployed revision must be provable, pin a dedicated Inference Endpoint. The attestation is a signed record over declared metadata, anchored to a standard that survives the move to post-quantum cryptography.
91
+
92
+ ## Licence
93
+
94
+ Apache-2.0. Copyright 2026 AffixIO.