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

cacheai-transformer

v1.0.0

Published

Client-side SDK for decentralized cross-origin local AI Cache and model weights reuse via a centralized secure iframe proxy.

Readme

cacheai-transformer 🚀

An elegant, production-ready Client-side SDK for Decentralized, Cross-Origin Local AI Weight Sharing.

By sharing a single centralized browser iframe host (https://cc.lemone.online), cacheai-transformer lets developers embed on-device WebGPU models (via Transformers.js and ONNX) into multiple distinct third-party web applications without requiring duplicate downloads of huge model files (e.g., 600MB - 2.5GB).


📦 Why Use Shared Cache?

  1. Storage De-duplication: Traditional browsers isolate IndexedDB and Cache Storage by security origin (domain). If a user visits app-a.com and app-b.com which both use local models, they have to download the model twice. By hosting the execution thread inside a single shared iframe running on https://cc.lemone.online, they share the exact same hot-cache state globally.
  2. Instant Hot-Starts: Downloading a 1GB model takes minutes. Reusing the cache takes less than 120ms.
  3. Fully Private & Client-Side: All calculations run directly on the user's CPU/GPU via WebGPU and WebAssembly. No prompts, audio streams, or history databases are ever sent to remote services.

🛠️ Installation

Install the package via npm:

npm install cacheai-transformer

💻 Usage & Code Examples

1. Initialize Client

The client automatically injects the background sandboxed iframe on instantiation and hooks into bidirectional message streams.

import { CerebralCortexClient } from 'cacheai-transformer';

// Instantiate the SDK client
const client = new CerebralCortexClient({
  sandboxUrl: 'https://cc.lemone.online',
  defaultModel: 'LemOneLabs/Qwen3-0.6B-ONNX'
});

// Explicitly wait for iframe connection if needed (or let methods handle it lazily)
await client.init();

2. Text / Chat Generation

Supports streaming callbacks, nucleolus sampling (top_p), creative temperature adjustments, and multi-turn chat logs.

try {
  const result = await client.generate(
    "How does WebGPU accelerate neural models?",
    {
      temperature: 0.7,
      max_new_tokens: 256,
      thinkEnabled: true // Optional: supports Gemma-4 / reasoning models
    },
    // Optional progress callback (for initial downloads)
    (progress) => {
      console.log(`[${progress.status}] Loaded ${progress.percentage}% of file: ${progress.file}`);
    },
    // Optional streaming token callback
    (token) => {
      process.stdout.write(token);
    }
  );

  console.log("\nFinal Response:", result.response);
  console.log("Benchmarks:", result.performance);
} catch (error) {
  console.error("Inference aborted:", error);
}

3. Vision / Image Description

Describe and analyze images locally without API bills.

const base64Image = "data:image/jpeg;base64,..."; // Or remote URL

const visionResult = await client.generateVision(
  base64Image,
  "Describe this image and identify what objects are in it.",
  {
    modelId: 'onnx-community/Janus-1.3B-ONNX' // Or your chosen vision model
  }
);

console.log("Vision Output:", visionResult.response);

4. Local Music Generation

Generate sound effects or ambient musical themes directly inside the browser.

const musicResult = await client.generateMusic(
  "A quiet, relaxing piano melody with a gentle acoustic guitar accompaniment.",
  {
    modelId: 'Xenova/musicgen-small'
  }
);

// Returns a local Object URL of the compiled WAV audio file
console.log("Audio WAV URL:", musicResult.audio);
console.log("Sample Rate:", musicResult.sampling_rate);

// Create an audio player node dynamically
const audio = new Audio(musicResult.audio);
audio.play();

5. speechToText & textToSpeech

Synthesize audio tracks or transcribe speech streams on-device.

// 1. Text-To-Speech (TTS) Synthesis
const tts = await client.textToSpeech("Decentralized computing is the future of client-side web application designs.");
const audioNode = new Audio(tts.audio);
audioNode.play();

// 2. Speech-To-Text (STT) Transcription
const audioBuffer = new Float32Array([...]); // raw audio sample floats
const stt = await client.speechToText(audioBuffer, {
  modelId: 'onnx-community/whisper-tiny.en'
});
console.log("Transcribed speech text:", stt.response);

6. Utility Functions & Telemetry

Check Cache Contents

Inspect which models are currently cached in IndexedDB:

const cachedModels = await client.getCacheInfo();
console.log("Active caches:", cachedModels);

Clear Cache Weights

Wipe all cached ONNX parameters from disk to reclaim VRAM or storage:

const clearReport = await client.clearCache();
console.log(`Cleared ${clearReport.count} models successfully.`);

Stop Execution

Halt active pipeline operations or weight downloads:

await client.interrupt();

Detect Local Accelerations (Omnix Daemon)

Check if the user is running the ultra-fast local desktop companion daemon (Omnix) to shift execution natively:

const isOmnixLocal = await client.isOmnixRunning();
if (isOmnixLocal) {
  console.log("Omnix desktop daemon is active! Native speed enabled.");
}

⚖️ License

Apache-2.0 License. Designed with ♥ by LemOneLabs.