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

@siliconvalleyglobal/agent-gateway

v0.1.0

Published

Self-hosted multi-provider LLM gateway with fallback, cost/latency routing, and zero third-party involvement in the request path

Readme

agent-gateway 🌐

Self-Hosted, Privacy-First LLM Provider Router

A Project by SILICON VALLEY GLOBAL PH INC

License npm Website TypeScript Vitest

agent-gateway is a self-hosted, embeddable router that gives you one unified API across OpenAI, Anthropic, Google Gemini, and more — with automatic fallback and cost/latency-based routing — without a third-party server ever sitting between you and the provider. Created and maintained by SILICON VALLEY GLOBAL PH INC.


⚠️ The Problem

Hosted routing services solve the "one API for many providers" problem well, but every request has to pass through their servers first. For teams with compliance requirements, sensitive codebases, or a simple policy of not routing traffic through a third party, that's a real blocker — not a minor inconvenience.

agent-gateway solves the same problem as a library that runs entirely on your own machine. Requests go straight from your code to the actual provider. Nothing is logged, proxied, or billed by a middleman — because there isn't one.


🧩 Key Architecture Pillars

  1. Provider Adapters (src/adapters/)

    • Normalize OpenAI, Anthropic, and Google Gemini's differing request/response formats into one common shape, with more providers addable without touching core logic.
  2. Routing Engine (src/routing/)

    • Manual priority chains, cost-based routing, and latency-based routing, with automatic failover to the next configured provider on error or rate-limit.
  3. Unified Streaming (src/streaming/)

    • One consistent async-iterator streaming interface regardless of which provider is actually serving the request underneath.
  4. Local-Only Guarantee (src/core/no-telemetry.ts)

    • Zero analytics, zero logging to any third party, zero gateway server — verified by tests asserting no network calls happen except directly to the selected provider.
  5. Suite Integration (src/integrations/)

    • Pulls provider keys from agent-config-sync, scans outgoing prompts through agent-leak-guard before they leave the machine, and exposes routing-decision hooks for agent-permit.

📊 Supported Providers

| Provider | Status | |---|---| | OpenAI | Supported | | Anthropic | Supported | | Google Gemini | Supported | | Others (Cohere, Mistral, local models) | Planned — contributions welcome |


💻 Quickstart

npm install @siliconvalleyglobal/agent-gateway

Basic usage:

import { AgentGateway } from "@siliconvalleyglobal/agent-gateway";

const gateway = new AgentGateway({
  strategy: "fallback",
  providers: ["anthropic", "openai", "gemini"],
});

const response = await gateway.send({
  prompt: "Summarize this changelog...",
});

Check provider status:

npx agent-gateway status

Test the routing chain without a real workload:

npx agent-gateway route-test

⚙️ Configuration

~/.agent-gateway/config.json:

{
  "strategy": "cost",
  "providers": ["anthropic", "openai", "gemini"],
  "fallbackChain": ["anthropic", "openai", "gemini"],
  "useAgentConfigSync": true
}

🔌 Suite Integration Example

import { AgentGateway } from "@siliconvalleyglobal/agent-gateway";
import { scan } from "@siliconvalleyglobal/agent-leak-guard";

const gateway = new AgentGateway({ strategy: "fallback" });

const findings = scan(prompt);
if (findings.length === 0) {
  await gateway.send({ prompt });
}

🗺️ Roadmap

  • [ ] Local/self-hosted model support (Ollama, vLLM)
  • [ ] Built-in cost tracking export compatible with agent-rate-limit-monitor
  • [ ] Response caching layer for duplicate requests

🤝 Contributing

See CONTRIBUTING.md for how to add a new provider adapter.

License

MIT