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

@plurnk/plurnk-providers-ollama

v0.9.0

Published

Ollama provider for plurnk-service. Routes ollama/{model[/registry]} aliases through Ollama's OpenAI-compatible chat-completions endpoint, with dynamic context-size resolution from /api/show.

Downloads

3,835

Readme

@plurnk/plurnk-providers-ollama

Ollama provider for plurnk-service. Routes ollama/{model[/registry]} aliases through Ollama's OpenAI-compatible chat-completions endpoint.

install

npm install @plurnk/plurnk-providers-ollama

Requires Node ≥ 25 (native TypeScript).

use

plurnk-service constructs the provider via the static fromEnv factory (SPEC §3). Direct construction is also supported.

import Ollama from "@plurnk/plurnk-providers-ollama";

const provider = await Ollama.fromEnv(process.env, "qwenzel:latest");

const result = await provider.generate({
    messages: [
        { role: "system", content: "You are a plurnk agent." },
        { role: "user",   content: "What is the capital of France?" },
    ],
});

env

No fallback defaults — required vars throw at fromEnv if missing or unparseable. Defaults belong in plurnk-service's .env.example cascade, not in library code.

| Variable | Required | Notes | |---|---|---| | OLLAMA_BASE_URL | yes | Ollama server URL (e.g. http://localhost:11434). The official OLLAMA_HOST (a bare host:port) is also accepted; OLLAMA_BASE_URL wins | | PLURNK_PROVIDERS_REASONING_BUDGET | yes | Universal reasoning budget (SPEC §4); 0 disables, > 0 toggles think: true on the request body | | PLURNK_FETCH_TIMEOUT | yes | Universal fetch timeout in ms (SPEC §4) | | PLURNK_PROVIDER_RETRY_ATTEMPTS | yes | Transient-failure retry budget (SPEC §4): 0 disables; N retries on 429/5xx/timeout/network with exponential backoff, honoring Retry-After. |

context size

Dynamic, resolved at fromEnv time via POST /api/show. The sibling iterates model_info for any key matching *.context_length (Ollama keys it per-family: qwen35.context_length, llama.context_length, etc.). Throws if no such key is present.

tokenization & pricing

  • countTokens: family-dispatched. Llama-family models (llama / llama2 / llama3 / mistral / mixtral, detected via /api/show details.family) tokenize through llama-tokenizer-js — sync, pure JS, drop-in. Everything else (qwen, gemma, phi, deepseek, etc.) falls back to the chars/4 heuristic until per-family tokenizers land in pass-3. The dispatch decision is made once at fromEnv time and frozen on the instance.
  • costFor: returns 0. Local Ollama models are free to operate; pico-dollar cost rollups always sum to zero.

license

MIT.