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

kvat

v0.1.4

Published

Automatic KV-Cache Optimization for HuggingFace Transformers - Find the optimal cache strategy, attention backend, and configuration for your model and hardware.

Readme

kvat - KVCache Auto-Tuner

npm version PyPI License

Automatic KV-Cache Optimization for HuggingFace Transformers

Find the optimal cache strategy, attention backend, and configuration for your model and hardware.

Requirements

  • Node.js 14.0+
  • Python 3.9+
  • PyTorch 2.0+
  • Transformers 4.35+

Installation

npm install kvat

Then install the Python package:

pip install kvat[full]

CLI Usage

# Optimize any HuggingFace model
kvat tune meta-llama/Llama-3.2-1B --profile chat-agent

# Quick test
kvat tune gpt2 --profile ci-micro -v

# Show system info
kvat info

JavaScript API

const kvat = require('kvat');

// Check if kvat is installed
if (!kvat.isKvatInstalled()) {
  await kvat.installKvat();  // Install Python package
}

// Run tuning
const result = await kvat.tune('gpt2', {
  profile: 'chat-agent',
  outputDir: './results',
  verbose: true
});

console.log('Results saved to:', result.outputDir);

// Get system info
const info = await kvat.info();
console.log(info);

// Run arbitrary command
const { stdout, stderr, code } = await kvat.run(['profiles']);

API Reference

isKvatInstalled()

Check if the kvat Python package is installed.

Returns: boolean

installKvat(full = true)

Install the kvat Python package.

  • full (boolean): Install with full dependencies (default: true)

Returns: Promise<void>

tune(modelId, options)

Run kvat tune command.

  • modelId (string): HuggingFace model ID
  • options.profile (string): Profile name (default: 'chat-agent')
  • options.device (string): Device cuda/cpu/mps (default: 'cuda')
  • options.outputDir (string): Output directory (default: './kvat_results')
  • options.verbose (boolean): Verbose output (default: false)

Returns: Promise<{success: boolean, outputDir: string, stdout: string, stderr: string}>

info()

Get system information.

Returns: Promise<string>

run(args)

Run arbitrary kvat command.

  • args (string[]): Command arguments

Returns: Promise<{stdout: string, stderr: string, code: number}>

Available Profiles

| Profile | Context | Output | Focus | |---------|---------|--------|-------| | chat-agent | 2-8K | 64-256 | TTFT (latency) | | rag | 8-32K | 256-512 | Balanced | | longform | 4-8K | 1-2K | Throughput | | ci-micro | 512 | 32 | Quick testing |

Links

  • GitHub: https://github.com/Keyvanhardani/kvcache-autotune
  • PyPI: https://pypi.org/project/kvat/
  • Documentation: https://github.com/Keyvanhardani/kvcache-autotune#readme

License

Apache 2.0