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

@cloudspe/livepeer-openai-gateway-core

v4.0.1

Published

OSS engine: registry-driven node selection + payment-daemon orchestration + dispatchers + Fastify adapter for an OpenAI-compatible bridge over Livepeer WorkerNodes.

Readme

@cloudspe/livepeer-openai-gateway-core

OpenAI-compatible request engine fronting Livepeer worker pools. Adapter-driven: bring your own billing, auth, rate-limit, logging, and admin auth. Ships an optional Fastify route adapter and a read-only operator dashboard.

┌─────────────────────────┐    ┌──────────────────────────────────────┐    ┌──────────────┐
│ OpenAI client (curl /   │ →  │  livepeer-openai-gateway-core (this engine) │ →  │ WorkerNodes  │
│ openai-sdk / langchain) │    │  ─ auth → rate-limit → reserve →     │    │ (paid via    │
└─────────────────────────┘    │    select node → call → commit       │    │  payment-    │
                               │  ─ Fastify routes wire in            │    │  daemon)     │
                               │  ─ adapters: Wallet, AuthResolver,   │    └──────────────┘
                               │    RateLimiter, Logger,              │
                               │    AdminAuthResolver                 │
                               └──────────────────────────────────────┘

Quickstart

The fastest path to a running gateway is the bundled minimal-shell example. It uses InMemoryWallet + a no-op AuthResolver so there's no DB or identity provider to wire up.

git clone https://github.com/Cloud-SPE/livepeer-openai-gateway-core.git
cd livepeer-openai-gateway-core
npm install
cd examples/minimal-shell
cp service-registry-config.example.yaml service-registry-config.yaml
$EDITOR service-registry-config.yaml          # add your worker nodes
docker compose up
# In another shell:
curl -sS http://localhost:8080/v1/chat/completions \
  -H 'authorization: Bearer demo' \
  -H 'content-type: application/json' \
  -d '{"model":"llama-3.3-70b","messages":[{"role":"user","content":"hi"}]}'

Full walkthrough in examples/minimal-shell/README.md.

Adapters (you supply these)

The engine commits to five operator-overridable adapters. Pick the ones that match your deployment; all five have working defaults shipped with the engine.

| Adapter | Purpose | Default impl | |---------|---------|--------------| | Wallet | Billing/quota authority. Reserve before dispatch, commit on success, refund on failure. | InMemoryWallet (testing only) | | AuthResolver | HTTP Authorization header → generic Caller. | none — wire your own | | RateLimiter | Per-caller request gating (sliding window + concurrency). | Redis sliding-window | | Logger | Structured log sink. | createConsoleLogger | | AdminAuthResolver | Admin-token / basic-auth backing for the optional operator dashboard. | createBasicAdminAuthResolver |

Long-form: docs/adapters.md. Three runnable Wallet stubs (postpaid B2B / prepaid USD / free-quota tokens) live in examples/wallets/.

Ecosystem integration

The engine requires two sidecar daemons to run:

The engine does not support a static-YAML node-pool fallback — running without the registry-daemon is unsupported. Both daemons are MIT-licensed.

The minimal-shell example's compose.yaml brings up both daemons alongside the gateway process.

livepeer-modules-project/protocol-daemon is orthogonal — orchestrator-side concern, not needed by gateway operators unless they also run an orchestrator.

Cross-ecosystem metric naming + port allocation conventions live at livepeer-modules-project/livepeer-modules-conventions.

Reference shell implementation

Cloud-SPE/livepeer-openai-gateway is a production-ready shell that wires @cloudspe/livepeer-openai-gateway-core with prepaid USD billing (Postgres + Stripe top-ups), API-key auth, Redis-backed rate limiting, and admin + customer-portal SPAs. Read it as a worked example of how the adapter contracts compose under load.

Versioning

Versioning: this package now ships on the shared suite semver line. Use standard SemVer expectations for 4.x releases and pin/update according to your shell's compatibility policy.

Documentation map

  • docs/architecture.md — engine internals: layer stack, dispatcher pipeline, payment-daemon integration.
  • docs/adapters.md — long-form adapter guide with patterns for each of the five operator-overridable adapters.
  • docs/design-docs/ — focused design notes (node lifecycle, payer integration, pricing model, streaming semantics, token audit, retry policy, metrics, operator dashboard).
  • AGENTS.md — agent-first contributor guide.
  • DESIGN.md — what the engine is + isn't.
  • CONTRIBUTING.md — dev setup, test rules, commit + PR conventions, the adapter-contract change ladder.
  • SECURITY.md — vulnerability reporting flow.
  • CODE_OF_CONDUCT.md — Contributor Covenant 2.1.
  • GOVERNANCE.md — maintainers + decision rules.

License

MIT — Cloud-SPE contributors.