← 开源
bricks-cloud

BricksLLM

🔒 Enterprise-grade API gateway that helps you monitor and impose cost or rate limits per API key. Get fine-grained access control and monitoring per user, application, or environment. Supports OpenAI, Azure OpenAI, Anthropic, vLLM, and open-source LLMs.

InfrastructureGatewayGo
在 GitHub 打开
增长势头
+024 小时新增 Star0.0%
1.23k
Star
97
Fork
+0
本周
13
贡献者
创建于 2023-07-18 · 更新于 2026-10-13 · 今日第 11049 名
主要开发者
spikelu2016donfourgali-leilei

bricks-cloud/BricksLLM 排名第 11,049,有 1,230 个星标。

同类别比较

bricks-cloud/BricksLLM 排名第 11,049,此处有 8 个同类条目;NVIDIA/kvpress 排名第 11,046。

同类别比较
名称排名指标
objectbox/objectbox-dart11,028
语言:
Dart
星标数:
1,236
分叉数:
163
简介:
Flutter database for super-fast Dart object persistence
Scale3-Labs/langtrace11,036
语言:
TypeScript
星标数:
1,234
分叉数:
129
简介:
Langtrace 🔍 is an open-source, Open Telemetry based end-to-end observability tool for LLM applications, providing real-time tracing, evaluations and metrics for popular LLMs, LLM frameworks, vectorDBs and more.. Integrate using Typescript, Python. 🚀💻📊
zkonduit/ezkl11,044
语言:
Rust
星标数:
1,231
分叉数:
212
简介:
ezkl is an engine for doing inference for deep learning models and other computational graphs in a zk-snark (ZKML). Use it from Python, Javascript, or the command line.
NVIDIA/kvpress11,046
语言:
Python
星标数:
1,230
分叉数:
187
简介:
LLM KV cache compression made easy
Tencent/FeatherCNN11,053
语言:
C++
星标数:
1,229
分叉数:
274
简介:
FeatherCNN is a high performance inference engine for convolutional neural networks.
microsoft/MInference11,055
语言:
Python
星标数:
1,229
分叉数:
83
简介:
[NeurIPS'24 Spotlight, ICLR'25, ICML'25] To speed up Long-context LLMs' inference, approximate and dynamic sparse calculate the attention, which reduces inference latency by up to 10x for pre-filling on an A100 while maintaining accuracy.
run-house/kubetorch11,062
语言:
Python
星标数:
1,228
分叉数:
61
简介:
Distribute and run AI workloads on Kubernetes magically in Python, like PyTorch for ML infra.
basetenlabs/truss11,101
语言:
Python
星标数:
1,219
分叉数:
133
简介:
The simplest way to serve AI/ML models in production
关键参数与规格
关键参数与规格
参数值
语言Go
类别Infrastructure
子类别Gateway
星标数1,230
分叉数97
贡献者13
创建日期2023-07-18
更新日期2026-10-13
1 天星标数0
7 天星标数0
排名11,049
上次排名11,002
排名变化-47
7 天星标排名12,865
上次 7 天星标排名12,883
7 天星标排名变化18
总星标排名9,500
上次总星标排名9,492
总星标排名变化-8
README 摘录

**BricksLLM: AI Gateway For Putting LLMs In Production** [! TIP] A managed version of BricksLLM is also available! It is production ready, and comes with a dashboard to make interacting with BricksLLM easier. **BricksLLM** is a cloud native AI gateway written in Go. Currently, it provides native support for OpenAI, Anthropic, Azure OpenAI and vLLM. BricksLLM aims to provide enterprise level infrastructure that can power any LLM production use cases. Here are some use cases for BricksLLM: Set LLM usage limits

for users on different pricing tiers Track LLM usage on a per user and per organization basis Block or redact requests containing PIIs Improve LLM reliability with failovers, retries and caching Distribute API keys with rate limits and cost limits for internal development/production use cases Distribute API keys with rate limits and cost limits for students Features [x] PII detection and masking [x] Rate limit [x] Cost control [x] Cost analytics [x] Request analytics [x] Caching [x] Request Retries

[x] Failover [x] Model access control [x] Endpoint access control [x] Native support for all OpenAI endpoints [x] Native support for Anthropic [x] Native support for Azure OpenAI [x] Native support for vLLM [x] Native support for Deepinfra [x] Support for custom deployments [x] Integration with custom models [x] Datadog integration [x] Logging with privacy control Getting Started The easiest way to get started with BricksLLM is through BricksLLM-Docker. Step 1 - Clone BricksLLM-Docker repository Step 2 - Change to

BricksLLM-Docker directory Step 3 - Deploy BricksLLM locally with Postgresql and Redis You can run this in detach mode use the -d flag: Step 4 - Create a provider setting Copy the from the response. Step 5 - Create a Bricks API key Use from the previous step as to create a key with a rate limit of 2 req/min and a spend limit of 25 cents. Then, just redirect your requests to us and use OpenAI as you would normally

. For example: Or if you're using an SDK, you could change its to point to us. Separated by , | | | | optional | Name for Postgresql DB. | | | required | Postgresql DB username | | | required | Postgresql DB password | | | optional | Postgresql SSL mode| | | | optional | The port that Postgresql DB runs on| | | | optional | Timeout for Postgresql read operations | | | | optional | Timeout for Postgresql write operations | | | | required | Host for Redis. Separated by , | | | | optional | Redis Password | | | optional | The port that Redis DB runs on | | | | optional | Timeout for Redis read operations | | | | optional | Timeout

for Redis write operations | | | | optional | The interval BricksLLM API gateway polls Postgresql DB for latest key configurations | | | | optional | "datadog" or Host:Port(127. | | | optional | Timeout for proxy HTTP requests. | | | | optional | Number of event message consumers that help handle counting tokens and inserting event into db. | | | | optional | It is for PII detection feature. | | | | optional | It is for using PII detection feature. | | | | optional | Timeout for amazon requests. | | | | optional | Timeout for amazon connection. | | | | optional | Simple password for the admin server. | Admin Server Swagger

Doc Proxy Server Swagger Doc

常见问题

记录了多少星标和分叉?

bricks-cloud/BricksLLM 有 1,230 个星标和 97 个分叉。

仓库排名是多少?

bricks-cloud/BricksLLM 排名第 11,049。

记录的语言和类别是什么?

bricks-cloud/BricksLLM 有 1,230 个星标,语言为 Go,类别为 Infrastructure。

哪个仓库排名最接近?

bricks-cloud/BricksLLM 与 NVIDIA/kvpress 比较,后者排名第 11,046,有 1,230 个星标。

README

BricksLLM: AI Gateway For Putting LLMs In Production

[!TIP] A managed version of BricksLLM is also available! It is production ready, and comes with a dashboard to make interacting with BricksLLM easier. Try us out for free today!

BricksLLM is a cloud native AI gateway written in Go. Currently, it provides native support for OpenAI, Anthropic, Azure OpenAI and vLLM. BricksLLM aims to provide enterprise level infrastructure that can power any LLM production use cases. Here are some use cases for BricksLLM:

  • Set LLM usage limits for users on different pricing tiers
  • Track LLM usage on a per user and per organization basis
  • Block or redact requests containing PIIs
  • Improve LLM reliability with failovers, retries and caching
  • Distribute API keys with rate limits and cost limits for internal development/production use cases
  • Distribute API keys with rate limits and cost limits for students

Features

Getting Started

The easiest way to get started with BricksLLM is through BricksLLM-Docker.

Step 1 - Clone BricksLLM-Docker repository

git clone https://github.com/bricks-cloud/BricksLLM-Docker

Step 2 - Change to BricksLLM-Docker directory

cd BricksLLM-Docker

Step 3 - Deploy BricksLLM locally with Postgresql and Redis

docker compose up

You can run this in detach mode use the -d flag: docker compose up -d

Step 4 - Create a provider setting

curl -X PUT http://localhost:8001/api/provider-settings \
   -H "Content-Type: application/json" \
   -d '{
          "provider":"openai",
          "setting": {
             "apikey": "YOUR_OPENAI_KEY"
          }
      }'   

Copy the id from the response.

Step 5 - Create a Bricks API key

Use id from the previous step as settingId to create a key with a rate limit of 2 req/min and a spend limit of 25 cents.

curl -X PUT http://localhost:8001/api/key-management/keys \
   -H "Content-Type: application/json" \
   -d '{
	      "name": "My Secret Key",
	      "key": "my-secret-key",
	      "tags": ["mykey"],
        "settingIds": ["ID_FROM_STEP_FOUR"],
        "rateLimitOverTime": 2,
        "rateLimitUnit": "m",
        "costLimitInUsd": 0.25
      }'   

