Skip to content

Core package reference

Source: core repository guide, snapshot e58778bef40b. Synced 2026-10-24. Package versions are independent of milestone labels.

Core runtime, evaluators, and storage for the ArtemisKit LLM evaluation toolkit.

Terminal window
npm install @artemiskit/core
# or
bun add @artemiskit/core

This package provides the foundational components for ArtemisKit:

  • Runner - Execute test scenarios against LLM providers
  • Evaluators - Built-in expectation matchers (contains, exact, regex, fuzzy, llm_grader, json_schema)
  • Storage - Local filesystem and Supabase storage backends
  • Redaction - PII/sensitive data filtering with built-in patterns
  • Schema - YAML scenario parsing and validation

Controlled agent workflows use createAgentWorkflowSession({ workflow, target }) or runAgentWorkflow({ workflow, target }), with createModelClientTarget(client) for existing adapters. The native session enforces declared tools, original argument schemas, permissions, cumulative budgets, and bounded cancellation/cleanup. Environments are fresh simulated state or a disposable Docker filesystem; unsupported authority fails closed.

The returned record contains bounded metadata. state and transcript are sensitive working data and are not persisted automatically. The 0.6.2 engine independently checks declared outcomes; optional qualitative checks require explicit semanticJudge configuration with separate limits. readWorkflowRecord validates V1/V2 metadata without rescoring historical runs. See the outcome guide and execution guide for session events, transport limits, Docker prerequisites, and CLI/SDK use.

Most users should use the @artemiskit/cli package for running evaluations. This package is primarily for programmatic usage or building custom integrations.

import {
parseScenarioFile,
runScenario,
createAdapter
} from '@artemiskit/core';
// Parse a scenario file
const scenario = await parseScenarioFile('./my-test.yaml');
// Create an adapter (requires adapter package to be registered)
const client = await createAdapter({
provider: 'openai',
apiKey: process.env.OPENAI_API_KEY,
});
// Run the scenario
const result = await runScenario({
scenario,
client,
project: 'my-project',
onCaseComplete: (caseResult, index, total) => {
console.log(`Completed ${index + 1}/${total}: ${caseResult.passed ? 'PASS' : 'FAIL'}`);
},
});
console.log(`Success: ${result.success}`);
console.log(`Passed: ${result.manifest.metrics.passed_cases}/${result.manifest.metrics.total_cases}`);

Note: The createAdapter function requires adapter packages (like @artemiskit/adapter-openai) to be installed and registered. For standalone usage, import adapters directly:

import { OpenAIAdapter } from '@artemiskit/adapter-openai';
const client = new OpenAIAdapter({
provider: 'openai',
apiKey: process.env.OPENAI_API_KEY,
});

Built-in expectation types:

TypeDescription
containsCheck if response contains text
not_containsCheck if response does NOT contain text
exactExact string match
regexRegular expression match
fuzzyFuzzy string similarity (Levenshtein)
similaritySemantic similarity matching (embedding or LLM-based)
llm_graderLLM-based response grading
json_schemaValidate JSON structure
combinedAND/OR logic between multiple assertions
inlineSafe expression-based custom matchers

Built-in patterns for sensitive data:

  • email - Email addresses
  • phone - Phone numbers
  • ssn - Social Security Numbers
  • credit_card - Credit card numbers
  • api_key - API keys (sk_, pk_, etc.)
  • jwt - JWT tokens
  • aws_key - AWS access keys
  • ipv4 - IPv4 addresses
  • secrets - Password/secret assignments
import { Redactor, BUILTIN_PATTERNS } from '@artemiskit/core';
const redactor = new Redactor({
enabled: true,
patterns: [BUILTIN_PATTERNS.EMAIL, BUILTIN_PATTERNS.PHONE],
});
const result = redactor.redact('Contact: user@example.com');
// result.text = 'Contact: [REDACTED]'

Apache-2.0