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

@warpgogol/pipeline-ai

v0.1.6

Published

[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](LICENSE) [![npm](https://img.shields.io/npm/v/@warpgogol/pipeline-ai?logo=npm&logoColor=white)](https://www.npmjs.com/package/@warpgogol/pipeline-ai)

Readme

@warpgogol/pipeline-ai

License npm

AI provider wrappers for the pipeline framework — structured OpenAI helpers, Anthropic integration, and resilient JSON normalization.

Engineered at Warpgogol · Released as open source.


Features

  • Structured OpenAI helpers — createOpenAiJson(), createOpenAiText(), createOpenAiVisionText(), createOpenAiImageWebp()
  • Anthropic integration — createAnthropicText() with the same call/logging contract
  • Perplexity integration — createPerplexityText()
  • Resilient JSON normalization — extract and parse JSON from LLM output with normalizeAiJson()
  • Unified logging — every call persists prompts, responses, and usage metadata
  • Zod-validated output — structured outputs validated before returning
  • Multimodal attachments — pass images as AiAttachment objects (base64-encoded automatically)

Install

npm install @warpgogol/pipeline-core @warpgogol/pipeline-ai

# Install at least one AI provider (optional peer deps)
npm install openai
# or
npm install @anthropic-ai/sdk

Peer dependencies

| Package | Required for | Optional | | --- | --- | --- | | openai | createOpenAiJson, createOpenAiText, createOpenAiVisionText, createOpenAiImageWebp | Yes | | @anthropic-ai/sdk | createAnthropicText | Yes |

You only need to install the provider(s) you use.

Quick start

import { createOpenAiJson } from "@warpgogol/pipeline-ai/openai";
import { z } from "zod";

const schema = z.object({
  title: z.string(),
  summary: z.string(),
});

const result = await createOpenAiJson({
  client: openaiClient,
  model: "gpt-4.1",
  schema,
  systemPrompt: "You are a helpful assistant.",
  userPrompt: "Summarize this article: ...",
  logDir: "./output/AI/ai-1",
});

console.log(result.data); // { title: "...", summary: "..." }

Multimodal attachments

createOpenAiText and createAnthropicText accept an optional attachments field (AiAttachment[]). Each attachment carries raw image bytes (as Uint8Array) and a mimeType string. Images are injected as base64-encoded content parts automatically.

Exports

| Export | Description | | ------------------------------ | ---------------------------------------------- | | createOpenAiJson(opts) | Structured JSON via OpenAI with Zod validation | | createOpenAiText(opts) | Text generation via OpenAI | | createOpenAiVisionText(opts) | Vision + text via OpenAI | | createOpenAiImageWebp(opts) | Image generation (WebP) via OpenAI | | createAnthropicText(opts) | Text generation via Anthropic | | createPerplexityText(opts) | Text generation via Perplexity | | normalizeAiJson(raw) | Extract and parse JSON from LLM output | | AiAttachment | Type for image/file attachments | | AiPlugin | Type for AI plugin configuration | | OpenAiClientLike | Interface for OpenAI client compatibility |

Subpath exports

| Path | Description | | ------------------------------- | -------------------------- | | @warpgogol/pipeline-ai/openai | OpenAI helpers | | @warpgogol/pipeline-ai/json | JSON normalization helpers |

Changelog

CHANGELOG.md

License

Apache-2.0 — see LICENSE

Open Engineering

This package originated from production engineering work at Warpgogol, an engineering studio in Germany.

We publish reusable parts of our infrastructure when they can be useful beyond our own projects. It is published independently of any Warpgogol commercial service. Using this package does not create any dependency on Warpgogol.

Built for real systems. Shared openly.