Show HN:具備能力導向路由的記憶體內 AI 閘道

Show HN:具備能力導向路由的記憶體內 AI 閘道

Hacker News·

一個針對 Node.js 的開源 AI 閘道套件被提出,其特色為供應商無關的設計、用於應對不斷演進的 LLM 模型群的能力導向路由、記憶體內速率限制以及可觀察性掛鉤。

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

To see all available qualifiers, see our documentation.

Provider-agnostic AI gateway with capability-based routing, in-memory rate limiting, and observability hooks.

License

Uh oh!

There was an error while loading. Please reload this page.

ukrocks007/ai-gateway-kit

Folders and files

Latest commit

History

Repository files navigation

ai-gateway-kit

A boring, provider-agnostic AI Gateway for Node.js.

This library exists to solve the “production gateway” problems around LLM usage:

Why capability-based routing?

Model names change, providers change, and quotas fluctuate.
A gateway that routes by capability lets your agents stay stable while the model fleet evolves.

Example capabilities:

Why in-memory state?

This kit intentionally uses in-memory rate limit state.

Trade-off: multi-instance deployments do not share quotas. Each instance enforces limits based on its own in-memory view.

If you need cross-instance coordination, you can replace the in-memory RateLimitManager with your own implementation.

This is not a chat wrapper

This library is infrastructure:

It does not provide prompt templates, product policies, UI, or agent logic.

Install

Quick start

📚 See more examples →

Core Features

Capability-based routing

Route requests by capability, not model names. See examples/02-capability-routing.ts.

Automatic fallback

Graceful degradation across models. See examples/03-fallback-handling.ts.

Rate limiting

In-memory rate limits (rpm, rpd, tpm, concurrency). See examples/03-fallback-handling.ts.

Multiple providers

GitHub Models, Gemini, or custom providers. See examples/04-multi-provider.ts.

Advanced features

Providers

Observability hooks

You can subscribe to lifecycle events without taking a dependency on any logging stack:

Example: examples/09-observability-hooks.ts

Examples

The examples directory contains comprehensive examples for all features:

View all examples →

License

MIT

About

Provider-agnostic AI gateway with capability-based routing, in-memory rate limiting, and observability hooks.

Topics

Resources

License

Uh oh!

There was an error while loading. Please reload this page.

Stars

Watchers

Forks

Releases

Packages

  0

Languages

Footer

Footer navigation

Hacker News

相關文章

  1. Show HN:ModelRiver – 適用於即時 AI 串流的小型 API

    3 個月前

  2. Show HN:Gambit,一個用於構建可靠AI代理的開源代理框架

    3 個月前

  3. HN 展示:具備身份、記憶、主動性的認知 AI 架構原型

    5 個月前

  4. Show HN:Pilot – AI 編碼的共享記憶體與基於證據的提交

    3 個月前

  5. Show HN:Kite – 輕量級、生產就緒的代理式 AI 框架,整合 Ollama

    3 個月前