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

@delta-ltsc/sdk

v0.3.1

Published

TypeScript SDK for Delta LTSC - Lossless Token Sequence Compression

Readme

@delta-ltsc/sdk

npm License: MIT

TypeScript SDK for Delta LTSC - Lossless Token Sequence Compression for LLMs.

Reduce LLM inference costs by compressing repetitive token patterns in prompts while maintaining perfect reconstruction. Achieve 30-60% compression on structured inputs with a format that fine-tuned models can understand.

Features

  • Lossless compression - Perfect round-trip reconstruction guaranteed
  • High performance - Rust/WASM core with O(n log n) suffix array algorithms
  • Cross-platform - Works in browsers, Node.js, Deno, and edge runtimes
  • Streaming support - Handle inputs of any size with constant memory
  • Worker threads - Non-blocking compression for large inputs
  • Static dictionaries - Pre-built patterns for Python, TypeScript, SQL, and more
  • TypeScript-first - Full type safety and IntelliSense support

Installation

npm install @delta-ltsc/sdk

Quick Start

import { compress, decompress, initWasm } from '@delta-ltsc/sdk';

// Initialize WASM module (required once)
await initWasm();

// Compress tokens
const tokens = [1, 2, 3, 1, 2, 3, 1, 2, 3, 1, 2, 3, 1, 2, 3];
const result = await compress(tokens);

console.log(`Compressed: ${result.originalLength} → ${result.compressedLength} tokens`);
console.log(`Savings: ${((1 - result.compressionRatio) * 100).toFixed(1)}%`);

// Decompress (lossless)
const restored = await decompress(result.serializedTokens);
console.assert(JSON.stringify(tokens) === JSON.stringify(restored));

Configuration

const result = await compress(tokens, {
  // Pattern discovery
  minSubsequenceLength: 2,    // Minimum pattern length (default: 2)
  maxSubsequenceLength: 8,    // Maximum pattern length (default: 8)
  
  // Selection algorithm
  selectionMode: 'greedy',    // 'greedy' | 'optimal' | 'beam'
  
  // Hierarchical compression
  hierarchicalEnabled: true,  // Allow patterns of patterns
  hierarchicalMaxDepth: 3,    // Maximum nesting depth
  
  // Verification
  verify: true,               // Enable round-trip verification
});

Static Dictionaries

Use pre-built dictionaries for domain-specific compression:

const result = await compress(pythonCodeTokens, {
  staticDictionary: 'python-v1',
});

Available dictionaries: python-v1, typescript-v1, markdown-v1, json-v1, sql-v1

Streaming

For large inputs that exceed memory constraints:

import { createStreamingCompressor } from '@delta-ltsc/sdk';

const compressor = await createStreamingCompressor();

for await (const chunk of tokenStream) {
  await compressor.addChunk(chunk);
}

const result = await compressor.finish();

Worker Threads

Non-blocking compression for UI responsiveness:

import { createWorkerPool } from '@delta-ltsc/sdk';

const pool = await createWorkerPool(4);
const result = await pool.compress(tokens);
pool.terminate();

Browser Usage

<script type="module">
  import { compress, initWasm } from 'https://esm.sh/@delta-ltsc/sdk';
  
  await initWasm();
  const result = await compress([1, 2, 3, 1, 2, 3]);
  console.log('Compression ratio:', result.compressionRatio);
</script>

API Reference

Core Functions

| Function | Description | |----------|-------------| | compress(tokens, config?) | Compress a token sequence | | decompress(tokens, config?) | Decompress to original tokens | | discoverPatterns(tokens, minLen?, maxLen?) | Find patterns without compressing |

Streaming

| Function | Description | |----------|-------------| | createStreamingCompressor(config?) | Create a streaming compressor instance | | compressStream(asyncIterable, config?) | Compress an async iterable stream |

Workers

| Function | Description | |----------|-------------| | createWorkerPool(count?) | Create a pool of worker threads | | compressInWorker(tokens, config?) | Single-use worker compression |

Dictionaries

| Function | Description | |----------|-------------| | loadStaticDictionary(id) | Load a built-in dictionary | | createStaticDictionary(id, patterns) | Create a custom dictionary |

Utilities

| Function | Description | |----------|-------------| | initWasm() | Initialize the WASM module | | isWasmInitialized() | Check initialization status | | extractDictionary(tokens) | Extract dictionary from compressed tokens | | isCompressed(tokens) | Check if tokens are in compressed format |

Documentation

Optional ML Features

For pattern importance scoring and quality prediction:

npm install @delta-ltsc/ml
import { HeuristicQualityPredictor } from '@delta-ltsc/ml';

const predictor = new HeuristicQualityPredictor();
const prediction = await predictor.predict(compressionResult);

if (!prediction.acceptable) {
  console.log(`Recommendation: ${prediction.recommendation}`);
}

License

MIT License - see LICENSE for details.

Contributors

Built by Triage Sec - an applied team of researchers and engineers working towards building resiliency for AI systems.

  • Nikhil Srivastava (University of California, Berkeley)
  • Omansh Bainsla (Georgia Tech)
  • Sahil Chatiwala (Georgia Tech)