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

remoteai

v1.0.1

Published

One SDK. Every AI Provider. Unified wrapper for OpenAI, Anthropic, Google Gemini, Groq, Mistral & more — with smart routing, cost tracking, and fallback chains.

Downloads

40

Readme

⚡ RemoteAI SDK

One SDK. Every AI Provider.

A unified wrapper that connects OpenAI, Anthropic Claude, Google Gemini, Groq, Mistral & more — with smart auto-routing, cost tracking, and fallback chains. Built by PulseDataEngineer.


🚀 Install

npm install remoteai

🔑 Get Your API Key

Get a free API key (100 req/mo) at → https://pulsedataengineer.com/RemoteAI


📦 Quick Start

import RemoteAI from "remoteai";

const ai = new RemoteAI({
  apiKey: "rai_your_key_here",
});

// Simple prompt
const res = await ai.ask("Explain gradient descent in 2 sentences.");
console.log(res.text);
console.log(res.meta);
// → { provider: "groq", model: "llama3-70b", cost: "$0.0002", latency: "118ms" }

🔀 Routing Strategies

// Auto (default) — RemoteAI picks the best provider
const auto = await ai.ask("Your prompt", { strategy: "auto" });

// Cheapest available provider
const cheap = await ai.ask("Your prompt", { strategy: "cheapest" });

// Fastest (lowest latency)
const fast = await ai.ask("Your prompt", { strategy: "fastest" });

// Best quality
const best = await ai.ask("Complex analysis...", { strategy: "quality" });

💬 Multi-turn Chat

const res = await ai.chat([
  { role: "system",    content: "You are a concise data analyst." },
  { role: "user",      content: "What are the top 3 KPIs for SaaS?" },
]);

console.log(res.text);

📊 Cost & Session Tracking

await ai.ask("First query...");
await ai.ask("Second query...");
await ai.ask("Third query...");

console.log(ai.sessionCost());    // "$0.0034"
console.log(ai.sessionTokens());  // 1420

console.log(ai.breakdown());
// [
//   { provider: "groq",    calls: 2, tokens: 820, cost: "$0.0007" },
//   { provider: "gemini",  calls: 1, tokens: 600, cost: "$0.0027" }
// ]

ai.resetSession(); // Start fresh tracking

📈 Check Usage & Limits

const usage = await ai.usage();

console.log(usage.plan);               // "starter"
console.log(usage.totalRequests);      // 247
console.log(usage.monthlyLimit);       // 1000
console.log(usage.remainingRequests);  // 753

💰 Pricing

| Plan | Price | Requests/mo | Providers | |---------|---------|-------------|--------------------| | Free | $0 | 100 | Groq | | Starter | $9/mo | 1,000 | Groq + Gemini | | Pro | $29/mo | Unlimited | All 8+ providers |


🌐 Supported Providers

  • ⚡ Groq (Llama) — fastest, free tier
  • 🔵 Google Gemini Flash / Pro
  • 🟣 Anthropic Claude (Haiku, Sonnet, Opus)
  • 🟢 OpenAI GPT-4o / GPT-4o-mini
  • 🟠 Mistral AI
  • 🔴 Together AI
  • 🔷 Azure OpenAI
  • 🟡 Cohere

🌍 Use From Any Language (REST API)

The npm package is a JavaScript convenience wrapper. Any language can call RemoteAI directly via the REST API.

🐍 Python / Jupyter Notebook

import requests

response = requests.post(
    "https://pulsedataengineer.com/functions/remoteAIGateway",
    json={
        "action":       "generate",
        "remoteai_key": "rai_your_key_here",
        "prompt":       "Explain gradient descent simply.",
        "strategy":     "auto",   # auto | cheapest | fastest | quality
    }
)

data = response.json()
print(data["text"])   # AI response
print(data["meta"])   # provider, model, cost, latency, tokens saved

🌐 cURL / REST

curl -X POST https://pulsedataengineer.com/functions/remoteAIGateway \
  -H "Content-Type: application/json" \
  -d '{
    "action":       "generate",
    "remoteai_key": "rai_your_key_here",
    "prompt":       "What is RAG in AI?",
    "strategy":     "cheapest"
  }'

🟦 JavaScript (fetch — no npm needed)

const response = await fetch("https://pulsedataengineer.com/functions/remoteAIGateway", {
  method: "POST",
  headers: { "Content-Type": "application/json" },
  body: JSON.stringify({
    action:       "generate",
    remoteai_key: "rai_your_key_here",
    prompt:       "Summarize this article...",
    strategy:     "fastest",
  })
});

const data = await response.json();
console.log(data.text);
console.log(data.meta);

♦️ R Language

library(httr)
library(jsonlite)

response <- POST(
  "https://pulsedataengineer.com/functions/remoteAIGateway",
  content_type_json(),
  body = toJSON(list(
    action       = "generate",
    remoteai_key = "rai_your_key_here",
    prompt       = "Explain linear regression.",
    strategy     = "auto"
  ), auto_unbox = TRUE)
)

data <- content(response, as = "parsed")
cat(data$text)

📡 API Response Format

Every request returns:

{
  "text": "The AI response...",
  "meta": {
    "provider":        "groq",
    "model":           "llama3-70b",
    "latencyMs":       118,
    "inputTokens":     42,
    "outputTokens":    95,
    "estimatedCostUsd": 0.0002
  }
}

📋 Available Actions

| Action | Description | |--------|-------------| | generate | Single prompt → AI response | | register | Get a free API key | | usage | Check your usage & limits |


📄 License

MIT © PulseDataEngineer


Built with ❤️ by the PulseDataEngineer · TechPulse team · [email protected]