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

@samesake/providers

v6.0.2

Published

Ready-made model-provider adapters for samesake's BYO embed/generate/rerank/parse seams: Gemini, OpenAI, Voyage, Cohere. Zero SDK dependencies — plain fetch with retry/backoff and optional throttling.

Readme

@samesake/providers

Ready-made model-provider adapters for samesake's BYO seams. Generation, parsing, and reranking stay in this convenience package; Gemini and Voyage embedding factories are direct re-exports of the dual-form implementations in @samesake/embed.

import { createMatcher } from "@samesake/server";
import { geminiEmbedder, geminiGenerator, cohereReranker } from "@samesake/providers";

const matcher = createMatcher({
  databaseUrl: process.env.SAMESAKE_DATABASE_URL!,
  apiKey: process.env.SAMESAKE_API_KEY!,
  embed: geminiEmbedder(),        // EmbedFn — multimodal (text + image)
  generate: geminiGenerator(),    // GenerateFn — NLQ + enrichment
  rerank: cohereReranker(),       // RerankFn — optional second stage
});

Built-in adapters (zero dependencies, plain fetch)

| Provider | embed | generate | parse | rerank | key env var | |---|---|---|---|---|---| | Gemini | geminiEmbedder (multimodal, @samesake/embed) | geminiGenerator | geminiParser | — | GEMINI_API_KEY | | OpenAI | openaiEmbedder | openaiGenerator | openaiParser | — | OPENAI_API_KEY | | Voyage | voyageEmbedder (@samesake/embed) | — | — | voyageReranker | VOYAGE_API_KEY | | Cohere | cohereEmbedder | — | — | cohereReranker | COHERE_API_KEY |

The embedding aliases use the @samesake/embed factories and resolve API keys from the provider environment variables. Collection requests supply their model and dimension; the factories also accept their provider-specific defaults (dim and Gemini's taskType). The generation and reranking adapters accept the shared provider options:

geminiGenerator({
  apiKey: "...",        // default: the provider's env var
  model: "...",         // default model for generation
  baseUrl: "...",       // proxies / regional endpoints
  minIntervalMs: 120,   // space out calls during bulk indexing
  retries: 8,           // 429/5xx retries with exponential backoff (default 5)
});

Vercel AI SDK bridge (@samesake/providers/ai-sdk)

Already on the AI SDK? Wrap any of its model objects — the entire AI SDK provider ecosystem plugs into samesake without glue. ai is an optional peer dependency, only needed for this subpath.

import { google } from "@ai-sdk/google";
import { aiSdkEmbedder, aiSdkGenerator } from "@samesake/providers/ai-sdk";

createMatcher({
  embed: aiSdkEmbedder(google.textEmbedding("gemini-embedding-2"), {
    providerOptions: ({ dim, taskType }) => ({
      google: { outputDimensionality: dim, ...(taskType ? { taskType } : {}) },
    }),
  }),
  generate: aiSdkGenerator(google("gemini-2.5-flash-lite")),
});

Also available: aiSdkParser(model) and aiSdkReranker(model) (AI SDK v6 reranking models). Note the AI SDK's embed() is text-only — for image spaces (visual similarity) use the native multimodal geminiEmbedder or bring your own.