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

@llm-dev-ops/llm-governance-types

v1.0.0

Published

Shared TypeScript types for LLM Governance Dashboard

Downloads

25

Readme

@llm-dev-ops/llm-governance-types

TypeScript type definitions for the LLM Governance Dashboard API.

Installation

npm install @llm-dev-ops/llm-governance-types

Usage

import type {
  User,
  Organization,
  Team,
  Policy,
  LLMUsage,
  AuditLog
} from '@llm-dev-ops/llm-governance-types';

// Use the types in your code
const user: User = {
  id: '123',
  email: '[email protected]',
  full_name: 'John Doe',
  is_active: true,
  is_superuser: false,
  mfa_enabled: false,
  created_at: '2024-01-01T00:00:00Z',
  updated_at: '2024-01-01T00:00:00Z'
};

Available Types

Authentication & Users

  • User - User account information
  • AuthResponse - Authentication response with token
  • LoginCredentials - Login request credentials
  • RegisterData - User registration data
  • MFASetupResponse - MFA setup information
  • MFAVerifyRequest - MFA verification request

Organizations & Teams

  • Organization - Organization entity
  • OrganizationMember - Organization membership
  • Team - Team entity
  • TeamMember - Team membership

Policies & Compliance

  • Policy - Governance policy definition
  • PolicyRule - Individual policy rule
  • PolicyViolation - Policy violation record
  • PolicyTarget - Policy application target
  • PolicyAction - Policy enforcement action
  • PolicyStatus - Policy status enumeration
  • RuleCondition - Rule condition enumeration
  • ViolationSeverity - Violation severity levels

LLM Usage & Tracking

  • LLMUsage - LLM API usage record
  • UsageStats - Usage statistics aggregation
  • ModelStats - Per-model usage statistics
  • LLMRequest - LLM API request details

Providers & Models

  • LLMProvider - LLM provider configuration
  • LLMModel - LLM model definition
  • ModelCapability - Model capability enumeration

Cost Management

  • CostBreakdown - Cost breakdown by dimension
  • Budget - Budget definition and tracking
  • Quota - Usage quota definition
  • BudgetPeriod - Budget period enumeration
  • QuotaPeriod - Quota period enumeration

Auditing

  • AuditLog - Audit log entry
  • AuditAction - Audit action enumeration
  • AuditStatus - Audit status enumeration

Dashboard & Metrics

  • DashboardMetrics - Dashboard overview metrics
  • TopModel - Top model usage statistics
  • BudgetAlert - Budget alert information

API Responses

  • ApiResponse<T> - Standard API response wrapper
  • PaginatedResponse<T> - Paginated API response
  • ApiError - API error response

Type Examples

User Type

interface User {
  id: string;
  email: string;
  full_name: string;
  is_active: boolean;
  is_superuser: boolean;
  mfa_enabled: boolean;
  created_at: string;
  updated_at: string;
  organization_id?: string;
  role?: string;
}

Policy Type

interface Policy {
  id: string;
  name: string;
  description: string;
  organization_id: string;
  rules: PolicyRule[];
  target: PolicyTarget;
  action: PolicyAction;
  status: PolicyStatus;
  created_at: string;
  updated_at: string;
  created_by: string;
}

LLM Usage Type

interface LLMUsage {
  id: string;
  user_id: string;
  organization_id: string;
  team_id?: string;
  model_id: string;
  provider_id: string;
  prompt_tokens: number;
  completion_tokens: number;
  total_tokens: number;
  cost: number;
  request_timestamp: string;
  response_timestamp: string;
  status: string;
  metadata?: Record<string, any>;
}

Organization Type

interface Organization {
  id: string;
  name: string;
  description?: string;
  created_at: string;
  updated_at: string;
  owner_id: string;
  settings?: Record<string, any>;
}

Enumerations

PolicyStatus

enum PolicyStatus {
  ACTIVE = 'active',
  INACTIVE = 'inactive',
  DRAFT = 'draft'
}

PolicyTarget

enum PolicyTarget {
  USER = 'user',
  TEAM = 'team',
  ORGANIZATION = 'organization',
  MODEL = 'model'
}

AuditAction

enum AuditAction {
  CREATE = 'create',
  UPDATE = 'update',
  DELETE = 'delete',
  LOGIN = 'login',
  LOGOUT = 'logout',
  ACCESS = 'access'
}

Usage with SDK

This package is automatically included when you install @llm-dev-ops/llm-governance-sdk:

import { LLMGovernanceSDK } from '@llm-dev-ops/llm-governance-sdk';
import type { User, Organization } from '@llm-dev-ops/llm-governance-types';

const sdk = new LLMGovernanceSDK();

// Types are automatically applied to SDK responses
const user: User = await sdk.auth.getCurrentUser();
const orgs: Organization[] = await sdk.organizations.listOrganizations();

License

Apache-2.0