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

@fezchat/router

v0.0.1

Published

A lean Jev gateway for agent routing and structured judgments.

Readme

Running the Fez Jev gateway

Live endpoint: https://137-184-135-188.sslip.io/v1 on the existing DigitalOcean fez-router host. The gateway calls TypeSafe's hosted Jev model. No local model, llama.cpp, or Qwen is required.

The gateway deploys as one bundled JavaScript file with no runtime npm dependencies. Caddy terminates TLS; Node listens on loopback port 8081.

client → HTTPS → Caddy → gateway :8081 → TypeSafe/Jev

Run from npm

Requires Node.js 20 or newer. This package runs the server; clients call its HTTPS endpoint and do not need to install it. There are zero runtime dependencies and no model downloads.

Set TYPESAFE_API_KEY and ROUTER_API_KEY in the server environment, then:

npx @fezchat/[email protected]

The command is fez-router after a global install. It listens on 127.0.0.1:8081 by default; put a TLS reverse proxy in front for remote clients. /health checks that the gateway is running. Set ROUTER_API_KEY to require client authentication; without it the gateway accepts unkeyed requests. Never put the TypeSafe key in client configuration.

API

  • GET /health: service/configuration status, not a live TypeSafe probe.
  • GET /v1/models: the stable fez-router model alias.
  • POST /v1/chat/completions: agent selection using the existing OpenAI tool-call response shape. Accepts one user message, an optional standard Fez router system message, and agent tools with no arguments or a string task argument. The task text is preserved verbatim.
  • POST /v1/judge: structured { state, questions } passed to Jev. Supports noul, choice, and score, with 1–32 questions per call.

Routing and judgment use Jev exclusively. Unsupported chat formats and streaming return 400. Provider errors or invalid responses return 502; timeouts return 504. A valid no-fit choice is returned unchanged.

Successful routing returns X-Fez-Router-Backend: typesafe and X-Fez-Router-Confidence. Successful judgment returns X-Fez-Judge-Model. Logs contain decision metadata, latency, and token counts, never keys or message content.

Credentials and limits

Keep /etc/fez-router.env root-owned with mode 0600:

  • ROUTER_API_KEY: authenticates clients; required by the deployment script.
  • TYPESAFE_API_KEY: authenticates the gateway to TypeSafe; required at startup.

Clients receive the gateway URL and gateway credential. The TypeSafe key stays on the server. The existing gateway credential is preserved when deploying.

Optional environment settings: TYPESAFE_MODEL (default jev-1.13.0), TYPESAFE_TIMEOUT_MS (routing, 2000), JUDGE_TIMEOUT_MS (5000), RATE_PER_MIN (20 per IP), RATE_BURST (2 concurrent per IP), and MAX_BODY_BYTES (65536). Both API routes share authentication and limits.

Provision and deploy

Provisioning installs Node, Caddy, and system security prerequisites:

ssh root@<ip> 'HOSTNAME_FOR_TLS=<host> bash -s' < deploy/router/provision-router.sh

Configure the two credentials on the server, then deploy:

deploy/router/deploy-router.sh root@<ip>

Deployment bundles the shared TypeSafe client, checks credentials without printing them, backs up the current gateway and unit, restarts the gateway, and verifies authenticated routing and judgment through Jev. Failed checks restore the previous gateway and unit.

After successful checks, deployment stops and disables any existing fez-router.service local model. Model files and binaries remain on disk for rollback; new provisioning never downloads them.

Operations and rollback

systemctl status fez-router-gateway
journalctl -u fez-router-gateway -f
curl https://137-184-135-188.sslip.io/health

To restore the preceding deployment on the server:

cp /opt/fez-router/gateway.mjs.prev /opt/fez-router/gateway.mjs
cp /etc/systemd/system/fez-router-gateway.service.prev /etc/systemd/system/fez-router-gateway.service
systemctl daemon-reload
systemctl restart fez-router-gateway

If restoring a version that used Qwen, its retained service can be re-enabled with systemctl enable --now fez-router.service.