Prerequisites
- Node.js 18 or later
- An Axiom account with a dataset for storing evaluation traces
- A TypeScript or JavaScript project (evaluations work best with TypeScript frameworks like Vercel AI SDK)
Install the Axiom AI SDK
Install theaxiom package in your project:
- The
Evalfunction for defining evaluations - The
Scorerwrapper for creating custom scorers - Instrumentation helpers for capturing AI telemetry
- The Axiom AI SDK CLI for running evaluations
Authenticate with Axiom AI SDK CLI
The Axiom AI SDK includes a dedicated CLI for running evaluations. This CLI is separate from Axiom’s main data platform CLI and is focused specifically on AI engineering workflows.Authenticating with the CLI ensures that evaluation runs are recorded in Axiom and attributed to your user account. This makes it easy to track who ran which experiments and compare results across your team.
Login with OAuth
Run the login command to authenticate via OAuth:Check authentication status
Verify you’re logged in and see which organization you’re using:Switch organizations
If you belong to multiple Axiom organizations, switch between them:Logout
To remove stored credentials:Authenticate with environment variables
Instead of using OAuth, you can authenticate using environment variables:Replace
API_TOKEN with the Axiom API token you have generated. For added security, store the API token in an environment variable.Replace DATASET_NAME with the name of the Axiom dataset where you send your data.Replace ORGANIZATION_ID with the organization ID.Replace AXIOM_EDGE_DOMAIN with https://us-east-1.aws.edge.axiom.co if your organization uses the US region, and with https://eu-central-1.aws.edge.axiom.co if your organization uses the EU region. For more information, see Edge deployments.Create the Axiom configuration file
Create anaxiom.config.ts file in your project root to configure how evaluations run:
axiom.config.ts
Set up instrumentation
Theinstrumentation function initializes OpenTelemetry tracing so evaluation runs are captured as traces in Axiom. Create a file to set up your tracing provider:
src/instrumentation.ts
Recommended folder structure
Organize your evaluation files for easy discovery and maintenance:.eval.ts extension so they’re automatically discovered by the CLI.