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

@tiens.nguyen/gonext-ollama-cli

v1.0.0

Published

Ships filtered Ollama journald logs from the Ollama box to the GoNext API (Mongo-backed, TTL-bounded) so the web app can show live server activity.

Downloads

83

Readme

gonext-ollama-cli

Runs on the Ollama box (Ubuntu). Tails journalctl -u ollama -f, keeps only the useful lines (requests, prompt-eval timings, model loads, errors), and ships them in batches to the GoNext API over HTTPS. The API stores them in MongoDB with a 24h TTL, and the web app can read them back (GET /api/ollama-logs) to show live server activity while the agent is thinking.

The box never connects to MongoDB directly — auth is the same worker API key (X-Worker-Key) the local worker uses, so no new credentials.

Ubuntu ollama box                     GoNext API                 web app
journalctl -u ollama -f ──filter──►  POST /api/worker/ollama-logs ──► Mongo (ollama_logs, TTL 24h)
                                     GET  /api/ollama-logs  ◄──────── Thinking panel poll

Setup

# 1. Journal access without sudo (once, then re-login)
sudo usermod -aG adm $USER

# 2. Install (Node >= 18)
npm install -g @tiens.nguyen/gonext-ollama-cli

# 3. Configure — worker key from web app: Settings → Worker → reveal key
gonext-ollama-cli set <workerKey> --api-base https://your-gonext-api

# 4. Verify end-to-end (auth + insert)
gonext-ollama-cli test

# 5. Run in the foreground to sanity-check, then install the service
gonext-ollama-cli run

Run as a service

See the comments in gonext-ollama-cli.service (user-level systemd unit with enable-linger so it survives logout).

Tuning

Env vars (or ~/.gonext/ollama-cli.env):

| Var | Default | Meaning | | --- | --- | --- | | OLLAMA_LOG_UNIT | ollama | systemd unit to tail | | OLLAMA_LOG_FILTER | requests/timings/loads/errors | regex of lines worth shipping | | OLLAMA_LOG_HOST | os.hostname() | host label shown in the web app |

Server side: OLLAMA_LOG_TTL_SECONDS on the API (default 86400) controls how long lines are kept. Note Mongo TTL values are baked into the index — changing it later requires dropping the insertedAt index on ollama_logs first.

Behavior notes

  • Batches flush every 2s or at 50 lines, whichever comes first.
  • If the API is unreachable, lines buffer in memory (drop-oldest beyond 2000) and retry — the daemon never crashes on network errors.
  • journalctl exiting (rotation, permissions) triggers an automatic re-tail with backoff; it does not kill the daemon.