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

model-ops

v1.0.3

Published

ModelOps — track LLM usage, cost, latency and model performance

Readme

ModelOps SDK

License: ISC TypeScript Providers

ModelOps is a TypeScript SDK that unifies OpenAI, Anthropic, and Gemini behind a single API while automatically tracking tokens, latency, estimated cost, and business context.

Build once. Switch providers. Understand your AI usage.

Why ModelOps

  • One SDK for OpenAI, Anthropic, and Gemini
  • Automatic token, latency, and cost tracking
  • Business-aware analytics with request context
  • Unified request and response API
  • Zero custom observability pipeline

Note: Cost is estimated from public provider pricing and may differ from your invoice if you use enterprise pricing, discounts, cached tokens, batch APIs, or other provider-specific billing rules.

Why not use the provider SDKs?

You absolutely can. But once you need to support multiple providers or understand AI usage in production, you'll likely end up building much of the same infrastructure yourself.

Instead of building that yourself, ModelOps gives you:

  • One API across multiple providers
  • Built-in observability
  • Token and cost tracking
  • Business-level analytics
  • A centralized dashboard

How it works

ModelOps wraps the official provider APIs.

Your application continues calling OpenAI, Anthropic, or Gemini through a single SDK, while ModelOps automatically collects telemetry and sends it to your dashboard.

No proxy or infrastructure changes required.

Installation

npm install model-ops

Environment Variables

Before using the SDK:

  1. Create a ModelOps account at https://modelops.me
  2. Copy your ModelOps API key from Account Settings
  3. Set at least one provider API key

Provider keys can be loaded from environment variables:

OPENAI_API_KEY=your_openai_api_key
ANTHROPIC_API_KEY=your_anthropic_api_key
GEMINI_API_KEY=your_gemini_api_key

ModelOps also requires your platform API key:

MODELOPS_API_KEY=your_modelops_api_key

You can provide provider keys through environment variables or directly in modelKeys.

Quick Start

Send your first request:

import { ModelOps, ModelOpsChatRequest } from "model-ops";

const modelOps = new ModelOps({
	apiKey: process.env.MODELOPS_API_KEY!,
	modelKeys: {
		openai: process.env.OPENAI_API_KEY,
		anthropic: process.env.ANTHROPIC_API_KEY,
		gemini: process.env.GEMINI_API_KEY,
	},
	captureContent: false,
});

const request: ModelOpsChatRequest = {
	provider: "openai",
	model: "gpt-4.1-mini",
	messages: [
		{
			role: "user",
			content: "Tell me a joke",
		},
	],
};

const response = await modelOps.chat(request);
console.log(response.content);

Business Context (Recommended for production)

Business context helps you analyze usage by product surface, customer, and workflow instead of only tokens and requests.

const response = await modelOps.chat({
	provider: "openai",
	model: "gpt-4.1-mini",
	messages: [
		{ role: "user", content: "Plan a 3-day trip to Tokyo." },
	],
	context: {
		useCase: "trip-planning",
		feature: "generate-itinerary",
		customerId: "cust_123",
		sessionId: "sess_456",
		workflowId: "wf_789",
		environment: "production",
	},
});

What Is Tracked Automatically

Each request records:

  • Provider
  • Model
  • Input tokens
  • Output tokens
  • Total tokens
  • Estimated request cost
  • Request latency
  • Success or failure
  • Optional business context

Privacy

By default, ModelOps sends only telemetry needed for observability.

Collected data includes:

  • Provider
  • Model
  • Token usage
  • Estimated cost
  • Latency
  • Request context (optional)

Prompt and response content is not collected unless content capture is enabled.

Your provider API keys are used only to send requests directly to the selected provider and are never stored by ModelOps.

const modelOps = new ModelOps({
	apiKey: process.env.MODELOPS_API_KEY!,
	captureContent: true,
});

Supported Providers

  • OpenAI
  • Anthropic
  • Gemini

More providers are planned.

Dashboard Insights

ModelOps dashboard insights include:

  • Cost per feature
  • Cost per customer
  • Cost per provider
  • Cost per model
  • Token usage trends
  • Latency trends
  • Error rates
  • Request volume

Early Access Pricing

ModelOps is currently free while we're building the platform and gathering feedback from early adopters.

Paid plans will be introduced in the future for advanced capabilities such as longer data retention, team collaboration, optimization recommendations, alerts, and enterprise features.

We'll communicate any pricing changes well in advance.

Roadmap

Available today:

  • Unified SDK
  • OpenAI, Anthropic, and Gemini support
  • Token tracking
  • Estimated cost
  • Latency tracking
  • Business context
  • AI usage dashboard

Coming soon:

  • Prompt optimization recommendations
  • Model recommendations
  • Prompt caching suggestions
  • RAG optimization
  • Cost anomaly detection
  • Automatic model routing

Links

  • Product dashboard: https://modelops.me
  • npm package: https://www.npmjs.com/package/model-ops
  • GitHub repository: https://github.com/adipeleg/modelOps

License

ISC