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

@try-works/tool-mode-runtime-onnx

v0.1.1

Published

ONNX Runtime engine for Tool Mode: an Effect OnnxSession with execution-provider negotiation and the uhm/waveform-v1 filler processor

Readme

@try-works/tool-mode-runtime-onnx

The ONNX Runtime engine for the Tool Mode local model runtime (Phase 3): one onnxruntime-node session, shared by every processor this build implements.

Engine

onnxLayer({ modelBytes, accelerators, ... }) provides the OnnxSession Effect service. It acquires one onnxruntime-node session in the layer scope (so a provider cannot leak a native handle) and releases it when the scope closes. Execution providers are negotiated from the recipe's declared lanes against what the installed engine reports as bundled — the first declared lane that works wins, and there is no silent CPU fallback for a lane the recipe did not declare. This host reports cpu, dml and webgpu as bundled (onnxruntime-node 1.30.0, win32-x64).

Provider factory

createProviderFromRecipe(recipe, assets, options?) is the factory a code-free model-runtime recipe names. It owns the engine and the processor; the recipe supplies the artifact, limits and tool schemas. The factory shares one lifecycle across processors (resolve artifact, build session, validate graph tensor names, relay abort/timeout, dispose) and dispatches on processor.id.

uhm/waveform-v1 — filler words

WAV decode (PCM 16-bit and float32, mono or stereo down-mix), linear resample to 16 kHz, 480000-sample windows with a 1 s overlap and a zero-padded final window, one run per window, argmax per 20 ms frame, filler = class != 0 and probability >= 0.5, spans merged across window overlap (one-frame gaps tolerated) and clipped to the audio length. Output: { fillers: [{ startMs, endMs, type, confidence }], coverage: { complete, processedSeconds, totalSeconds, reason? } }. Reads labels.json beside the model.

clear/stft-v1 — speech enhancement

The pinned clear-studio.onnx graph takes HOST-COMPUTED features (spec, feat_erb, feat_spec) and returns spec_enhanced; it is DeepFilterNet3. Every parameter is ported from the primary source, desert-ant-core commit baf4e6e3b4655c8e54aa8d5a25215b5f35f899a7:

  • Sources/Clear/DSP.swift L31-46 (n_fft 960, hop 480, 481 bins, nErb 32, nDf 96, convLookahead 2, 48 kHz, normAlpha 0.99, ERB widths summing to 481), L271-302 (Vorbis window, forward gain 1/960, 480-sample prepad), L343-476 (framing, Hermitian mirror, unscaled inverse DFT, windowed COLA overlap-add);
  • Sources/Clear/Features.swift L20-125 (ERB dB with the -60..-90 dB running-mean state ramp divided by 40; unit-norm of the first 96 complex bins with the 1e-3..1e-4 ramp);
  • Sources/Clear/Enhancer.swift L55-73, L185-259 (200-frame windows, interleaved [1,1,200,481,2] / [1,1,200,32] / [1,1,200,96,2], features read two frames ahead);
  • Sources/Clear/Clear.swift L428-434, L478-494 (48 kHz, mono downmix, mastering);
  • Sources/AudioDSP/Loudness.swift L24-27, L90-244, L264-285 (BS.1770-4 K-weighting, 400 ms blocks at 100 ms, -70/-10 gating, target -19 LUFS, +9 dB upward cap);
  • Sources/AudioDSP/Limiter.swift L28-30, L169-198 (5 ms look-ahead, 50 ms release, -1.5 dBTP ceiling).

The descriptor is { audio_path } only: there is no writable path in InvocationContextV1, so the enhanced audio comes back as a base64 WAV. Output: { audio_base64, sampleRate: 48000, durationSeconds, coverage: { complete, processedSeconds, totalSeconds, reason? } } — 16-bit PCM, mono, 48 kHz. The duration is capped by the HOST's context.limits.maxResultBytes (maxSamplesForResultBudget); with the default 8 MiB budget that is 3,145,322 samples (65.5275 s), and coverage.complete is false with a reason when the cap bites.

Tests

npm test runs the unit suite: fake-session lifecycle, WAV/DSP parameter tests against the primary source constants, the clear pipeline over an echo engine, and the response-budget arithmetic. The real-inference gates are skipped unless TOOL_MODE_REAL_ASSETS=1 and the pinned assets exist under .assets/uhm and .assets/clear.