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

@lizzard-solutions/node-red-contrib-openrouter

v0.0.2

Published

Node-RED nodes to interact with the OpenRouter API

Downloads

7

Readme

node-red-contrib-openrouter

A collection of Node-RED nodes for working with the OpenRouter API. This package centralizes model selection via a shared config node and provides chat, routing, ranking, evaluation, embeddings, memory, formatting, tools orchestration, and a simple in-memory vector store.

Features

  • Shared config node (openrouter-config) is the single source of truth for model and API key
  • Chat completions (openrouter-chat)
  • Embeddings (openrouter-embedding)
  • Router/classifier (openrouter-router)
  • Ranker (openrouter-ranker)
  • Evaluator/LLM-based scoring (openrouter-evaluator)
  • Conversation memory with optional summarization (openrouter-memory)
  • Cost tracker (openrouter-cost-tracker)
  • Prompt templating (openrouter-prompt) and content formatter (openrouter-formatter)
  • Multi-agent orchestrator (openrouter-orchestrator)
  • Basic vector-store node (openrouter-vector-store) for demos
  • Utilities (openrouter-tools)

All nodes use the shared openrouter-config for the model. Per-node model inputs and defaults have been removed.

Installation

cd ~/.node-red
npm install node-red-contrib-openrouter

Restart Node-RED after install. The nodes will appear under the "OpenRouter" category.

Repository layout

node-red-contrib-openrouter/
├─ src/                      # All Node-RED nodes (html/js pairs)
│  ├─ openrouter-config.*    # Shared config node (keep model/API key here)
│  ├─ openrouter-chat.*
│  ├─ openrouter-embedding.*
│  ├─ openrouter-router.*
│  ├─ openrouter-ranker.*
│  ├─ openrouter-evaluator.*
│  ├─ openrouter-memory.*
│  ├─ openrouter-orchestrator.*
│  ├─ openrouter-cost-tracker.*
│  ├─ openrouter-formatter.*
│  ├─ openrouter-prompt.*
│  ├─ openrouter-tools.*
│  └─ openrouter-vector-store.*
├─ examples/
│  └─ example_flow.json      # Importable Node-RED flow
├─ package.json
└─ README.md

Configure the shared config node

  1. Drag openrouter-config into your workspace (or open it from any node that references it).
  2. Enter your OpenRouter API key.
  3. Set the model (e.g., openai/gpt-4o-mini).
  4. Optionally set siteUrl and siteName headers for OpenRouter attribution.

If the model is not set in openrouter-config, runtime nodes will error with:

"No model specified. Set a model in the shared config"

Node overview

  • openrouter-chat: Chat completion. Input: msg.payload (string) or msg.messages (array). Output: msg.payload text, msg.response raw.
  • openrouter-embedding: Embeddings for a string or array. Output: msg.embedding (single) or msg.embeddings (array), plus msg.usage.
  • openrouter-router: Classifies msg.payload into one of N routes -> dynamic outputs based on descriptions you define.
  • openrouter-ranker: Ranks candidate responses in msg.candidates and selects the best into msg.payload.
  • openrouter-evaluator: Evaluates msg.payload with criteria prompt and returns score/validation/JSON.
  • openrouter-memory: Maintains per-session history buffer; optional summarization via shared model.
  • openrouter-orchestrator: Chains/parallelizes multiple agent steps using the shared model.
  • openrouter-cost-tracker: Estimates cost based on token usage; adjustable rates.
  • openrouter-prompt: Simple templating helper.
  • openrouter-formatter: Convert markdown to HTML, etc.
  • openrouter-tools: Misc utilities used by other nodes.
  • openrouter-vector-store: In-memory demo store with store, retrieve, and clear actions.

Breaking changes in this version

  • Removed per-node “Model” fields from all nodes. The shared openrouter-config node is now the only place to set the model.
  • Nodes validate at runtime and will error if the shared model is missing.

Environment variables

You can set the OpenRouter API key via Node-RED credentials UI on openrouter-config. If you prefer environment variables, wire that into the config UI using Node-RED’s built-in env usage patterns.

Development

  • All node sources are in src/. Each node has a .html editor file and a .js runtime file.
  • After making changes, run Node-RED in development and reload the editor.
  • Linting/formatting should follow repository settings.

Contributing

PRs welcome! Please include:

  • Clear description and rationale
  • Tests or flows showing the behavior
  • Avoid reintroducing per-node model configuration

License

MIT