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

classer-ai

v0.0.4

Published

High-performance AI classification — real-time latency, up to 100x cheaper, beats GPT-5.4 mini accuracy

Downloads

446

Readme

classer-ai

AI text classification API. No training, no prompt engineering - just pass text and labels.

From $0.08/1M tokens · Real-time latency · Beats GPT-5.4 mini accuracy · Zero training required

See benchmarks.

Website · Docs · Dashboard

Installation

npm install classer-ai

Quick Start

import { classify, tag } from "classer-ai";

// Single-label classification
const result = await classify({
  text: "I can't log in and need a password reset.",
  labels: ["billing", "technical_support", "sales", "spam"]
});
console.log(result.label);      // "technical_support"
console.log(result.confidence); // 0.94

// With descriptions for better accuracy
const lead = await classify({
  text: "We need a solution for 500 users, what's your enterprise pricing?",
  labels: ["hot", "warm", "cold"],
  descriptions: {
    hot: "Ready to buy, asking for pricing or demo",
    warm: "Interested but exploring options",
    cold: "Just browsing, no clear intent"
  }
});
console.log(lead.label); // "hot"

// Multi-label tagging
const tagged = await tag({
  text: "Breaking: Tech stocks surge amid AI boom",
  labels: ["politics", "technology", "finance", "sports"],
  threshold: 0.5
});
for (const t of tagged.labels) {
  console.log(`${t.label}: ${t.confidence}`);
}
// technology: 0.92
// finance: 0.78

Configuration

No API key is needed to get started. To unlock higher rate limits, get an API key from classer.ai/api-keys.

export CLASSER_API_KEY=your-api-key

Or configure programmatically:

import { ClasserClient } from "classer-ai";

const client = new ClasserClient({
  apiKey: "your-api-key"
});

API Reference

classify(request)

Classify text into exactly one of the provided labels.

const result = await classify({
  text: "Text to classify",
  labels: ["label1", "label2"],   // 1-200 possible labels
  descriptions: { label1: "Description for better accuracy" },
  priority: "standard",           // "standard" (default, <1s) or "fast" (<200ms)
  cache: true,                    // set to false to bypass cache
  image: undefined,               // image URL or base64 string (or array)
  file: undefined,                // PDF/DOCX — URL or base64 string
});

result.label          // selected label
result.confidence     // 0-1 confidence score
result.tokens         // total tokens used
result.visual_tokens  // image tokens (when image or file provided)
result.latency_ms     // processing time in ms
result.cached         // whether served from cache

tag(request)

Multi-label tagging — returns all labels above a confidence threshold.

const result = await tag({
  text: "Text to tag",
  labels: ["label1", "label2"],
  threshold: 0.5,                 // default: 0.5
  priority: "standard",
  image: undefined,               // image URL or base64 string (or array)
  file: undefined,                // PDF/DOCX — URL or base64 string
});

for (const t of result.labels) {
  console.log(`${t.label}: ${t.confidence}`);
}

classifyBatch(request)

Classify multiple texts in a single request.

const result = await classifyBatch({
  texts: ["I can't log in", "What's the pricing?"],
  labels: ["billing", "technical", "sales"],
  file: undefined,                // shared file for all texts
  image: undefined,               // shared image for all texts
});

for (const r of result.results) {
  console.log(`${r.label}: ${r.confidence}`);
}

result.total_tokens    // total across all texts
result.latency_ms      // total request time

tagBatch(request)

Tag multiple texts in a single request.

const result = await tagBatch({
  texts: ["Tech stocks surge", "Election results"],
  labels: ["politics", "technology", "finance"],
  threshold: 0.5,
});

for (const r of result.results) {
  for (const t of r.labels ?? []) {
    console.log(`${t.label}: ${t.confidence}`);
  }
}

Image and file inputs

const result = await classify({
  image: base64String,
  labels: ["cat", "dog", "bird"]
});

const result = await classify({
  file: base64String,
  labels: ["invoice", "receipt", "contract"]
});

image accepts a base64 string, URL, or an array of either. file accepts a base64 string or URL. Both work with classify, tag, and batch methods.

Error Handling

import { ClasserError } from "classer-ai";

try {
  const result = await classify({ text: "hello", labels: ["a", "b"] });
} catch (e) {
  if (e instanceof ClasserError) {
    console.error(e.status);  // HTTP status code
    console.error(e.detail);  // Error detail from API
  }
}

Documentation

Full API reference and guides at docs.classer.ai.

GitHub

github.com/classer-ai/classer-js

License

MIT