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

nvidia-glm-proxy

v2.0.0

Published

Proxy for NVIDIA NIM API that fixes GLM-5.1 tool_call streaming bugs (numeric IDs, missing function.name, ID instability)

Downloads

335

Readme

nvidia-glm-proxy

A lightweight reverse proxy for the NVIDIA NIM API that fixes GLM-5.1 tool_call streaming bugs. Zero dependencies.

Problem

NVIDIA's GLM-5.1 model via NIM has several bugs when streaming tool calls:

  • Numeric id — tool call IDs are returned as numbers instead of strings (e.g. "id": 1 instead of "id": "call_abc123")
  • Missing id — tool call IDs are sometimes omitted entirely
  • Missing function.name — the function name inside tool calls is sometimes null or missing
  • ID instability — the same tool call index gets different IDs across SSE chunks, breaking accumulation

These bugs cause OpenAI-compatible clients (like opencode, Claude, etc.) to crash or misinterpret tool calls.

Solution

nvidia-glm-proxy sits between your client and integrate.api.nvidia.com, patching responses in real-time:

| Bug | Fix | |---|---| | Numeric id | Converts to call_<number> string format | | Missing id | Generates a stable call_<uuid> | | Missing function.name | Infers from tool definitions + user message + tool_choice | | Unstable IDs across chunks | Stabilizes IDs per index using a chunk map |

Install

npm (global)

npm install -g nvidia-glm-proxy

From source

git clone https://github.com/DiegoLopez0208/nvidia-glm-proxy.git
cd nvidia-glm-proxy

Configuration

Copy .env.example to .env and fill in your values:

cp .env.example .env

| Variable | Default | Description | |---|---|---| | NVIDIA_API_KEY | (empty) | Your NVIDIA NIM API key. If set, the proxy injects it as Authorization: Bearer when the client doesn't provide one | | NVIDIA_NIM_HOST | integrate.api.nvidia.com | Upstream NVIDIA NIM host | | NVIDIA_NIM_PORT | 443 | Upstream port | | PROXY_PORT | 9999 | Local port the proxy listens on | | UPSTREAM_TIMEOUT | 120000 | Upstream request timeout in ms | | BIND_ADDRESS | 127.0.0.1 | Address to bind to |

Usage

Start the proxy

node proxy.js

Or with the systemd user service:

bash install.sh

Update your client config

Point your OpenAI-compatible client at the proxy instead of NVIDIA directly:

{
  "provider": {
    "nvidia-proxy": {
      "npm": "@ai-sdk/openai-compatible",
      "options": {
        "baseURL": "http://127.0.0.1:9999/v1",
        "apiKey": "sk-proxy"
      },
      "models": {
        "z-ai/glm-5.1": { "name": "z-ai/glm-5.1" }
      }
    }
  }
}

The apiKey value doesn't matter if NVIDIA_API_KEY is set in .env — the proxy will inject the real key automatically.

Health check

curl http://127.0.0.1:9999/health

How function.name inference works

When GLM-5.1 omits function.name from a tool call, the proxy tries to infer it:

  1. tool_choice — if the request forces a specific function, use that
  2. User message match — if the user message contains a no-param tool name, use that
  3. Keyword scoring — match user message words against tool descriptions and name parts
  4. Single tool fallback — if only one tool is available, use it
  5. Parameter signature matching — match argument keys against tool parameter schemas
  6. Fallback"unknown" if nothing matches

License

MIT