Congratulations you are done!!!

Then, just redirect your requests to us and use OpenAI as you would normally. For example:

curl -X POST http://localhost:8002/api/providers/openai/v1/chat/completions \
   -H "Authorization: Bearer my-secret-key" \
   -H "Content-Type: application/json" \
   -d '{
          "model": "gpt-3.5-turbo",
          "messages": [
              {
                  "role": "system",
                  "content": "hi"
              }
          ]
      }'

Or if you're using an SDK, you could change its baseURL to point to us. For example:

// OpenAI Node SDK v4
import OpenAI from 'openai';

const openai = new OpenAI({
  apiKey: "some-secret-key", // key created earlier
  baseURL: "http://localhost:8002/api/providers/openai/v1", // redirect to us
});

How to Update?

For updating to the latest version

docker pull luyuanxin1995/bricksllm:latest

For updating to a particular version

docker pull luyuanxin1995/bricksllm:1.4.0

Documentation

Environment variables

Name type description default
POSTGRESQL_HOSTS required Hosts for Postgresql DB. Separated by , localhost
POSTGRESQL_DB_NAME optional Name for Postgresql DB.
POSTGRESQL_USERNAME required Postgresql DB username
POSTGRESQL_PASSWORD required Postgresql DB password
POSTGRESQL_SSL_MODE optional Postgresql SSL mode disable
POSTGRESQL_PORT optional The port that Postgresql DB runs on 5432
POSTGRESQL_READ_TIME_OUT optional Timeout for Postgresql read operations 2m
POSTGRESQL_WRITE_TIME_OUT optional Timeout for Postgresql write operations 5s
REDIS_HOSTS required Host for Redis. Separated by , localhost
REDIS_PASSWORD optional Redis Password
REDIS_PORT optional The port that Redis DB runs on 6379
REDIS_READ_TIME_OUT optional Timeout for Redis read operations 1s
REDIS_WRITE_TIME_OUT optional Timeout for Redis write operations 500ms
IN_MEMORY_DB_UPDATE_INTERVAL optional The interval BricksLLM API gateway polls Postgresql DB for latest key configurations 1s
STATS_PROVIDER optional "datadog" or Host:Port(127.0.0.1:8125) for statsd.
PROXY_TIMEOUT optional Timeout for proxy HTTP requests. 600s
NUMBER_OF_EVENT_MESSAGE_CONSUMERS optional Number of event message consumers that help handle counting tokens and inserting event into db. 3
AWS_SECRET_ACCESS_KEY optional It is for PII detection feature. 5s
AWS_ACCESS_KEY_ID optional It is for using PII detection feature. 5s
AMAZON_REGION optional Region for AWS. us-west-2
AMAZON_REQUEST_TIMEOUT optional Timeout for amazon requests. 5s
AMAZON_CONNECTION_TIMEOUT optional Timeout for amazon connection. 10s
ADMIN_PASS optional Simple password for the admin server.

Admin Server

Swagger Doc

Proxy Server

Swagger Doc

排名相邻
同类项目