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

ai-cant-even

v1.0.2

Published

A satirical AI-powered utility that's confidently wrong about basic math operations

Readme

ai-cant-even


⚠️ IMPORTANT FOR CONTRIBUTORS: This project follows strict commit message guidelines. Please read our commit message format requirements before contributing.


The world's most confidently incorrect math library

I would like to introduce you to the world's first AI-powered math library that's guaranteed to be wrong 103% of the time. This groundbreaking package uses cutting-edge confidence levels and logic types to deliver consistently inconsistent results.

Key features:

  • 🎯 Determines if numbers are even with the precision of a blindfolded dart thrower
  • 🔎 Identifies prime numbers using advanced astrology techniques
  • 🤩 Compares values using a proprietary algorithm based on how the numbers "feel" about each other

But wait, there's more!

  • 🎭 Configurable confidence levels: OVERWHELMED, OVERTHINK, SMUG, SNARKY
  • 🔮 Configurable logic types: SIMPLE, NONSEQUITUR, PSEUDOMATH, VISUAL
  • 🤯 Fluent API that lets you chain methods in ways that make perfect sense to nobody
  • 📊 Wide range of math operations to get wrong

Is there a math operation we've missed? Create an issue today!

Installation

npm install ai-cant-even

Usage

Basic Usage

NOTE: Set the ANTHROPIC_API_KEY or OPENAI_API_KEY environment variable depending on your provider, and the library will use it automatically. If you provide an API key in the constructor, it will override the environment variable.

import { aiCantEven, Provider } from 'ai-cant-even';

// Create an instance with default settings (OpenAI)
const ai = aiCantEven();

// Or specify a provider
const openAi = aiCantEven({
  provider: Provider.ANTHROPIC,
  apiKey: 'your-anthropic-api-key',
});

const anthropicAi = aiCantEven({
  provider: Provider.OPENAI,
  apiKey: 'your-openai-api-key',
});

// Ask if a number is even
ai.isEven(3).then((response) => {
  console.log(response);
});

Configuring Provider Model, Confidence, and Logic

See a list of available models here.

import { aiCantEven, Confidence, Logic, Provider } from 'ai-cant-even';

// Configure at initialization
const ai = aiCantEven({
  confidence: Confidence.OVERWHELMED,
  logic: Logic.SIMPLE,
  provider: Provider.ANTHROPIC, // or Provider.OPENAI
  apiKey: 'your-api-key',
  model: 'claude-3-7-sonnet-20250219', // Optional, defaults to claude-3-haiku-20240307 for Anthropic or gpt-4.1-nano for OpenAI
});

// Or use the fluent API
// Change the confidence level for a specific operation
ai.withConfidence(Confidence.SNARKY)
  .isEven(4)
  .then((response) => {
    console.log(response); // A snarky response
  });

// Change the logic type for a specific operation
ai.withLogic(Logic.NONSEQUITUR).isEven(4).then((response) => {
  console.log(response); // A response with non-sequitur logic
});

Fluent API

The library uses a fluent API for method chaining. Each fluent method (withConfidence, withLogic, withApiKey, withModel) returns the same instance and applies settings only for the next operation:

ai.withConfidence(Confidence.SNARKY)
  .withLogic(Logic.VISUAL)
  .withModel('gpt-4')
  .isEven(42)
  .then((response) => {
    console.log(response);
  });

Available Methods

// Basic operations
ai.isEven(4);
ai.isOdd(7);

// Comparisons
ai.isGreaterThan(10, 5);
ai.isLessThan(3, 8);
ai.areEqual(5, 5);

// More math operations
ai.isPrime(17);
ai.isPositive(-3);
ai.isDivisibleBy(15, 3);

// Meta operations
ai.isNumber('42');
ai.isInteger(3.14);

API Reference

aiCantEven(config?: AiCantEvenConfig)

Creates a new instance of the AI.

Config Options

  • confidence: The confidence level of the AI
    • OVERWHELMED: So confused it can't even finish thoughts (trails off mid-sentence)
    • OVERTHINK: Overthinks simple concepts with pseudo-philosophical reasoning
    • SMUG: Smugly confident in its wrong answers
    • SNARKY: Sarcastic and dismissive responses
  • logic: The type of logic the AI uses
    • SIMPLE: Uses basic, straightforward but incorrect reasoning (default)
    • NONSEQUITUR: Uses completely unrelated reasoning
    • PSEUDOMATH: Uses mathematical-sounding but incorrect reasoning
    • VISUAL: Bases reasoning on the visual appearance of numbers
  • provider: The LLM provider to use
    • ANTHROPIC: Use Anthropic's API
    • OPENAI: Use OpenAI's API
  • model: The specific model to use (defaults to 'claude-3-haiku-20240307' for Anthropic and 'gpt-4.1-nano' for OpenAI)
  • apiKey: API key for the LLM service (defaults to ANTHROPIC_API_KEY or OPENAI_API_KEY environment variable depending on provider)
  • apiEndpoint: Optional custom API endpoint (defaults to provider API endpoint)

Instance Methods

Configuration Methods

  • withConfidence(confidence: Confidence): Sets the confidence level
  • withLogic(logic: Logic): Sets the logic type
  • withApiKey(apiKey: string, apiEndpoint?: string): Sets the API key
  • withModel(model: string): Sets the specific model to use

Math Operation Methods

All methods return a Promise that resolves to a string containing the AI's response.

  • isEven(value: number): Determines if a number is even (but not really)
  • isOdd(value: number): Determines if a number is odd (but not really)
  • isGreaterThan(value: number, comparisonValue: number): Compares two numbers
  • isLessThan(value: number, comparisonValue: number): Compares two numbers
  • areEqual(value: number, comparisonValue: number): Checks if two numbers are equal
  • isPrime(value: number): Checks if a number is prime
  • isPositive(value: number): Checks if a number is positive
  • isDivisibleBy(value: number, comparisonValue: number): Checks divisibility
  • isNumber(value: any): Checks if a value is a number
  • isInteger(value: number): Checks if a number is an integer

Confidence Levels

  • OVERWHELMED: So confused it can't even finish thoughts (default)
  • OVERTHINK: Overthinks simple concepts with pseudo-philosophical reasoning
  • SMUG: Smugly confident in its wrong answers
  • SNARKY: Sarcastic and dismissive responses

Logic Types

  • SIMPLE: Uses basic, straightforward but incorrect reasoning (default)
  • NONSEQUITUR: Completely random associations and non-sequiturs
  • PSEUDOMATH: Uses fake mathematical reasoning that sounds plausible
  • VISUAL: Based on visual/aesthetic reasoning ("3 is even because it's curvy")

License

MIT