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

@elgap/ai-connect

v2.0.0

Published

A minimalist, no-fluff client for open-source LLMs.

Readme

@elgap/ai-connect

npm version License: Apache 2.0

A minimalist, "no-fluff" TypeScript client for interacting with open-source Large Language Models via the Ollama API.

Philosophy

The world of AI is complex enough. Interacting with your local models shouldn't be.@elgap/ai-connect is designed with one core principle: Substance First. We provide a simple, reliable, and type-safe way to send a prompt and get a response, without the heavy abstractions of larger frameworks.

Note on the ElGap Ecosystem

@elgap/ai-connect is the foundational "engine" package for the ElGap ecosystem. It is designed to be a simple, resilient, and provider-agnostic client. For more advanced, "out-of-the-box" agentic capabilities like constitution-based guardrails, chat history ... please see our companion package, @elgap/ai-composer;

A Note on Co-Creation

This package was co-created in a deep, multi-month symbiotic dialogue between a human WedDev artisan Ivan Pavkovic and AI (Google's Gemini). The process served as both a real-world case study in Human-AI partnership and as a practical journey for Ivan to learn TypeScript, npm package creation and to dive into the world of LLM's. The code you see is a direct result of this iterative, "sparring" process.

Features

  • Lightweight and zero-dependency (aside from ofetch and zod).
  • Simple, intuitive API (invoke method).
  • Built-in token count usage
  • Type-safe interfaces for requests and responses.
  • Designed for modern TypeScript/JavaScript projects.

Installation

npm install @elgap/ai-connect

Quick Start

import { OllamaProvider } from "@elgap/ai-connect";

async function main () {
    const llama3 = new OllamaProvider( {
        model: "llama3.1:latest", //Adjust value from model to match your local model
        baseUrl: "http://localhost:11434", //Optional. efault for Ollama, change if it's elsewhere
        temperature: 0.7 //Optional. Default to 0.7 but you can change it from 0.1-1)
    })
    const systemPrompt = "You are helpful and harmless AI assistant";
    const prompt: string = "Why the sky is blue?"
    const response = await llama3.invoke(prompt, systemPrompt);
    console.log("Response:", response.content);
    console.log("Token usage:", response.usage);
}
main().catch(console.error);

Examples

You can find a collection of ready-to-run examples in the /examples directory. We encourage you to clone the repository and experiment.

git clone [email protected]:ElGap/ai-connect.git
npm install

npm run example:ollama
npm run example:ollamaStreaming
npm run example:ollamaStreamingInteractive

API Reference

new OllamaProvider(options)
  • options.model: string - The name of the model to use (e.g., 'llama3:8b').
  • options.baseUrl?: string - The base URL of your Ollama instance. Defaults to http://localhost:11434.
  • options.temperature? : Number - Temperature (default 0.7)
provider.invoke(prompt, systemPrompt, tokenUsage)
  • prompt: string - The text prompt you want to send to the model.
  • systemPrompt: string - System prompt
  • tokenUsage: boolean - Return token usage if set to true
  • Returns: Promise - An object containing the response text and metadata.

Licence

This project is licensed under the Apache 2.0 License.