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

deepeval-ts

v0.1.14

Published

The LLM Evaluation Framework for TypeScript

Readme

DeepEval.ts

TypeScript client for Confident AI's DeepEval API - a framework for evaluating and testing Large Language Models (LLMs).

Installation

npm install deepeval-ts

Authentication

DeepEval.ts requires a Confident AI API key to authenticate with the service. You can set up your API key in one of the following ways:

Option 1: Environment Variables

Set the CONFIDENT_API_KEY environment variable:

# In your terminal
export CONFIDENT_API_KEY="your-api-key-here"

# Or for Windows
set CONFIDENT_API_KEY=your-api-key-here

Option 2: .env File

Create a .env file in your project root:

# .env file
CONFIDENT_API_KEY="your-api-key-here"

Then use a package like dotenv to load it:

npm install dotenv
// At the top of your entry file
import 'dotenv/config';

Option 3: Pass API Key Directly

You can also pass your API key directly when creating an API instance:

import { Api } from 'deepeval-ts';

const api = new Api("your-api-key-here");

Usage Examples

Working with Datasets

import { EvaluationDataset, LLMTestCase } from 'deepeval-ts';
import * as path from 'path';

// Load dataset from CSV
const dataset = new EvaluationDataset();
await dataset.addTestCasesFromCsvFile(
  'path/to/dataset.csv',
  'input_column',
  'actual_output_column',
  'expected_output_column'
);

// Create dataset programmatically
const customDataset = new EvaluationDataset();
customDataset.addTestCase(
  new LLMTestCase({
    input: "What is the capital of France?",
    actualOutput: "Paris is the capital of France.",
    expectedOutput: "Paris"
  })
);

// Iterate through test cases
for (const testCase of dataset.testCases) {
  console.log(`Input: ${testCase.input}`);
  console.log(`Output: ${testCase.actualOutput}`);
}

API Reference

EvaluationDataset

The EvaluationDataset class manages collections of test cases for LLM evaluation.

// Create a new dataset
const dataset = new EvaluationDataset();

// Add test cases from CSV
await dataset.addTestCasesFromCsvFile(
  filePath,           // Path to CSV file
  inputColumn,        // Name of input column
  actualOutputColumn, // Name of actual output column
  expectedOutputColumn, // Name of expected output column (optional)
  contextColumn,      // Name of context column (optional)
  contextDelimiter,   // Delimiter for context values (optional)
  retrievalContextColumn, // Name of retrieval context column (optional)
  retrievalContextDelimiter // Delimiter for retrieval context values (optional)
);

// Add a test case programmatically
dataset.addTestCase(
  new LLMTestCase({
    input: "What is the capital of France?",
    actualOutput: "Paris is the capital of France.",
    expectedOutput: "Paris",
    context: ["France is a country in Europe.", "Paris is a city."],
    retrievalContext: ["Paris is the capital and most populous city of France."]
  })
);

LLMTestCase

The LLMTestCase class represents individual test cases for LLM evaluation.

const testCase = new LLMTestCase({
  input: "What is the capital of France?",
  actualOutput: "Paris is the capital of France.",
  expectedOutput: "Paris",
  context: ["France is a country in Europe.", "Paris is a city."],
  retrievalContext: ["Paris is the capital and most populous city of France."],
  toolCalls: [
    {
      name: "search",
      input: { query: "capital of France" },
      output: { result: "Paris is the capital of France" }
    }
  ]
});

Development

To build the package locally:

npm run build

To run tests:

npm test

License

MIT