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

@hugpy/ui

v0.1.0

Published

Embeddable React UI for hugpy — configurable panels (chat, models, workers, API keys, Discord) and a drop-in <HugpyConsole/>.

Readme

@hugpy/ui

Embeddable React UI for hugpy — the panels that make up the hugpy console (chat, model table, GPU workers, HF search, API keys, Discord bindings), plus a single drop-in <HugpyConsole/>.

This package is layered:

  • runtime config — point the UI at any hugpy backend
  • individual panels — compose your own console
  • <HugpyConsole/> — the whole console in one component

Install

npm install @hugpy/ui
# peers (most React apps already have these):
npm install react react-dom react-router-dom

Import the stylesheet once, anywhere in your app:

import '@hugpy/ui/style.css'

The stylesheet carries the design tokens (CSS custom properties on :root) and every panel's styles.

Quick start — the whole console

import { HugpyConsole } from '@hugpy/ui'
import '@hugpy/ui/style.css'

export default function App() {
  return <HugpyConsole baseUrl="https://api.hugpy.ai" />
}

<HugpyConsole/> is router-free — no <BrowserRouter> required.

Quick start — individual panels

Wrap the part of your tree that uses hugpy panels in a <HugpyProvider> (it sets the backend address the panels talk to), then drop panels in:

import { HugpyProvider, ChatPanel, ModelTable } from '@hugpy/ui'
import '@hugpy/ui/style.css'

<HugpyProvider baseUrl="https://api.hugpy.ai">
  <ModelTable models={models} /* … */ />
  <ChatPanel /* … */ />
</HugpyProvider>

Backend wiring

Every API call resolves through the runtime config. The default baseUrl is empty, meaning same-origin / relative paths — that's how the bundled console works behind its proxy, unchanged.

configureHugpy({
  baseUrl: 'https://api.hugpy.ai', // '' = same origin (default)
  headers: () => ({ Authorization: `Bearer ${getToken()}` }), // optional, per-request
  credentials: 'include',          // optional, cookie auth across origins
  fetch: myFetch,                  // optional, custom fetch
})

<HugpyProvider> accepts the same options as props and applies them for its subtree. You can also call configureHugpy(...) once at startup instead.

Resolvers (exported for advanced use)

  • resolveApiUrl(path) — relative /api/... → absolute against baseUrl
  • resolveApiOrigin() — the configured origin (falls back to window.location.origin)
  • hugpyFetch(path, init)fetch with URL resolution + configured headers
  • fetchJson(path, init)hugpyFetch + JSON parsing with real error messages

Exports

| Export | What | |---|---| | HugpyConsole | full console, one component | | HugpyProvider, useHugpyConfig | backend config context | | configureHugpy, getHugpyConfig, resetHugpyConfig | imperative config | | resolveApiUrl, resolveApiOrigin, hugpyFetch, fetchJson, uploadFile | request helpers | | ChatPanel, ModelTable, WorkersPanel, HFSearch, PeersBar, ApiAccess, DiscordPanel, PhoneBrickPanel, Landing | panels | | AuthProvider, useAuth | optional auth context |

The login-form components (Login/Logout/Register/ChangePassword) are not yet exported — they have internal imports that need rewiring before they're package-ready. AuthProvider/useAuth are exported and work.

Building the package (maintainers)

npm run build:lib    # → dist-lib/ (ESM + CJS + .d.ts + style.css)

react, react-dom, and react-router-dom are externalized (peer dependencies). The console app itself still builds with npm run build (webpack → dist/); the library build is additive and independent.