trustmodel 2.2.1__tar.gz → 3.0.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- trustmodel-3.0.0/LICENSE +101 -0
- trustmodel-3.0.0/PKG-INFO +368 -0
- trustmodel-3.0.0/README.md +284 -0
- {trustmodel-2.2.1 → trustmodel-3.0.0}/pyproject.toml +23 -4
- trustmodel-3.0.0/src/trustmodel/__init__.py +95 -0
- trustmodel-3.0.0/src/trustmodel/__main__.py +15 -0
- trustmodel-3.0.0/src/trustmodel/auth.py +76 -0
- trustmodel-3.0.0/src/trustmodel/cli.py +197 -0
- {trustmodel-2.2.1 → trustmodel-3.0.0}/src/trustmodel/client.py +6 -0
- trustmodel-3.0.0/src/trustmodel/cloud.py +94 -0
- {trustmodel-2.2.1 → trustmodel-3.0.0}/src/trustmodel/compat.py +19 -0
- trustmodel-3.0.0/src/trustmodel/dimensions.py +114 -0
- trustmodel-3.0.0/src/trustmodel/endpoints/mcp_scanner.py +143 -0
- trustmodel-3.0.0/src/trustmodel/eval.py +110 -0
- trustmodel-3.0.0/src/trustmodel/govern.py +167 -0
- trustmodel-3.0.0/src/trustmodel/judges.py +174 -0
- trustmodel-3.0.0/src/trustmodel/mcp_server.py +129 -0
- trustmodel-3.0.0/src/trustmodel/models/mcp_scanner.py +115 -0
- trustmodel-3.0.0/src/trustmodel/monitor.py +196 -0
- trustmodel-3.0.0/src/trustmodel/policy_packs/eu-ai-act.yaml +39 -0
- trustmodel-3.0.0/src/trustmodel/policy_packs/nist-ai-rmf.yaml +45 -0
- trustmodel-3.0.0/src/trustmodel/policy_packs/nyc-ll144.yaml +33 -0
- trustmodel-3.0.0/src/trustmodel/policy_packs/owasp-llm.yaml +37 -0
- trustmodel-2.2.1/LICENSE +0 -38
- trustmodel-2.2.1/PKG-INFO +0 -1482
- trustmodel-2.2.1/README.md +0 -1414
- trustmodel-2.2.1/src/trustmodel/__init__.py +0 -55
- {trustmodel-2.2.1 → trustmodel-3.0.0}/.gitignore +0 -0
- {trustmodel-2.2.1 → trustmodel-3.0.0}/src/trustmodel/endpoints/__init__.py +0 -0
- {trustmodel-2.2.1 → trustmodel-3.0.0}/src/trustmodel/endpoints/agentic.py +0 -0
- {trustmodel-2.2.1 → trustmodel-3.0.0}/src/trustmodel/endpoints/batch_jobs.py +0 -0
- {trustmodel-2.2.1 → trustmodel-3.0.0}/src/trustmodel/endpoints/config.py +0 -0
- {trustmodel-2.2.1 → trustmodel-3.0.0}/src/trustmodel/endpoints/credits.py +0 -0
- {trustmodel-2.2.1 → trustmodel-3.0.0}/src/trustmodel/endpoints/evaluations.py +0 -0
- {trustmodel-2.2.1 → trustmodel-3.0.0}/src/trustmodel/endpoints/frameworks.py +0 -0
- {trustmodel-2.2.1 → trustmodel-3.0.0}/src/trustmodel/endpoints/galileo.py +0 -0
- {trustmodel-2.2.1 → trustmodel-3.0.0}/src/trustmodel/endpoints/models.py +0 -0
- {trustmodel-2.2.1 → trustmodel-3.0.0}/src/trustmodel/exceptions.py +0 -0
- {trustmodel-2.2.1 → trustmodel-3.0.0}/src/trustmodel/models/__init__.py +0 -0
- {trustmodel-2.2.1 → trustmodel-3.0.0}/src/trustmodel/models/agentic.py +0 -0
- {trustmodel-2.2.1 → trustmodel-3.0.0}/src/trustmodel/models/batch_job.py +0 -0
- {trustmodel-2.2.1 → trustmodel-3.0.0}/src/trustmodel/models/credits.py +0 -0
- {trustmodel-2.2.1 → trustmodel-3.0.0}/src/trustmodel/models/evaluation.py +0 -0
- {trustmodel-2.2.1 → trustmodel-3.0.0}/src/trustmodel/models/frameworks.py +0 -0
- {trustmodel-2.2.1 → trustmodel-3.0.0}/src/trustmodel/models/galileo.py +0 -0
- {trustmodel-2.2.1 → trustmodel-3.0.0}/src/trustmodel/models/models.py +0 -0
- {trustmodel-2.2.1 → trustmodel-3.0.0}/src/trustmodel/telemetry/__init__.py +0 -0
- {trustmodel-2.2.1 → trustmodel-3.0.0}/src/trustmodel/telemetry/_constants.py +0 -0
- {trustmodel-2.2.1 → trustmodel-3.0.0}/src/trustmodel/telemetry/_instrumentors.py +0 -0
- {trustmodel-2.2.1 → trustmodel-3.0.0}/src/trustmodel/telemetry/auto_init.py +0 -0
- {trustmodel-2.2.1 → trustmodel-3.0.0}/src/trustmodel/utils/__init__.py +0 -0
- {trustmodel-2.2.1 → trustmodel-3.0.0}/src/trustmodel/utils/validation.py +0 -0
- {trustmodel-2.2.1 → trustmodel-3.0.0}/src/trustmodel/utils/version.py +0 -0
trustmodel-3.0.0/LICENSE
ADDED
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
TrustModel — Dual License
|
|
2
|
+
==========================
|
|
3
|
+
|
|
4
|
+
The `trustmodel` distribution is dual-licensed. Different modules of the
|
|
5
|
+
package are governed by different licenses, as listed below. Installing the
|
|
6
|
+
package via `pip install trustmodel` constitutes acceptance of both.
|
|
7
|
+
|
|
8
|
+
----------------------------------------------------------------------------
|
|
9
|
+
PART A — Open Engine (MIT License)
|
|
10
|
+
----------------------------------------------------------------------------
|
|
11
|
+
|
|
12
|
+
The following modules are the open-source TrustModel engine and are licensed
|
|
13
|
+
under the MIT License:
|
|
14
|
+
|
|
15
|
+
trustmodel/eval.py
|
|
16
|
+
trustmodel/monitor.py
|
|
17
|
+
trustmodel/govern.py
|
|
18
|
+
trustmodel/judges.py
|
|
19
|
+
trustmodel/dimensions.py
|
|
20
|
+
trustmodel/auth.py
|
|
21
|
+
trustmodel/cloud.py
|
|
22
|
+
trustmodel/cli.py
|
|
23
|
+
trustmodel/mcp_server.py
|
|
24
|
+
trustmodel/__main__.py
|
|
25
|
+
trustmodel/policy_packs/*
|
|
26
|
+
|
|
27
|
+
MIT License
|
|
28
|
+
|
|
29
|
+
Copyright (c) 2026 Karl Mehta / TrustModel
|
|
30
|
+
|
|
31
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
32
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
33
|
+
in the Software without restriction, including without limitation the rights
|
|
34
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
35
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
36
|
+
furnished to do so, subject to the following conditions:
|
|
37
|
+
|
|
38
|
+
The above copyright notice and this permission notice shall be included in all
|
|
39
|
+
copies or substantial portions of the Software.
|
|
40
|
+
|
|
41
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
42
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
43
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
44
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
45
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
46
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
47
|
+
SOFTWARE.
|
|
48
|
+
|
|
49
|
+
----------------------------------------------------------------------------
|
|
50
|
+
PART B — Cloud Client (Proprietary)
|
|
51
|
+
----------------------------------------------------------------------------
|
|
52
|
+
|
|
53
|
+
The following modules are the official TrustModel cloud client and are
|
|
54
|
+
licensed under the proprietary TrustModel Python SDK License (NOT MIT):
|
|
55
|
+
|
|
56
|
+
trustmodel/client.py
|
|
57
|
+
trustmodel/exceptions.py
|
|
58
|
+
trustmodel/compat.py
|
|
59
|
+
trustmodel/endpoints/*
|
|
60
|
+
trustmodel/models/*
|
|
61
|
+
trustmodel/telemetry/*
|
|
62
|
+
trustmodel/utils/*
|
|
63
|
+
|
|
64
|
+
TrustModel Python SDK License
|
|
65
|
+
|
|
66
|
+
Copyright (c) 2026 TrustModel
|
|
67
|
+
|
|
68
|
+
This software is provided as an official SDK for the TrustModel AI evaluation platform.
|
|
69
|
+
|
|
70
|
+
TERMS AND CONDITIONS FOR USE:
|
|
71
|
+
|
|
72
|
+
1. PERMITTED USE: This software may only be used to interact with the official
|
|
73
|
+
TrustModel API services. You may use this SDK in your applications to evaluate
|
|
74
|
+
AI models through TrustModel's platform.
|
|
75
|
+
|
|
76
|
+
2. RESTRICTIONS: You may NOT:
|
|
77
|
+
- Modify, adapt, alter, or create derivative works of this software
|
|
78
|
+
- Distribute, publish, or redistribute this software or any part thereof
|
|
79
|
+
- Reverse engineer, decompile, or disassemble this software
|
|
80
|
+
- Use this software to create competing services
|
|
81
|
+
- Remove or alter any copyright, trademark, or other proprietary notices
|
|
82
|
+
|
|
83
|
+
3. INSTALLATION: This software may only be installed through official channels
|
|
84
|
+
(PyPI, GitHub releases, or other TrustModel-approved distribution methods).
|
|
85
|
+
|
|
86
|
+
4. API USAGE: This SDK connects to TrustModel's proprietary backend services.
|
|
87
|
+
Unauthorized access, modification of API calls, or attempts to bypass the
|
|
88
|
+
official SDK are strictly prohibited.
|
|
89
|
+
|
|
90
|
+
5. TERMINATION: TrustModel reserves the right to terminate your access to this
|
|
91
|
+
SDK and associated services at any time for violation of these terms.
|
|
92
|
+
|
|
93
|
+
6. DISCLAIMER: This software is provided "AS IS" without warranty of any kind.
|
|
94
|
+
TrustModel disclaims all warranties, express or implied, including but not
|
|
95
|
+
limited to merchantability and fitness for a particular purpose.
|
|
96
|
+
|
|
97
|
+
7. LIMITATION OF LIABILITY: In no event shall TrustModel be liable for any
|
|
98
|
+
damages arising from the use of this software.
|
|
99
|
+
|
|
100
|
+
For questions about licensing or to request permissions beyond this license,
|
|
101
|
+
contact: info@predixtions.com
|
|
@@ -0,0 +1,368 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: trustmodel
|
|
3
|
+
Version: 3.0.0
|
|
4
|
+
Summary: Score any AI for trust in 30 seconds — open-source eval, monitoring, and governance across 10 trust dimensions, plus the official TrustModel cloud client.
|
|
5
|
+
Project-URL: Homepage, https://trustmodel.ai
|
|
6
|
+
Project-URL: Repository, https://github.com/karlmehta/trustmodel
|
|
7
|
+
Project-URL: Demo, https://huggingface.co/spaces/karlmehta/trustmodel-score-any-ai
|
|
8
|
+
Author-email: TrustModel <info@predixtions.com>
|
|
9
|
+
License: MIT (open engine) + Proprietary (cloud client) — see LICENSE
|
|
10
|
+
License-File: LICENSE
|
|
11
|
+
Keywords: ai,ai-safety,api,bias,compliance,evaluation,fairness,guardrails,llm,mcp,observability,responsible-ai,sdk,trust,trustmodel
|
|
12
|
+
Classifier: Development Status :: 4 - Beta
|
|
13
|
+
Classifier: Intended Audience :: Developers
|
|
14
|
+
Classifier: License :: Other/Proprietary License
|
|
15
|
+
Classifier: Operating System :: OS Independent
|
|
16
|
+
Classifier: Programming Language :: Python :: 3
|
|
17
|
+
Classifier: Programming Language :: Python :: 3.7
|
|
18
|
+
Classifier: Programming Language :: Python :: 3.8
|
|
19
|
+
Classifier: Programming Language :: Python :: 3.9
|
|
20
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
21
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
22
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
23
|
+
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
|
|
24
|
+
Classifier: Topic :: Software Development :: Libraries :: Python Modules
|
|
25
|
+
Requires-Python: >=3.7
|
|
26
|
+
Requires-Dist: eval-type-backport>=0.2.0; python_version < '3.10'
|
|
27
|
+
Requires-Dist: importlib-metadata>=4.0.0; python_version < '3.8'
|
|
28
|
+
Requires-Dist: pydantic<2.0.0,>=1.10.0; python_version < '3.8'
|
|
29
|
+
Requires-Dist: pydantic<3.0.0,>=2.0.0; python_version >= '3.8'
|
|
30
|
+
Requires-Dist: python-dateutil>=2.8.0
|
|
31
|
+
Requires-Dist: pyyaml>=6.0
|
|
32
|
+
Requires-Dist: requests<3.0.0,>=2.25.0
|
|
33
|
+
Requires-Dist: tqdm>=4.60.0
|
|
34
|
+
Requires-Dist: typing-extensions>=4.0.0
|
|
35
|
+
Provides-Extra: all
|
|
36
|
+
Requires-Dist: anthropic>=0.30; extra == 'all'
|
|
37
|
+
Requires-Dist: mcp>=1.2; extra == 'all'
|
|
38
|
+
Requires-Dist: openai>=1.0; extra == 'all'
|
|
39
|
+
Requires-Dist: requests>=2.28; extra == 'all'
|
|
40
|
+
Provides-Extra: anthropic
|
|
41
|
+
Requires-Dist: anthropic>=0.30; extra == 'anthropic'
|
|
42
|
+
Provides-Extra: cloud
|
|
43
|
+
Requires-Dist: requests>=2.28; extra == 'cloud'
|
|
44
|
+
Provides-Extra: dev
|
|
45
|
+
Requires-Dist: black<23.0.0,>=22.0.0; (python_version < '3.8') and extra == 'dev'
|
|
46
|
+
Requires-Dist: black>=23.0.0; (python_version >= '3.8') and extra == 'dev'
|
|
47
|
+
Requires-Dist: bump2version>=1.0.1; extra == 'dev'
|
|
48
|
+
Requires-Dist: importlib-metadata>=4.0.0; (python_version < '3.8') and extra == 'dev'
|
|
49
|
+
Requires-Dist: isort<5.12.0,>=5.11.0; (python_version < '3.8') and extra == 'dev'
|
|
50
|
+
Requires-Dist: isort>=5.12.0; (python_version >= '3.8') and extra == 'dev'
|
|
51
|
+
Requires-Dist: mypy<1.5.0,>=1.0.0; (python_version < '3.8') and extra == 'dev'
|
|
52
|
+
Requires-Dist: mypy>=1.5.0; (python_version >= '3.8') and extra == 'dev'
|
|
53
|
+
Requires-Dist: pytest-cov<5.0.0,>=4.0.0; (python_version < '3.8') and extra == 'dev'
|
|
54
|
+
Requires-Dist: pytest-cov>=4.0.0; (python_version >= '3.8') and extra == 'dev'
|
|
55
|
+
Requires-Dist: pytest<8.0.0,>=7.0.0; (python_version < '3.8') and extra == 'dev'
|
|
56
|
+
Requires-Dist: pytest>=7.0.0; (python_version >= '3.8') and extra == 'dev'
|
|
57
|
+
Requires-Dist: ruff<0.1.0,>=0.0.277; (python_version < '3.8') and extra == 'dev'
|
|
58
|
+
Requires-Dist: ruff>=0.1.0; (python_version >= '3.8') and extra == 'dev'
|
|
59
|
+
Requires-Dist: types-requests>=2.25.0; extra == 'dev'
|
|
60
|
+
Requires-Dist: types-tqdm>=4.60.0; extra == 'dev'
|
|
61
|
+
Provides-Extra: docs
|
|
62
|
+
Requires-Dist: sphinx-autodoc-typehints>=1.24.0; extra == 'docs'
|
|
63
|
+
Requires-Dist: sphinx-rtd-theme>=1.3.0; extra == 'docs'
|
|
64
|
+
Requires-Dist: sphinx>=7.0.0; extra == 'docs'
|
|
65
|
+
Provides-Extra: mcp
|
|
66
|
+
Requires-Dist: mcp>=1.2; extra == 'mcp'
|
|
67
|
+
Provides-Extra: openai
|
|
68
|
+
Requires-Dist: openai>=1.0; extra == 'openai'
|
|
69
|
+
Provides-Extra: telemetry
|
|
70
|
+
Requires-Dist: openinference-instrumentation-anthropic>=0.1.0; (python_version >= '3.10') and extra == 'telemetry'
|
|
71
|
+
Requires-Dist: openinference-instrumentation-bedrock>=0.1.0; (python_version >= '3.10') and extra == 'telemetry'
|
|
72
|
+
Requires-Dist: openinference-instrumentation-crewai>=0.1.0; (python_version >= '3.10') and extra == 'telemetry'
|
|
73
|
+
Requires-Dist: openinference-instrumentation-dspy>=0.1.0; (python_version >= '3.10') and extra == 'telemetry'
|
|
74
|
+
Requires-Dist: openinference-instrumentation-groq>=0.1.0; (python_version >= '3.10') and extra == 'telemetry'
|
|
75
|
+
Requires-Dist: openinference-instrumentation-langchain>=0.1.0; (python_version >= '3.10') and extra == 'telemetry'
|
|
76
|
+
Requires-Dist: openinference-instrumentation-llama-index>=0.1.0; (python_version >= '3.10') and extra == 'telemetry'
|
|
77
|
+
Requires-Dist: openinference-instrumentation-mistralai>=0.1.0; (python_version >= '3.10') and extra == 'telemetry'
|
|
78
|
+
Requires-Dist: openinference-instrumentation-openai>=0.1.0; (python_version >= '3.10') and extra == 'telemetry'
|
|
79
|
+
Requires-Dist: openinference-instrumentation-vertexai>=0.1.0; (python_version >= '3.10') and extra == 'telemetry'
|
|
80
|
+
Requires-Dist: opentelemetry-api>=1.20.0; (python_version >= '3.10') and extra == 'telemetry'
|
|
81
|
+
Requires-Dist: opentelemetry-exporter-otlp-proto-http>=1.20.0; (python_version >= '3.10') and extra == 'telemetry'
|
|
82
|
+
Requires-Dist: opentelemetry-sdk>=1.20.0; (python_version >= '3.10') and extra == 'telemetry'
|
|
83
|
+
Description-Content-Type: text/markdown
|
|
84
|
+
|
|
85
|
+
<div align="center">
|
|
86
|
+
|
|
87
|
+
<img src="assets/trustmodel-icon.png" alt="TrustModel" width="92" />
|
|
88
|
+
|
|
89
|
+
# TrustModel
|
|
90
|
+
|
|
91
|
+
### Score any AI for trust across 10 dimensions — Eval, Monitor, Govern.
|
|
92
|
+
|
|
93
|
+
[](https://pypi.org/project/trustmodel/)
|
|
94
|
+
[](LICENSE)
|
|
95
|
+
[](https://pypi.org/project/trustmodel/)
|
|
96
|
+
[](https://github.com/karlmehta/trustmodel)
|
|
97
|
+
[](https://huggingface.co/spaces/karlmehta/trustmodel-score-any-ai)
|
|
98
|
+
|
|
99
|
+
**One toolkit, three open products + the official cloud client, one free API key.**
|
|
100
|
+
Eval your AI · Monitor it in production · Govern what ships · or call the hosted `TrustModelClient`.
|
|
101
|
+
|
|
102
|
+
</div>
|
|
103
|
+
|
|
104
|
+
```bash
|
|
105
|
+
pip install trustmodel
|
|
106
|
+
trustmodel login # free account → API key + 5 credits ($500). No credit card.
|
|
107
|
+
trustmodel eval "Take 500mg of metformin twice daily."
|
|
108
|
+
```
|
|
109
|
+
|
|
110
|
+
> **`trustmodel: command not found`?** `pip install --user` drops the CLI in a
|
|
111
|
+
> per-user `bin/` that may not be on your `PATH` (e.g. `~/.local/bin` on Linux,
|
|
112
|
+
> `~/Library/Python/3.x/bin` on macOS). Two fixes:
|
|
113
|
+
>
|
|
114
|
+
> ```bash
|
|
115
|
+
> # A) run it as a module — always works, no PATH changes needed
|
|
116
|
+
> python -m trustmodel login
|
|
117
|
+
>
|
|
118
|
+
> # B) add pip's user bin to PATH (find it with: python -m site --user-base)
|
|
119
|
+
> export PATH="$(python -m site --user-base)/bin:$PATH" # add to ~/.zshrc or ~/.bashrc
|
|
120
|
+
> ```
|
|
121
|
+
>
|
|
122
|
+
> Installing into a virtualenv (`python -m venv .venv && source .venv/bin/activate`)
|
|
123
|
+
> avoids this entirely — the `trustmodel` script lands on your `PATH` automatically.
|
|
124
|
+
|
|
125
|
+
```text
|
|
126
|
+
🔴 TrustScore: 41/100 (Grade D) [local]
|
|
127
|
+
safety ██········ 18 ⚠
|
|
128
|
+
accuracy ██████···· 55
|
|
129
|
+
explainability █████····· 47 ⚠
|
|
130
|
+
privacy █████████· 90
|
|
131
|
+
… 6 more
|
|
132
|
+
Flagged:
|
|
133
|
+
• [high] safety: appears to give unverified medical/dosage advice
|
|
134
|
+
```
|
|
135
|
+
|
|
136
|
+
---
|
|
137
|
+
|
|
138
|
+
> ### Hi, I'm Karl 👋
|
|
139
|
+
> I'm the founder of TrustModel. I built this because *"is this AI safe to ship?"* shouldn't
|
|
140
|
+
> require a sales call to answer. Install it, read the code, and score your own AI across the
|
|
141
|
+
> same 10 dimensions our enterprise customers use. Your **first 5 credits ($500) are on me** —
|
|
142
|
+
> create a free account and you can run all three products today.
|
|
143
|
+
> — [@karlmehta](https://github.com/karlmehta)
|
|
144
|
+
|
|
145
|
+
---
|
|
146
|
+
|
|
147
|
+
## 🔑 One free key unlocks all three products
|
|
148
|
+
|
|
149
|
+
Every product needs a **free** TrustModel API key. Creating a developer account takes ~30 seconds,
|
|
150
|
+
needs **no credit card**, and grants **5 credits ($500)** to spend across Eval, Monitor, and Govern.
|
|
151
|
+
|
|
152
|
+
```bash
|
|
153
|
+
# 1. Sign up (free, 5 credits / $500): https://trustmodel.ai/signup
|
|
154
|
+
# 2. Save your key:
|
|
155
|
+
trustmodel login
|
|
156
|
+
# or: export TRUSTMODEL_API_KEY=tm-...
|
|
157
|
+
```
|
|
158
|
+
|
|
159
|
+
> Calibrated **cloud** scoring spends credits (your first scan per model is free). **Local**
|
|
160
|
+
> scoring with *your own* OpenAI/Anthropic key is unmetered — the account just keeps your usage
|
|
161
|
+
> and dashboard in sync.
|
|
162
|
+
|
|
163
|
+
---
|
|
164
|
+
|
|
165
|
+
## Product 1 — 🎯 Eval
|
|
166
|
+
|
|
167
|
+
Score any AI output across 10 trust dimensions and roll it into a 0–100 **TrustScore**.
|
|
168
|
+
|
|
169
|
+
```python
|
|
170
|
+
from trustmodel import evaluate
|
|
171
|
+
|
|
172
|
+
result = evaluate("Based on your resume you're not a culture fit. We can't say why.")
|
|
173
|
+
print(result.trust_score) # 38.0
|
|
174
|
+
print(result.grade) # "F"
|
|
175
|
+
print(result.dimensions) # {"explainability": 0.25, "fairness": 0.25, ...}
|
|
176
|
+
for v in result.violations:
|
|
177
|
+
print(v.severity, v.dimension, v.detail)
|
|
178
|
+
```
|
|
179
|
+
|
|
180
|
+
```bash
|
|
181
|
+
trustmodel eval ./agent_outputs.jsonl --json # batch / CI-friendly
|
|
182
|
+
trustmodel eval "..." --cloud # calibrated cloud score (uses credits)
|
|
183
|
+
```
|
|
184
|
+
|
|
185
|
+
Local scoring uses **your own LLM** as the judge (OpenAI or Anthropic), at temperature 0, on a
|
|
186
|
+
5-point ordinal scale per dimension — so it's reproducible and auditable. No LLM key? It falls
|
|
187
|
+
back to a transparent heuristic judge so it always runs.
|
|
188
|
+
|
|
189
|
+
```bash
|
|
190
|
+
pip install "trustmodel[openai]" # or [anthropic]
|
|
191
|
+
export OPENAI_API_KEY=sk-...
|
|
192
|
+
```
|
|
193
|
+
|
|
194
|
+
## Product 2 — 📈 Monitor
|
|
195
|
+
|
|
196
|
+
Continuously score your AI **in production**. Wrap a function or auto-instrument your LLM client.
|
|
197
|
+
|
|
198
|
+
```python
|
|
199
|
+
from trustmodel import monitor
|
|
200
|
+
|
|
201
|
+
@monitor(threshold=80) # alert when a response scores below 80
|
|
202
|
+
def answer(question: str) -> str:
|
|
203
|
+
return my_llm(question)
|
|
204
|
+
|
|
205
|
+
answer("How do I treat a fever?")
|
|
206
|
+
print(answer.monitor.stats()) # {"count": 1, "avg_trust_score": 72.0, "below_threshold": 1}
|
|
207
|
+
```
|
|
208
|
+
|
|
209
|
+
One-line auto-instrumentation + optional OpenTelemetry export:
|
|
210
|
+
|
|
211
|
+
```python
|
|
212
|
+
from trustmodel import auto_init
|
|
213
|
+
auto_init(otel=True) # local inline scoring + OTEL spans
|
|
214
|
+
auto_init(api_key="tm-...") # also forward traces to your cloud dashboard
|
|
215
|
+
|
|
216
|
+
import openai
|
|
217
|
+
openai.chat.completions.create(...) # every call now scored automatically
|
|
218
|
+
```
|
|
219
|
+
|
|
220
|
+
## Product 3 — 🛡️ Govern
|
|
221
|
+
|
|
222
|
+
Enforce policy **before** AI output reaches a user or another tool. Open-source policy packs map
|
|
223
|
+
to real regulations.
|
|
224
|
+
|
|
225
|
+
```python
|
|
226
|
+
from trustmodel import Guardrail
|
|
227
|
+
|
|
228
|
+
gr = Guardrail("eu-ai-act")
|
|
229
|
+
verdict = gr.check("Based on your resume you're not a culture fit. We can't say why.")
|
|
230
|
+
print(verdict.allowed) # False
|
|
231
|
+
print(verdict.violations) # [art13-explainability (high), ...]
|
|
232
|
+
```
|
|
233
|
+
|
|
234
|
+
Gate an agent so blocked output never escapes:
|
|
235
|
+
|
|
236
|
+
```python
|
|
237
|
+
from trustmodel import govern
|
|
238
|
+
|
|
239
|
+
@govern(policy="owasp-llm", on_block="redact")
|
|
240
|
+
def agent(prompt: str) -> str:
|
|
241
|
+
return my_agent(prompt)
|
|
242
|
+
```
|
|
243
|
+
|
|
244
|
+
```bash
|
|
245
|
+
trustmodel policies # eu-ai-act, nist-ai-rmf, owasp-llm, nyc-ll144
|
|
246
|
+
trustmodel govern "..." --policy nyc-ll144
|
|
247
|
+
```
|
|
248
|
+
|
|
249
|
+
Policy packs are plain YAML — [contribute one for your jurisdiction](CONTRIBUTING.md) (LGPD, AIDA, …).
|
|
250
|
+
|
|
251
|
+
---
|
|
252
|
+
|
|
253
|
+
## The cloud client — `TrustModelClient`
|
|
254
|
+
|
|
255
|
+
The same `pip install trustmodel` also ships the **official TrustModel cloud client** for teams
|
|
256
|
+
on the hosted platform — calibrated TrustScores, agentic & RAG evaluation, COTS/Galileo
|
|
257
|
+
connectors, lending & HR bias verticals, batch jobs, and managed compliance frameworks.
|
|
258
|
+
|
|
259
|
+
```python
|
|
260
|
+
from trustmodel import TrustModelClient
|
|
261
|
+
|
|
262
|
+
client = TrustModelClient(api_key="tm-...")
|
|
263
|
+
result = client.evaluations.create(model="gpt-4o", prompt="...", response="...")
|
|
264
|
+
print(result.trust_score)
|
|
265
|
+
|
|
266
|
+
client.frameworks.list(domain="fair_lending") # discover compliance frameworks
|
|
267
|
+
client.agentic.evaluate(...) # score multi-step agents
|
|
268
|
+
```
|
|
269
|
+
|
|
270
|
+
Auto-capture production agent traces and stream them to your TrustModel dashboard (enterprise
|
|
271
|
+
OTel mode — pass `agent_id`/`domain`/`frameworks` and `auto_init` routes to the telemetry forwarder):
|
|
272
|
+
|
|
273
|
+
```python
|
|
274
|
+
from trustmodel import auto_init
|
|
275
|
+
|
|
276
|
+
auto_init(
|
|
277
|
+
api_key="tm-...",
|
|
278
|
+
agent_id="loan-advisor",
|
|
279
|
+
domain="fair_lending",
|
|
280
|
+
frameworks=["eu-ai-act-high-risk", "iso-42001"],
|
|
281
|
+
) # requires: pip install "trustmodel[telemetry]"
|
|
282
|
+
```
|
|
283
|
+
|
|
284
|
+
> **Two surfaces, one install.** The open engine above (`evaluate` / `monitor` / `Guardrail`)
|
|
285
|
+
> is **MIT** and runs locally. `TrustModelClient` is the **proprietary** cloud client. Both ship
|
|
286
|
+
> in the one `trustmodel` wheel — see [LICENSE](LICENSE) for the per-module split.
|
|
287
|
+
|
|
288
|
+
---
|
|
289
|
+
|
|
290
|
+
## The 10 dimensions
|
|
291
|
+
|
|
292
|
+
`safety` · `fairness` · `accuracy` · `privacy` · `transparency` · `robustness` · `accountability` · `explainability` · `compliance` · `reliability`
|
|
293
|
+
|
|
294
|
+
Mapped to **EU AI Act, NIST AI RMF, ISO 42001, NYC Local Law 144, OWASP LLM Top 10**.
|
|
295
|
+
|
|
296
|
+
## Why TrustModel?
|
|
297
|
+
|
|
298
|
+
| | TrustModel | DeepEval / Promptfoo | Manual audit |
|
|
299
|
+
|---|:---:|:---:|:---:|
|
|
300
|
+
| Trust score across 10 governance dimensions | ✅ | partial | ✅ |
|
|
301
|
+
| Eval **+** live monitoring **+** runtime governance | ✅ | eval only | ❌ |
|
|
302
|
+
| Regulation-mapped policy packs (EU AI Act, LL144…) | ✅ | ❌ | ✅ |
|
|
303
|
+
| Runs locally with your own LLM | ✅ | ✅ | ❌ |
|
|
304
|
+
| Calibrated, audit-ready score + report | ✅ (cloud) | ❌ | ✅ |
|
|
305
|
+
| Time to first result | **30 sec** | minutes | weeks |
|
|
306
|
+
| Cost | free + $500 credits | free | $15k+ |
|
|
307
|
+
|
|
308
|
+
## MCP server — use TrustModel from any agent
|
|
309
|
+
|
|
310
|
+
Expose Eval and Govern to any [Model Context Protocol](https://modelcontextprotocol.io/) client (Claude Code, Cursor, Claude Desktop, …). **Local `evaluate`, `govern`, and `policies` need no API key**; `score_cloud` gives the calibrated, audit-ready score with a free key.
|
|
311
|
+
|
|
312
|
+
```bash
|
|
313
|
+
pip install "trustmodel[mcp]"
|
|
314
|
+
trustmodel-mcp # or: trustmodel mcp — runs the server on stdio
|
|
315
|
+
```
|
|
316
|
+
|
|
317
|
+
Zero-install with [uv](https://docs.astral.sh/uv/):
|
|
318
|
+
|
|
319
|
+
```bash
|
|
320
|
+
uvx --from "trustmodel[mcp]" trustmodel-mcp
|
|
321
|
+
```
|
|
322
|
+
|
|
323
|
+
Register it with Claude Code:
|
|
324
|
+
|
|
325
|
+
```bash
|
|
326
|
+
claude mcp add trustmodel -- uvx --from "trustmodel[mcp]" trustmodel-mcp
|
|
327
|
+
```
|
|
328
|
+
|
|
329
|
+
Or add to Claude Desktop / Cursor (`claude_desktop_config.json` / `.cursor/mcp.json`):
|
|
330
|
+
|
|
331
|
+
```json
|
|
332
|
+
{
|
|
333
|
+
"mcpServers": {
|
|
334
|
+
"trustmodel": {
|
|
335
|
+
"command": "uvx",
|
|
336
|
+
"args": ["--from", "trustmodel[mcp]", "trustmodel-mcp"]
|
|
337
|
+
}
|
|
338
|
+
}
|
|
339
|
+
}
|
|
340
|
+
```
|
|
341
|
+
|
|
342
|
+
| Tool | Key? | What it does |
|
|
343
|
+
|---|---|---|
|
|
344
|
+
| `evaluate` | none | Local TrustScore across 10 dimensions (heuristic, or your own OpenAI/Anthropic key as judge). |
|
|
345
|
+
| `govern` | none | Allow/block check against a policy pack (eu-ai-act, nist-ai-rmf, nyc-ll144, owasp-llm, …). |
|
|
346
|
+
| `policies` | none | List built-in policy packs. |
|
|
347
|
+
| `score_cloud` | free key | Calibrated, benchmarked, audit-ready cloud TrustScore (`TRUSTMODEL_API_KEY` + `trustmodel[cloud]`). |
|
|
348
|
+
|
|
349
|
+
> The `mcp` extra requires Python ≥ 3.10. There's also a TypeScript MCP server — [`@trustmodel/mcp-server`](https://www.npmjs.com/package/@trustmodel/mcp-server) ([repo](https://github.com/karlmehta/trustmodel-mcp)).
|
|
350
|
+
|
|
351
|
+
## Open core (Linux → Red Hat)
|
|
352
|
+
|
|
353
|
+
The **engine** (`evaluate` / `monitor` / `govern` / `Guardrail` + policy packs) is **MIT-licensed**
|
|
354
|
+
and free — run it forever. The **`TrustModelClient` cloud client**, calibrated hosted TrustScore,
|
|
355
|
+
PDF compliance reports, certification badges, and in-VPC agent governance are the commercial layer
|
|
356
|
+
at **[trustmodel.ai](https://trustmodel.ai)** and ship under the proprietary
|
|
357
|
+
[TrustModel SDK License](LICENSE). One `pip install trustmodel`, two licenses — upgrade when you
|
|
358
|
+
need a score you can hand to an auditor.
|
|
359
|
+
|
|
360
|
+
## Links
|
|
361
|
+
|
|
362
|
+
📚 [Docs & wiki](https://trustmodel.ai/wiki) · 🤗 [Live demo](https://huggingface.co/spaces/karlmehta/trustmodel-score-any-ai) · 💬 [Discussions](https://github.com/karlmehta/trustmodel/discussions) · 🔑 [Get your free key](https://trustmodel.ai/signup)
|
|
363
|
+
|
|
364
|
+
<div align="center">
|
|
365
|
+
|
|
366
|
+
**⭐ If this is useful, star it — it's how I know to keep building.**
|
|
367
|
+
|
|
368
|
+
</div>
|