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

@cernova/sdk

v0.1.5

Published

The detection layer for LLM pipelines — wraps Anthropic and OpenAI clients to capture tokens, latency, and cost, with per-step anomaly detection

Downloads

747

Readme

@cernova/sdk

The detection layer for LLM pipelines. Wraps Anthropic's messages.create/messages.stream and OpenAI's chat.completions.create to automatically capture tokens, latency, and cost — Cernova runs per-step anomaly detection on every call and alerts you when something silently regresses.

Install

npm install @cernova/sdk @anthropic-ai/sdk

Quick start

import Anthropic from '@anthropic-ai/sdk';
import { Tracer } from '@cernova/sdk';

const tracer = new Tracer({ apiKey: process.env.CERNOVA_API_KEY! });
const anthropic = tracer.wrapAnthropic(new Anthropic());

const response = await anthropic.messages.create({
  model: 'claude-haiku-4-5-20251001',
  max_tokens: 256,
  messages: [{ role: 'user', content: 'Hello!' }],
  _trace: { stepName: 'my-step' },
});
// response is the normal Anthropic Message — your code is unchanged

Multi-step runs

Group multiple LLM calls into a single traced run so you can see the full pipeline in the dashboard:

const run = anthropic.run();

const step1 = await run.messages.create({
  model: 'claude-haiku-4-5-20251001',
  max_tokens: 16,
  messages: [{ role: 'user', content: 'Classify this: "refund request"' }],
  _trace: { stepName: 'classify' },
});

const step2 = await run.messages.create({
  model: 'claude-haiku-4-5-20251001',
  max_tokens: 256,
  messages: [{ role: 'user', content: `Reply to a ${text(step1)} inquiry.` }],
  _trace: { stepName: 'generate-reply' },
});

console.log(run.runId); // same run_id groups both steps in the dashboard

Streaming

messages.stream is fully supported — tokens and latency are captured after the stream ends with zero impact on streaming latency:

const stream = run.messages.stream({
  model: 'claude-haiku-4-5-20251001',
  max_tokens: 512,
  messages: [{ role: 'user', content: 'Tell me a story.' }],
  _trace: { stepName: 'story' },
});

for await (const event of stream) {
  if (event.type === 'content_block_delta' && event.delta.type === 'text_delta') {
    process.stdout.write(event.delta.text);
  }
}
// trace is ingested automatically once stream completes

API

new Tracer(config)

| Field | Type | Required | Description | |---|---|---|---| | apiKey | string | yes | Your Cernova project API key | | apiUrl | string | | Override ingest URL — defaults to Cernova's servers | | runId | string | | Custom run ID — auto-generated UUID if omitted |

tracer.wrapAnthropic(client)

Returns a wrapped client with .messages.create(), .messages.stream(), and .run().

anthropic.run()

Creates a TracedRun — a fresh run_id that groups all steps called on it. Each call to run() resets the step index to 0.

_trace option

_trace: {
  stepName?: string;  // label shown in the dashboard (default: step_1, step_2, …)
}

Stripped before forwarding to Anthropic — the provider never sees it.

What gets captured

| Field | Source | |---|---| | run_id | run.runId or tracer.runId | | step_name | _trace.stepName | | model | response.model | | input_tokens / output_tokens | response.usage | | latency_ms | wall-clock ms | | cost | computed from built-in pricing table | | status_success | true on success, false on thrown error | | output_code | full text content from response | | error | error message if the call threw |

Ingest is fire-and-forget

The POST to /ingest never blocks your app. Network failures are logged to console.warn and silently dropped — your LLM calls always complete normally.

Dashboard

View traces, anomaly scores, AI-powered run analysis, and cost breakdowns at cernova.dev.