
Security News
The Hidden Blast Radius of the Axios Compromise
The Axios compromise shows how time-dependent dependency resolution makes exposure harder to detect and contain.
OpenTelemetry-native Auto instrumentation library for monitoring LLM Applications, facilitating the integration of observability into your GenAI-driven projects
Documentation | Quickstart | Roadmap | Feature Request | Report a Bug

OpenLIT SDK is a monitoring framework built on top of OpenTelemetry that gives your complete Observability for your AI stack, from LLMs to vector databases, with just one line of code with tracing and metrics. It also allows you to send the generated traces and metrics to your existing monitoring tools like Grafana, New Relic, and more.
This project proudly follows and maintains the Semantic Conventions with the OpenTelemetry community, consistently updating to align with the latest standards in Observability.
| LLMs |
|---|
| ✅ OpenAI |
| ✅ Anthropic |
| ✅ Cohere |
| ✅ Groq |
| ✅ Mistral |
| ✅ Google AI Studio |
| ✅ Together AI |
| ✅ Ollama |
| ✅ AWS Bedrock |
| ✅ Hugging Face |
| ✅ Replicate |
| ✅ Azure OpenAI (via OpenAI SDK) |
| Vector Databases |
|---|
| ✅ Chroma |
| ✅ Pinecone |
| ✅ Qdrant |
| ✅ Milvus |
| Frameworks |
|---|
| ✅ LangChain |
| ✅ LlamaIndex |
| ✅ Vercel AI SDK |
The following metrics are supported across all integrations:
These metrics allow you to monitor usage, performance, and cost for supported GenAI operations.
npm install openlit
Open your command line or terminal and run:
npm install openlit
Integrate OpenLIT into your AI applications by adding the following lines to your code.
import Openlit from 'openlit';
Openlit.init();
Configure the telemetry data destination as follows:
| Purpose | Parameter/Environment Variable | For Sending to OpenLIT |
|---|---|---|
| Send data to an HTTP OTLP endpoint | otlpEndpoint or OTEL_EXPORTER_OTLP_ENDPOINT | "http://127.0.0.1:4318" |
| Authenticate telemetry backends | otlpHeaders or OTEL_EXPORTER_OTLP_HEADERS | Not required by default |
💡 Info: If the
otlp_endpointorOTEL_EXPORTER_OTLP_ENDPOINTis not provided, the OpenLIT SDK will output traces directly to your console, which is recommended during the development phase.
Add the following two lines to your application code:
import Openlit from 'openlit';
Openlit.init({
otlpEndpoint: 'YOUR_OTEL_ENDPOINT',
otlpHeaders: 'YOUR_OTEL_ENDPOINT_AUTH'
});
Add the following two lines to your application code:
import Openlit from "openlit"
Openlit.init()
Then, configure the your OTLP endpoint using environment variable:
export OTEL_EXPORTER_OTLP_ENDPOINT = "YOUR_OTEL_ENDPOINT"
export OTEL_EXPORTER_OTLP_HEADERS = "YOUR_OTEL_ENDPOINT_AUTH"
Now that your LLM observability data is being collected and sent to configured OpenTelemetry destination, the next step is to visualize and analyze this data. This will help you understand your LLM application's performance and behavior and identify where it can be improved.
If you want to use OpenLIT's Observability Dashboard to monitor LLM usage—like cost, tokens, and user interactions—please check out our Quickstart Guide.
If you're sending metrics and traces to other observability tools, take a look at our Connections Guide to start using a pre-built dashboard we have created for these tools.

