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

openmodelkit

v1.0.8

Published

Minimal JS SDK + CLI to list open models and chat by model name + prompt.

Readme

OpenModelKit

npm version Node.js License: MIT

List open models, filter them, and chat — with a model name and a prompt.

Zero runtime dependencies. Works with Ollama, NVIDIA and many more. Includes a small JS SDK, CLI, and first-class LangChain / LangGraph support via ChatOpenModelKit.

npm install openmodelkit

Requires Node.js 18+.


Quick start

1. List free models

import { listModels } from 'openmodelkit';

const { models } = await listModels({
  provider: 'ollama',
  free: true,
});

for (const model of models || []) {
  console.log(model.id || model.name);
}

2. Chat with a model

import { chat } from 'openmodelkit';

const reply = await chat({
  provider: 'ollama',
  model: 'gemma4',
  prompt: 'Explain gravity in simple words',
});

console.log(reply);

3. Full flow (list → chat)

import { listModels, chat } from 'openmodelkit';

const { models } = await listModels({ provider: 'ollama', free: true });
const model = models[0].id || models[0].name;

const reply = await chat({
  provider: 'ollama',
  model,
  prompt: 'Say hello in one sentence',
});

console.log(`Model: ${model}`);
console.log(reply);

Providers

| Provider | Usage | | --- | --- | | Ollama | provider: 'ollama' | | NVIDIA | provider: 'nvidia' |


Model filters

Ollama

| Filter | Values | Description | | --- | --- | --- | | free | true | Free models only | | premium | true | Premium models only | | category | all · free · cloud · embedding · vision · tools · thinking | Filter by model type | | order | popular · newest | Sort order | | page | number | Page number | | limit | number | Results per page |

import { listModels } from 'openmodelkit';

await listModels({ provider: 'ollama', free: true });
await listModels({ provider: 'ollama', premium: true });
await listModels({ provider: 'ollama', category: 'vision' });
await listModels({ provider: 'ollama', category: 'embedding' });
await listModels({ provider: 'ollama', category: 'tools' });
await listModels({ provider: 'ollama', category: 'thinking' });
await listModels({ provider: 'ollama', category: 'cloud' });
await listModels({
  provider: 'ollama',
  category: 'all',
  order: 'newest',
  page: 1,
  limit: 20,
});

NVIDIA

| Filter | Values | Description | | --- | --- | --- | | free | true | Free endpoint models only | | premium | true | Partner / premium models only | | page | number | Page number | | limit | number | Results per page |

import { listModels } from 'openmodelkit';

await listModels({ provider: 'nvidia', free: true });
await listModels({ provider: 'nvidia', premium: true });
await listModels({ provider: 'nvidia', page: 1, limit: 50 });

Authentication

Pass your provider API key when chatting (recommended for production):

await chat({
  provider: 'ollama',
  model: 'gemma4',
  prompt: 'hi',
  apiKey: process.env.OLLAMA_API_KEY,
});
await chat({
  provider: 'nvidia',
  model: 'meta/llama-3.1-8b-instruct',
  prompt: 'hi',
  apiKey: process.env.NVIDIA_API_KEY,
});

Or set environment variables:

export OLLAMA_API_KEY=your_ollama_key
export NVIDIA_API_KEY=your_nvidia_key

Never commit API keys to source control.


LangChain and LangGraph

OpenModelKit ships ChatOpenModelKit, a LangChain BaseChatModel. Use it with LangChain tools, bindTools(), and LangGraph graphs (agent + tool loops).

@langchain/core is an optional peer dependency. Install it when you use this integration. For graphs, also install @langchain/langgraph.

npm install openmodelkit @langchain/core @langchain/langgraph

LangChain chat

import { ChatOpenModelKit } from 'openmodelkit';
import { HumanMessage } from '@langchain/core/messages';

const llm = new ChatOpenModelKit({
  provider: 'ollama',
  model: 'gemma4',
  apiKey: process.env.OLLAMA_API_KEY,
});

const reply = await llm.invoke([
  new HumanMessage('Explain gravity in simple words'),
]);

console.log(reply.content);

Tools with LangChain

import { ChatOpenModelKit } from 'openmodelkit';
import { tool } from '@langchain/core/tools';
import { z } from 'zod';

const weather = tool(
  async ({ city }) => `Weather in ${city}: sunny, 24°C`,
  {
    name: 'get_weather',
    description: 'Get the current weather for a city',
    schema: z.object({ city: z.string() }),
  }
);

const llm = new ChatOpenModelKit({
  provider: 'ollama',
  model: 'gemma4',
}).bindTools([weather]);

const reply = await llm.invoke('What is the weather in Paris?');
console.log(reply.tool_calls);

LangGraph agent

ChatOpenModelKit works as the model node in a LangGraph StateGraph. Bind tools, then use ToolNode and toolsCondition for the agent loop.

import { ChatOpenModelKit } from 'openmodelkit';
import { StateGraph, MessagesAnnotation, START } from '@langchain/langgraph';
import { ToolNode, toolsCondition } from '@langchain/langgraph/prebuilt';
import { HumanMessage, SystemMessage } from '@langchain/core/messages';
import { tool } from '@langchain/core/tools';
import { z } from 'zod';

const weather = tool(
  async ({ city }) => `Weather in ${city}: sunny, 24°C`,
  {
    name: 'get_weather',
    description: 'Get the current weather for a city',
    schema: z.object({ city: z.string() }),
  }
);

const tools = [weather];
const llm = new ChatOpenModelKit({
  provider: 'ollama',
  model: 'gemma4',
}).bindTools(tools);

const graph = new StateGraph(MessagesAnnotation)
  .addNode('agent', async (state) => {
    const out = await llm.invoke([
      new SystemMessage('You are a helpful assistant. Use tools when needed.'),
      ...state.messages,
    ]);
    return { messages: [out] };
  })
  .addNode('tools', new ToolNode(tools))
  .addEdge(START, 'agent')
  .addConditionalEdges('agent', toolsCondition)
  .addEdge('tools', 'agent')
  .compile();

const result = await graph.invoke({
  messages: [new HumanMessage('What is the weather in Paris?')],
});

console.log(result.messages.at(-1).content);

NVIDIA works the same way — set provider: 'nvidia' and model to an NVIDIA model id.


CLI

# List models
npx openmodelkit models --provider ollama --free
npx openmodelkit models --provider ollama --premium
npx openmodelkit models --provider nvidia --free

# Chat
npx openmodelkit chat --provider ollama -m gemma4 "Say hello"
npx openmodelkit chat --provider nvidia -m meta/llama-3.1-8b-instruct "Say hello"

# Help
npx openmodelkit help

API overview

| Export | Purpose | | --- | --- | | listModels(options) | List models with provider filters | | chat(options) | Send a prompt and get a response | | listProviders(options) | List available providers | | OpenModelKit | Reusable client for repeated calls | | ChatOpenModelKit | LangChain BaseChatModel for LangChain and LangGraph | | OpenModelKitError | Structured error (message, code, status) |

TypeScript types are included.


Requirements

  • Node.js 18+ (native fetch)
  • A valid provider API key when the upstream service requires one
  • Optional: @langchain/core (and @langchain/langgraph) for LangChain / LangGraph

Author

Built and maintained by Aakash Chhoker.


License

MIT