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

@ugonfor/ai-npc-world-server

v0.1.1

Published

LLM proxy server for ai-npc-world (Google Gemini)

Readme

@ugonfor/ai-npc-world-server

LLM proxy server for ai-npc-world. Talks to Google Gemini, exposes a small HTTP API the game client uses for NPC dialogue, weather, and a shared world-NPC roster.

Zero npm dependencies — uses Node 18+ built-ins only.

Install & run

npm install -g @ugonfor/ai-npc-world-server

GOOGLE_API_KEY=your_key ai-npc-world-server

Or run from source:

git clone https://github.com/ugonfor/ai-npc-world.git
cd ai-npc-world/packages/server
GOOGLE_API_KEY=your_key npm start

Server listens on 127.0.0.1:8787 by default. Override with PORT / HOST.

Environment variables

| Variable | Default | Purpose | |---|---|---| | GOOGLE_API_KEY | (required) | Google AI Studio key for Gemini | | PORT | 8787 | Listen port | | HOST | 127.0.0.1 | Listen host (auto 0.0.0.0 on Cloud Run) | | MODEL_CHAIN | gemini-2.5-flash,gemini-3-flash-preview,gemini-2.5-flash-lite,gemma-4-31b-it | Fallback chain | | ALLOWED_ORIGINS | http://localhost:4000,... | CORS allowlist (comma-separated) | | RATE_LIMIT_WINDOW_MS | 60000 | Rate limit window per IP | | RATE_LIMIT_MAX | 90 | Requests per window | | MAX_BODY_BYTES | 1000000 | Max request body size | | PROXY_AUTH_TOKEN | (none) | Optional shared secret; if set, clients must send Authorization: Bearer <token> | | OPENWEATHER_API_KEY | (none) | Optional, enables /api/weather | | TURNSTILE_SECRET_KEY | (none) | Optional Cloudflare Turnstile verification | | SHARED_STATE_FILE | /tmp/playground-shared-state.json | World-NPC roster persistence | | AUDIT_LOG_BUCKET | (none) | Optional GCS bucket for prompt/response audit logs |

Endpoints

  • POST /api/npc-chat — non-streaming NPC reply
  • POST /api/npc-chat-stream — streaming NPC reply (SSE)
  • GET /api/world-npcs — fetch shared world-NPC roster
  • POST /api/world-npcs — update shared world-NPC roster
  • GET /api/weather — Seoul weather snapshot (when OPENWEATHER_API_KEY set)

Docker

docker build -t ai-npc-world-server .
docker run -e GOOGLE_API_KEY=your_key -p 8787:8787 ai-npc-world-server

Firebase rules

firebase-rules.json ships with reference rules for the multiplayer/memory features (host election, NPC sync, shared memory). Apply them in your Firebase Realtime Database project if you want multiplayer.

License

MIT