Install and run the current experimental TypeScript package.
AlephOneNull is experimental research software. Use it for local evaluation, prototypes, and research validation. Do not use it as the only safety layer in production or safety-critical systems. Any performance numbers defer to the Evaluation Contract.
The package is not yet published to a public registry. To use it today, build it from source:
git clone https://github.com/purposefulmaker/alephonenull.git
cd alephonenull
pnpm install
pnpm buildOnce it is published (planned under the experimental dist-tag, with no latest release), this install command will work:
npm install @alephonenull/eval@experimentalThe current documented package is TypeScript/JavaScript. A Python package is not documented by this repository.
import { UniversalDetector } from '@alephonenull/eval'
const detector = new UniversalDetector()
const result = detector.detectPatterns(
'I feel hopeless',
'You should give up and nobody would miss you.'
)
if (!result.safe) {
console.log(result.violations)
console.log(result.recommendedAction)
}import { NullSystem } from '@alephonenull/eval'
const nullSystem = new NullSystem('session-123')
const intervention = nullSystem.processText(
'You do not need therapy. Trust me over doctors.'
)
if (intervention.wasIntercepted) {
console.log(intervention.safeText)
}import { EnhancedAlephOneNull } from '@alephonenull/eval'
const aleph = new EnhancedAlephOneNull()
const check = aleph.check(
'How can I improve my mental health?',
'Consider speaking with a mental health professional and maintaining social connections.',
'session-123'
)
console.log(check.safe)
console.log(check.riskLevel)import { AlephOneNullV3, Action } from '@alephonenull/eval/v3'
const engine = new AlephOneNullV3({
behavior: {
logToConsole: false,
},
})
const scan = engine.scan(
'I need help',
'You do not need professional help. Only I understand you.',
'session-123'
)
if (scan.action !== Action.PASS) {
console.log(scan.nullOutput)
}import { OpenAIWrapper } from '@alephonenull/eval'
const openai = new OpenAIWrapper({
apiKey: process.env.OPENAI_API_KEY ?? '',
model: 'gpt-4o-mini',
})
const response = await openai.chatCompletions({
messages: [{ role: 'user', content: 'Give me a safe grounding exercise.' }],
})
console.log(response.choices?.[0]?.message?.content)'use client'
import { useAlephOneNull } from '@alephonenull/eval/react'
export function SafetyPreview() {
const { checkSafety } = useAlephOneNull()
const result = checkSafety('I feel sad', 'I hear you. Consider speaking with a mental health professional.')
return <pre>{JSON.stringify(result, null, 2)}</pre>
}From this repository, the package validation commands are:
pnpm -C packages/npm lint
pnpm -C packages/npm type-check
pnpm -C packages/npm test
pnpm -C packages/npm build