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

regolo-client

v1.0.2

Published

TypeScript/JavaScript SDK for the Regolo AI API — chat, completions, embeddings, reranking, image generation and audio transcription

Readme

@regolo/sdk

TypeScript/JavaScript SDK for the Regolo AI API.

Installation

npm install @regolo/sdk
# or
pnpm add @regolo/sdk

Quickstart

import { RegoloClient } from "@regolo/sdk";

const client = new RegoloClient({
  apiKey: "your-api-key",
  chatModel: "your-model",
});

// Single-turn chat
const [role, content] = await client.runChat("Hello, who are you?") as [string, string];
console.log(content);

// Streaming chat
const stream = await client.runChat("Tell me a story", { stream: true });
for await (const [, chunk] of stream as AsyncGenerator<[string, string]>) {
  process.stdout.write(chunk);
}

Configuration

You can configure global defaults via environment variables before calling tryLoadingFromEnv():

| Variable | Description | |---|---| | API_KEY | Default API key | | LLM | Default chat model | | IMAGE_GENERATION_MODEL | Default image generation model | | EMBEDDER_MODEL | Default embeddings model | | AUDIO_TRANSCRIPTION_MODEL | Default audio transcription model | | RERANKER_MODEL | Default reranker model |

import { tryLoadingFromEnv } from "@regolo/sdk";
tryLoadingFromEnv();

API Reference

new RegoloClient(options?)

Creates a new client instance.

| Option | Type | Description | |---|---|---| | apiKey | string \| null | API key | | chatModel | string \| null | Chat/completions model | | embedderModel | string \| null | Embeddings model | | imageGenerationModel | string \| null | Image generation model | | audioTranscriptionModel | string \| null | Audio transcription model | | rerankerModel | string \| null | Reranker model | | alternativeUrl | string \| null | Override the base API URL | | preExistentConversation | Conversation | Restore a previous conversation |

client.runChat(prompt?, options?)

Send a chat message and receive a response. Maintains conversation history automatically.

const result = await client.runChat("What is 2+2?");
// result: ["assistant", "4"]

// With options
const stream = await client.runChat("Explain gravity", {
  stream: true,
  maxTokens: 1024,
  temperature: 0.7,
});

client.completions(prompt, options?)

Text completions (non-chat).

const text = await client.completions("The capital of France is", { maxTokens: 10 });

RegoloClient.chatCompletions(messages, options?)

Static method for one-off chat completions without a client instance.

const result = await RegoloClient.chatCompletions(
  [{ role: "user", content: "Hello" }],
  { model: "your-model", apiKey: "your-key" },
);

client.embeddings(inputText, options?)

Generate text embeddings.

const embeddings = await client.embeddings("Hello world");
// or multiple inputs:
const embeddings = await client.embeddings(["text 1", "text 2"]);

client.rerank(query, documents, options?)

Rerank documents by relevance to a query.

const results = await client.rerank(
  "What is machine learning?",
  ["ML is...", "Cooking recipes...", "Deep learning is a subset of ML..."],
);

client.audioTranscription(file, options?)

Transcribe audio files.

const text = await client.audioTranscription("/path/to/audio.mp3");

client.createImage(prompt, options?)

Generate images from a text prompt.

const [imageBuffer] = await client.createImage("A sunset over the ocean") as Buffer[];

RegoloClient.getAvailableModels(apiKey, options?)

List available models.

const models = await RegoloClient.getAvailableModels("your-key");

License

MIT