Openlit.init()Below is a detailed overview of the configuration options available, allowing you to adjust OpenLIT's behavior and functionality to align with your specific observability needs:
| Argument | Description | Default Value | Required |
|---|---|---|---|
environment | The deployment environment of the application. | "default" | No |
applicationName | Identifies the name of your application. | "default" | No |
tracer | An instance of OpenTelemetry Tracer for tracing operations. | undefined | No |
otlpEndpoint | Specifies the OTLP endpoint for transmitting telemetry data. | undefined | No |
otlpHeaders | Defines headers for the OTLP exporter, useful for backends requiring authentication. | undefined | No |
disableBatch | A flag to disable batch span processing, favoring immediate dispatch. | true | No |
traceContent | Enables tracing of content for deeper insights. | true | No |
disabledInstrumentations | List of instrumentations to disable. | undefined | No |
instrumentations | Object of instrumentation modules for manual patching | undefined | No |
pricing_json | URL or file path of the pricing JSON file. | https://github.com/openlit/openlit/blob/main/assets/pricing.json | No |
Openlit.getPrompt()Below are the parameters for use with the SDK for OpenLIT Prompt Hub for prompt management:
| Parameter | Description |
|---|---|
url | Sets the OpenLIT URL. Defaults to the OPENLIT_URL environment variable or http://127.0.0.1:3000 if not set. |
apiKey | Sets the OpenLIT API Key. Can also be provided via the OPENLIT_API_KEY environment variable. |
name | Sets the name to fetch a unique prompt. Use this or promptId. |
promptId | Sets the ID to fetch a unique prompt. Use this or name. Optional |
version | Sets the version to retrieve a specific prompt. Optional |
shouldCompile | Boolean value that compiles the prompt using the provided variables. Optional |
variables | Sets the variables for prompt compilation. Optional |
metaProperties | Sets the meta-properties for storing in the prompt's access history metadata. |
Openlit.getSecrets()Below are the parameters for use with the SDK for OpenLIT Vault for secret management:
| Parameter | Description |
|---|---|
url | Sets the Openlit URL. Defaults to the OPENLIT_URL environment variable or http://127.0.0.1:3000 if not set. |
apiKey | Sets the OpenLIT API Key. Can also be provided via the OPENLIT_API_KEY environment variable. |
key | Sets the key to fetch a specific secret. Optional |
tags | Sets the tags for fetching only the secrets that have the mentioned tags assigned. Optional |
shouldSetEnv | Boolean value that sets all the secrets as environment variables for the application. Optional |
Openlit.evaluateRule()Evaluate trace attributes against the OpenLIT Rule Engine to retrieve matching rules and associated entities (contexts, prompts, evaluation configurations).
| Parameter | Description |
|---|---|
url | Sets the OpenLIT URL. Defaults to the OPENLIT_URL environment variable or http://127.0.0.1:3000. |
apiKey | Sets the OpenLIT API Key. Can also be provided via the OPENLIT_API_KEY environment variable. |
entityType | Type of entity to match: "context", "prompt", or "evaluation". |
fields | Object of trace attributes to evaluate against rules. e.g. { "gen_ai.system": "openai" } |
includeEntityData | If true, include full entity data in the response. Default: false. Optional |
entityInputs | Optional object of inputs for entity resolution (e.g. prompt variables). |
import Openlit from 'openlit';
const result = await Openlit.evaluateRule({
entityType: 'context',
fields: {
'gen_ai.system': 'openai',
'gen_ai.request.model': 'gpt-4',
'service.name': 'my-app',
},
includeEntityData: true,
});
if (!('err' in result)) {
console.log('Matching rules:', result.matchingRuleIds);
console.log('Entities:', result.entities);
}
Whether it's big or small, we love contributions 💚. Check out our Contribution guide to get started
Unsure where to start? Here are a few ways to get involved:
Your input helps us grow and improve, and we're here to support you every step of the way.
Connect with the OpenLIT community and maintainers for support, discussions, and updates:
FAQs
OpenTelemetry-native Auto instrumentation library for monitoring LLM Applications, facilitating the integration of observability into your GenAI-driven projects
The npm package openlit receives a total of 1,322 weekly downloads. As such, openlit popularity was classified as popular.
We found that openlit demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 2 open source maintainers collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
The Axios compromise shows how time-dependent dependency resolution makes exposure harder to detect and contain.

Research
A supply chain attack on Axios introduced a malicious dependency, plain-crypto-js@4.2.1, published minutes earlier and absent from the project’s GitHub releases.

Research
Malicious versions of the Telnyx Python SDK on PyPI delivered credential-stealing malware via a multi-stage supply chain attack.