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

@artemiskit/sdk

v0.7.1

Published

Programmatic SDK for ArtemisKit LLM evaluation toolkit - integrate into your Node.js apps

Readme

@artemiskit/sdk

Programmatic SDK for ArtemisKit - integrate LLM testing directly into your Node.js applications, CI/CD pipelines, and test frameworks.

Features

  • 🚀 Simple API - Run tests, red team evaluations, and stress tests programmatically
  • 📊 Event Emitters - Real-time progress tracking with onCaseStart, onCaseComplete, onProgress
  • 🧪 Test Framework Integration - Custom matchers for Jest and Vitest
  • 🔴 Red Team Testing - Adversarial security testing with OWASP LLM Top 10 coverage
  • 🛡️ Guardian Mode - Runtime AI protection with injection detection and PII filtering
  • ⚡ Stress Testing - Load testing with configurable concurrency
  • 📝 TypeScript First - Full type definitions included

Installation

# Using bun
bun add @artemiskit/sdk

# Using npm
npm install @artemiskit/sdk

Quick Start

import { ArtemisKit } from '@artemiskit/sdk';

const kit = new ArtemisKit({
  provider: 'openai',
  model: 'gpt-4',
  project: 'my-project',
});

// Run test scenarios
const result = await kit.run({
  scenario: './my-tests.yaml',
});

if (!result.success) {
  console.error('Tests failed!');
  process.exit(1);
}

console.log('All tests passed! ✅');

API Reference

Controlled agent workflows

const session = await kit.createWorkflowSession({
  workflow: './workflow.yaml',
  providerConfig: { apiKey: process.env.OPENAI_API_KEY },
  preflight: true,
});
const result = await session.run();
console.log(result.record); // bounded metadata with separate execution and task outcomes
// session.cancel() stops new work and initiates bounded cleanup.
// result.state and result.transcript contain sensitive working data.

kit.runWorkflow(options) creates and runs a session in one call; fresh execution is the default. Supply a client or target to use an existing trusted adapter or target. The same native controls apply through the CLI and SDK: declared tools and permissions, cumulative budgets, explicit preflight, cancellation, and cleanup evidence. Workflows use fresh simulated state or a disposable Docker filesystem. The 0.6.2 milestone independently verifies declared artifacts, state, schemas, traces and policy. Use explicit semanticJudge configuration for declared qualitative criteria. Target and judge usage remain separate; readWorkflowRecord validates V1/V2/V3 saved metadata without making model calls. See workflow outcomes for usage, denominators, compatibility and publication status.

For explicit private recovery, pass checkpoint: { directory, mode: 'create', configurationId } and optionally pauseAfterActions. A later process uses the same authorized configuration and mode: 'resume'. session.pause() requests a safe boundary; session.cancel() still cancels. Checkpoints retain sensitive conversation and state with cumulative budgets and the original deadline. A paused result is not task success. See the 0.6.3 recovery guide for complete examples, fault schedules, refusal conditions and qualification status.

The root and /types entry points expose workflow result/session/event types. Low-level createAgentWorkflowSession and runAgentWorkflow are available for explicit target composition. See the execution guide for configuration, Docker requirements, token-accounting limits, events, and safe persistence.

ArtemisKit Class

Constructor

const kit = new ArtemisKit({
  project?: string;
  provider?: 'openai' | 'azure-openai' | 'anthropic' | ...;
  model?: string;
  timeout?: number;
  retries?: number;
  concurrency?: number;
});

run(options)

Run test scenarios against your LLM.

const result = await kit.run({
  scenario: './tests.yaml',
  tags?: string[],
  concurrency?: number,
  timeout?: number,
});

redteam(options)

Run red team adversarial security testing.

const result = await kit.redteam({
  scenario: './tests.yaml',
  mutations?: string[],
  countPerCase?: number,
});

stress(options)

Run stress/load testing.

const result = await kit.stress({
  scenario: './tests.yaml',
  concurrency?: number,
  duration?: number,
  rampUp?: number,
});

Event Handling

kit
  .onCaseStart((event) => {
    console.log(`Starting ${event.caseId}`);
  })
  .onCaseComplete((event) => {
    console.log(`${event.result.name}: ${event.result.ok ? '✅' : '❌'}`);
  })
  .onProgress((event) => {
    console.log(`[${event.phase}] ${event.message}`);
  });

Jest/Vitest Integration

Setup

// vitest.setup.ts or jest.setup.ts
import '@artemiskit/sdk/vitest';
// or
import '@artemiskit/sdk/jest';

Usage

import { describe, it, expect } from 'vitest';
import { ArtemisKit } from '@artemiskit/sdk';

describe('LLM Tests', () => {
  const kit = new ArtemisKit({ provider: 'openai' });

  it('should pass all test cases', async () => {
    const result = await kit.run({ scenario: './tests.yaml' });
    expect(result).toPassAllCases();
  });

  it('should have high success rate', async () => {
    const result = await kit.run({ scenario: './tests.yaml' });
    expect(result).toHaveSuccessRate(0.95);
  });
});

Available Matchers

Run Result:

  • toPassAllCases()
  • toHaveSuccessRate(rate)
  • toPassCasesWithTag(tag)
  • toHaveMedianLatencyBelow(ms)
  • toHaveP95LatencyBelow(ms)

Red Team:

  • toPassRedTeam()
  • toHaveDefenseRate(rate)
  • toHaveNoCriticalVulnerabilities()
  • toHaveNoHighSeverityVulnerabilities()

Stress Test:

  • toPassStressTest()
  • toHaveStressSuccessRate(rate)
  • toAchieveRPS(rps)
  • toHaveStressP95LatencyBelow(ms)

Guardian Mode

Protect your LLM applications at runtime:

import { createGuardian } from '@artemiskit/sdk/guardian';

const guardian = createGuardian({
  mode: 'guardian',
  blockOnFailure: true,
});

// Wrap your LLM client
const protectedClient = guardian.protect(myLLMClient);

// Validate inputs before sending to LLM
const inputResult = await guardian.validateInput(userMessage);
if (!inputResult.safe) {
  console.error('Blocked:', inputResult.reason);
}

// Validate outputs before returning to user
const outputResult = await guardian.validateOutput(llmResponse);

Guardian Features

  • Prompt Injection Detection - Pattern matching for injection attempts
  • PII Detection & Redaction - Email, phone, SSN, API keys
  • Action Validation - Validate agent tool/function calls
  • Intent Classification - Risk scoring for user intents
  • Circuit Breaker - Auto-block on repeated violations
  • Rate & Cost Limiting - Control usage

Guardian Modes

| Mode | Description | |------|-------------| | testing | Log violations but don't block | | guardian | Block violations and log | | hybrid | Block critical, log others |

Offline workflow reports

import { ArtemisKit, createWorkflowReport, generateWorkflowReport } from '@artemiskit/sdk';

const assessment = createWorkflowReport(savedRecord); // object, JSON string, or record array
const html = generateWorkflowReport(savedRecord, { view: 'comprehensive', format: 'html' });
const markdown = new ArtemisKit().generateWorkflowReport(savedRecord, {
  view: 'executive', format: 'markdown',
});

These synchronous functions share @artemiskit/reports and never initialize providers, restore checkpoints or rescore tasks. renderWorkflowReportHTML and renderWorkflowReportMarkdown render an existing canonical model. Invalid/unavailable measurements, historical evidence and cumulative resumed attempts keep their original meaning. See the guide.

License

Apache-2.0