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

@langgraph-toolkit/community

v0.2.3

Published

Optional community model provider presets for Langgraph-Toolkit, including Hugging Face and OpenAI-compatible open-source deployments.

Downloads

785

Readme

@langgraph-toolkit/community

Optional, explicit integrations for Langgraph-Toolkit. Community supplies provider drivers, caller-owned model tiers and generic RAG. It does not select a vendor, model, credential, fallback, database schema or application workflow for you.

Install only when you need an optional integration

npm install @langgraph-toolkit/core @langgraph-toolkit/community

Use Core alone for state, graphs, tools and execution. Add Community only when an application explicitly needs an open-source or OpenAI-compatible provider, a model pool or generic RAG.

Declare model configuration in the application

The application owns provider selection. Put credentials in the host application's environment and declare the driver, model and endpoint in its config module. Community validates the declaration during bootstrap and fails before a request is handled when a required value is absent.

import { createModelRegistry } from "@langgraph-toolkit/community";

export const models = createModelRegistry({
  tiers: {
    chat: {
      driver: "openai-compatible",
      model: process.env.MODEL_NAME!,
      tokenEnv: "MODEL_API_KEY",
      baseUrlEnv: "MODEL_BASE_URL",
      temperature: 0.1,
    },
  },
});

The snippet does not name a default vendor or model. An application can configure DeepSeek, Ollama, vLLM, TGI, LiteLLM or another compatible endpoint by setting its own MODEL_* variables. Missing MODEL_NAME, MODEL_API_KEY or MODEL_BASE_URL throws during composition rather than silently selecting a fallback.

Use an explicit provider without a registry

import { createOpenAICompatible } from "@langgraph-toolkit/community";

const model = createOpenAICompatible({
  driver: "openai-compatible",
  model: process.env.MODEL_NAME!,
  tokenEnv: "MODEL_API_KEY",
  baseUrlEnv: "MODEL_BASE_URL",
});

For Hugging Face, use createHuggingFace() with driver: "huggingface", an explicit model and tokenEnv. Both factories accept an optional environment reader so workers and tests can inject configuration without mutating process globals.

ModelPool policies

createModelPool() accepts caller-owned tiers and exposes typed policy helpers. Selection remains in the application resource, where a developer can inspect or replace it.

import { createModelPool } from "@langgraph-toolkit/community";

const pool = createModelPool({
  tiers: {
    fast: modelConfigFast,
    careful: modelConfigCareful,
  },
});

const selected = pool.routing((tiers, input) =>
  input.messages.length > 4 && tiers.includes("careful") ? "careful" : "fast",
);

routing() delegates a tier decision to application code. fallback(), loadBalance() and ensemble() operate only on the explicitly named tiers. None creates a provider or model implicitly.

Generic RAG

RAG is provider-neutral. Supply both the model and retriever. Community does not assume SQL, a vector vendor, a database row type or a chat-only workflow.

import { createRAG } from "@langgraph-toolkit/community";

const rag = createRAG({
  model,
  retriever: {
    async retrieve(query, options = {}) {
      return searchDocuments(query, options.topK ?? 5);
    },
  },
  name: "knowledge-answer",
});

Package boundary

| Boundary | Owns | Does not own | | --- | --- | --- | | Core | State, graph topology, execution, events, interrupts and generic tool contracts | Providers, transports, database schema or product workflow | | MCP | Server declarations, discovery, typed tools, resources and connection lifecycle | Domain-specific agents, database rows or framework routes | | Community | Provider drivers, model policies and generic RAG | Default model selection, application workflows, Core execution or HTTP transport | | Application example | Prompting, state, node, edge, routing, MCP tool policy and business response | Hidden package convention that prevents customization | | Adapters | Host lifecycle, HTTP routes and serialization | Prompt policy, model selection, MCP server selection or domain schema |

Development

npm install
npm run build
npm test

Contributors should add typed contracts, TSDoc and deterministic tests for each public provider, model policy or generic RAG capability. Do not add a domain workflow, default provider, model fallback or credential guessing to this package.

License

MIT