Skip to main content

Requirements

OpenInference JavaScript requires:
  • Node.js 10 or higher
  • npm, yarn, or pnpm package manager

Installation

Core Dependencies

First, install the OpenTelemetry SDK packages:

Instrumentation Packages

Install the instrumentation for your LLM framework:

Manual Instrumentation

For manual instrumentation, install the semantic conventions package:

Core Utilities (Optional)

For advanced tracing features like context propagation and span wrappers:

Basic Setup

Create an instrumentation file to configure OpenTelemetry:
instrumentation.ts
The instrumentation must run before any other code in your application. Load it using the -r flag:

Next Steps

Core Package

Learn about OITracer, context attributes, and span wrappers

Semantic Conventions

Explore OpenInference semantic conventions for JavaScript

Instrumentations

View all available instrumentation packages

Quickstart

Follow the quickstart guide