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

grid-ai

v0.1.1

Published

JavaScript/TypeScript SDK for AI Power Grid open-model, OpenAI-compatible inference.

Readme

AI Power Grid — JavaScript / TypeScript SDK

Open-model, OpenAI-compatible inference across community-operated GPUs.

Release status: grid-ai is staged for its initial npm publication. The install command below becomes available when the first verified release is published; until then, use the OpenAI SDK with the Grid base URL shown below.

The Grid API speaks the OpenAI protocol, so this SDK is a thin subclass of the official openai package: it points at the Grid, reads your key from the environment, and adds Grid-specific conveniences. Everything you know from the OpenAI SDK works unchanged.

Install

npm install grid-ai

Quick start

Sign in at the Grid developer console, create an API key, then set it as AIPG_API_KEY:

import { Grid } from 'grid-ai';

const client = new Grid(); // reads AIPG_API_KEY from the environment

const stream = await client.chat.completions.create({
  model: 'gpt-oss-120b',
  messages: [{ role: 'user', content: 'Explain AI Power Grid in one line.' }],
  stream: true,
});

for await (const chunk of stream) {
  process.stdout.write(chunk.choices[0]?.delta?.content ?? '');
}

See what's online

The Grid's available models change as workers connect and disconnect. Don't hardcode a model blindly — ask which ones are servable right now:

const client = new Grid();
console.log(await client.onlineModels());
// ['gpt-oss-120b', 'qwen3-27b', ...]

An empty array means no workers are connected — requests will 503 until one is.

Credits

const credits = await client.grid.credits();
console.log(credits.total_spendable_usd);

This is Core's canonical promotional, daily-free, and purchased account view. The SDK does not maintain a local free-use counter.

Video, img2img, ControlNet, LoRAs — the full Grid

The OpenAI-compatible surface covers text and basic txt2img. For the full media parameter surface, use client.grid, which calls the synchronous /v1 image and video endpoints:

const client = new Grid();

// Video:
const result = await client.grid.video('a timelapse of a city at night', {
  model: 'LTX-2.3',
  width: 768,
  height: 512,
  seconds: 4,
  fps: 24,
});

// img2img / ControlNet / LoRAs — anything the workers support:
const img = await client.grid.image('make it watercolor', {
  models: ['FLUX.2 Klein 4B FP8'],
  sourceImage: '<base64>',
  params: { loras: [{ name: 'watercolor', model: 1.0 }] },
});

// Or full control with a raw payload:
const raw = await client.grid.generate({ prompt: '...', models: ['...'], params: {} });

client.grid waits for the synchronous Grid response and returns the finished OpenAI-shaped result. Use timeoutMs for long media jobs; there is no SDK submit/poll mode on this /v1 client.

It's just OpenAI underneath

Grid extends the openai client, so anything the OpenAI SDK does — images, tool calling, structured output, the full .chat / .images / .models surface — works here too. You can also point existing OpenAI code at the Grid by setting baseURL: 'https://api.aipowergrid.io/v1' if you'd rather not switch packages.

Config

| | | |---|---| | new Grid({ apiKey }) | Explicit key (overrides env) | | AIPG_API_KEY | Env var read when no key is passed | | new Grid({ baseURL }) | Override the endpoint (default https://api.aipowergrid.io/v1) |

All other openai client options are passed straight through.

Links

License

MIT