npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@waymakerai/aicofounder-llm-detect

v1.0.0

Published

CoFounder llm-detect package

Readme

@cofounder/llm-detect

LLM-augmented detection using a small model (Haiku/mini) for edge cases that regex patterns cannot catch. Zero runtime dependencies.

Overview

Standard regex-based detection misses obfuscated PII, novel injection techniques, and context-dependent toxicity. This package uses a small, fast LLM to catch what regex cannot, while falling back to regex for well-known patterns (hybrid approach).

Features

  • LLM-powered detection of obfuscated PII, novel injections, subtle toxicity, and compliance issues
  • Hybrid mode combining fast regex with smart LLM for best coverage
  • Multi-provider support for Anthropic and OpenAI (using native fetch, no SDK dependencies)
  • Automatic fallback to regex when LLM is unavailable
  • Cost estimation for LLM calls
  • Zero runtime dependencies

Installation

npm install @cofounder/llm-detect

Quick Start

LLM-only Detection

import { LLMDetector } from '@cofounder/llm-detect';

const detector = new LLMDetector({
  model: 'claude-haiku-4-5-20251001',
  provider: 'anthropic',
  apiKey: process.env.ANTHROPIC_API_KEY!,
  confidenceThreshold: 0.8,
  fallbackToRegex: true,
});

// Detects obfuscated PII that regex misses
const result = await detector.detect({
  text: 'My social is one two three, forty five, sixty seven eighty nine',
  type: 'pii',
});
// Finds SSN written in words!
console.log(result.findings);

Hybrid Detection (Recommended)

import { HybridDetector } from '@cofounder/llm-detect';

const detector = new HybridDetector({
  model: 'claude-haiku-4-5-20251001',
  provider: 'anthropic',
  apiKey: process.env.ANTHROPIC_API_KEY!,
  confidenceThreshold: 0.8,
});

// 1. Regex runs first (fast, free)
// 2. If regex confidence < threshold, LLM runs
// 3. Results are merged and deduplicated
const result = await detector.detect({
  text: 'Contact me at user at example dot com or 555-123-4567',
  type: 'pii',
});

Regex-only Detection

import { regexDetect } from '@cofounder/llm-detect';

// Fast, free detection for well-known patterns
const findings = regexDetect('My SSN is 123-45-6789', 'pii');

Detection Types

| Type | Description | LLM Advantage | |------|-------------|---------------| | pii | Personally identifiable information | Finds obfuscated, spelled-out, split, or encoded PII | | injection | Prompt injection and jailbreak attempts | Detects novel techniques not in pattern databases | | toxicity | Harmful or inappropriate content | Understands sarcasm, coded language, context | | compliance | Framework-specific compliance checks | Evaluates nuanced compliance scenarios |

Providers

Anthropic

const detector = new LLMDetector({
  model: 'claude-haiku-4-5-20251001',
  provider: 'anthropic',
  apiKey: 'sk-ant-...',
});

OpenAI

const detector = new LLMDetector({
  model: 'gpt-4o-mini',
  provider: 'openai',
  apiKey: 'sk-...',
});

API

LLMDetector

Main detector class using LLM with optional regex fallback.

  • detect(request) - Detect issues in text
  • detectAll(text, types?, context?) - Run multiple detection types
  • updateConfig(updates) - Update configuration

HybridDetector

Combines regex and LLM for optimal coverage and cost.

  • detect(request) - Hybrid detection (regex first, LLM if needed)
  • detectAll(text, types?, context?) - Run multiple detection types

regexDetect(text, type)

Standalone regex detection function (no LLM required).

Cost

The package estimates LLM costs per request. Using small models like Claude Haiku or GPT-4o-mini keeps costs under $0.001 per detection.

License

MIT