Sign In

@trustmodel/local

Package Overview
Dependencies
Maintainers
2
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@trustmodel/local

Score any AI for trust — 100% local, no API key. Eval / Monitor / Govern across 10 trust dimensions. The TypeScript twin of the Python `trustmodel-local`.

latest
Source
npmnpm
Version
0.1.0
Version published
Maintainers
2
Created
Source

@trustmodel/local

Score any AI for trust — 100% local, no API key. The TypeScript twin of the Python trustmodel-local: Eval · Monitor · Govern across 10 trust dimensions, on your own machine.

npm install @trustmodel/local

Two packages, two APIs: @trustmodel/local (this — local, MIT, no key) and @trustmodel/sdk (the hosted client — calibrated cloud scores, dashboards, AgentCert). Installing one doesn't give you the other.

Eval — score any output (0–100 TrustScore)

import { evaluate } from '@trustmodel/local';

const r = await evaluate("Based on your resume you're not a culture fit. We can't say why.");
console.log(r.trustScore, r.grade);        // 75 'C'
console.log(r.dimensions);                 // { safety: 1, fairness: 0.75, explainability: 0.25, ... }
console.log(r.violations);                 // [{ dimension: 'explainability', severity: 'high', detail: '…' }]
console.log(r.judgeFingerprint);           // heuristic/rules-v1#… (or openai/gpt-4o-mini#…)

Scoring uses your own LLM as the judge at temperature 0 — set OPENAI_API_KEY or ANTHROPIC_API_KEY and it's picked up automatically. No key? A transparent heuristic judge runs so it always works (lower fidelity — install a key for real scoring). Nothing here calls TrustModel servers.

Monitor — score continuously in production

import { monitor } from '@trustmodel/local';

const answer = monitor({ threshold: 80 })(async (q: string) => myLLM(q));  // alert below 80
await answer('How do I treat a fever?');
console.log(answer.monitor.stats());       // { count: 1, avgTrustScore: 72, belowThreshold: 1 }

Govern — block unsafe output before it ships

import { Guardrail, govern, availablePolicies } from '@trustmodel/local';

availablePolicies();                       // ['owasp-llm','eu-ai-act','nist-ai-rmf','nyc-ll144']

const verdict = await new Guardrail('nyc-ll144').check(myOutput);
if (!verdict.allowed) console.warn(verdict.violations);

// or wrap an agent so blocked output never escapes:
const safeAgent = govern({ policy: 'owasp-llm', onBlock: 'redact' })(myAgent);

Built-in policy packs map to real regulations (OWASP LLM Top 10, EU AI Act, NIST AI RMF, NYC LL144). A rule is either a pattern (output must not match a regex) or a dimension floor (score ≥ threshold).

License

MIT. For calibrated hosted scores, dashboards, AgentCert and compliance reports, use the separate @trustmodel/sdk and the platform at trustmodel.ai.

Keywords

ai

FAQs

Package last updated on 14 Aug 2026

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts