Hook AI网关 是 AI Skill Hub 本期精选AI工具之一。综合评分 7.5 分,整体质量较高。我们推荐使用将其纳入你的 AI 工具库,帮助提升工作效率。
统一模型路由、令牌/RBAC访问控制的AI API网关和运营平台
Hook AI网关 是一款基于 Rust 开发的开源工具,专注于 ai、gateway、llm 等核心功能。作为 GitHub 开源项目,它拥有活跃的社区支持和持续的版本迭代,代码完全透明可审计,支持本地部署以保护数据隐私。无论是个人使用还是集成到企业工作流,都能提供稳定可靠的解决方案。
统一模型路由、令牌/RBAC访问控制的AI API网关和运营平台
Hook AI网关 是一款基于 Rust 开发的开源工具,专注于 ai、gateway、llm 等核心功能。作为 GitHub 开源项目,它拥有活跃的社区支持和持续的版本迭代,代码完全透明可审计,支持本地部署以保护数据隐私。无论是个人使用还是集成到企业工作流,都能提供稳定可靠的解决方案。
# 方式一:cargo install(推荐) cargo install hook # 方式二:从源码编译 git clone https://github.com/zzispp/Hook cd Hook cargo build --release # 二进制在 ./target/release/hook
# 查看帮助 hook --help # 基本运行 hook [options] <input> # 详细使用说明请查阅文档 # https://github.com/zzispp/Hook
# hook 配置说明 # 查看配置选项 hook --config-example > config.yml # 常见配置项 # output_dir: ./output # log_level: info # workers: 4 # 环境变量(覆盖配置文件) export HOOK_CONFIG="/path/to/config.yml"
<p align="center"> <img src="apps/hook_frontend/public/logo/logo.svg" width="240" alt="Hook Logo"> </p>
<p align="center"> <strong>AI API Gateway and Operations Platform</strong> </p>
<p align="center"> English • <a href="README_CN.md">中文</a> </p>
---
Hook is a Rust and pnpm monorepo for an AI API gateway, user console, and operations admin panel. The backend uses Axum, SeaORM, Redis, and PostgreSQL for proxying, authentication, scheduling, billing, monitoring, and admin APIs. The frontend uses Next.js, React, MUI, and TypeScript.
Users call Hook with Hook-issued tokens through /v1 or /v1beta. Hook routes requests by model, provider, group, wallet balance, and permission policy, then records usage, billing, and runtime status.
/v1 and Gemini-style /v1beta routes for chat, Responses, Claude Messages, images, embeddings, rerank, audio, moderations, and Realtime.translation_languages and translation_entries through /api/i18n/resources.Stable release tags publish the multi-arch image ghcr.io/zzispp/hook. latest points to the latest stable release, while edge and nightly point to the latest main build. This deployment starts PostgreSQL, Redis, and the prebuilt Hook image, runs migration up, then serves the frontend and API from http://127.0.0.1:5555.
git clone https://github.com/zzispp/Hook.git
cd Hook
HOOK_COMPOSE_FILES=docker-compose.prebuilt.yml ./deploy.sh
./deploy.sh creates .env on first run, asks for the administrator username, email, and password, then starts Docker Compose. PostgreSQL password, JWT secret, and provider key encryption secret are generated automatically. PostgreSQL and Redis runtime data is stored in the hook-postgres and hook-redis Docker named volumes.
To pin a published image tag instead of latest, set HOOK_IMAGE_TAG:
HOOK_IMAGE_TAG=v1.0.1 HOOK_COMPOSE_FILES=docker-compose.prebuilt.yml ./deploy.sh
Useful commands:
docker compose --env-file .env -f docker-compose.prebuilt.yml logs -f hook
docker compose --env-file .env -f docker-compose.prebuilt.yml ps
docker compose --env-file .env -f docker-compose.prebuilt.yml down
docker compose down stops containers without deleting named volumes. Do not run docker compose down -v unless the deployment data should be deleted.
Use source-build deployment when you want to build the image locally from this checkout. It compiles the embedded frontend and backend inside Docker, starts PostgreSQL and Redis, runs migration up, then serves the frontend and API from http://127.0.0.1:5555.
git clone https://github.com/zzispp/Hook.git
cd Hook
./deploy.sh
For source-build deployments, update with:
./update.sh
update.sh runs git pull --ff-only, pulls build-independent service images, rebuilds the Hook image from the current source tree, and recreates the containers. It does not delete Docker named volumes.
Source build deployment uses the same embedded frontend path without Docker. PostgreSQL and Redis must be running, and config.yaml must point to them before the migration command runs.
```bash pnpm install cp config/config.yaml config.yaml scripts/generate-password-hash.sh "your-password"
pnpm build:frontend
pnpm build:backend
NEXT_PUBLIC_SERVER_URL=http://127.0.0.1:5555 pnpm build:backend:embedded
NEXT_PUBLIC_SERVER_URL=http://127.0.0.1:5555 pnpm start:embedded
Important config keys include server.*, database.*, redis.*, jwt.secret, security.provider_key_secret, admin.*, auth.*, tracing.log_level, NEXT_PUBLIC_SERVER_URL, and HOOK_BACKEND_URL.
Migration commands:
cargo run -p hook_backend -- migration up # Apply baseline without clearing complete existing tables
cargo run -p hook_backend -- migration status # Show baseline table status
cargo run -p hook_backend -- migration down # Drop baseline tables and marker
cargo run -p hook_backend -- migration fresh # Drop and recreate baseline
cargo run -p hook_backend -- migration refresh # Drop and recreate baseline
cargo run -p hook_backend -- migration reset # Drop baseline tables and marker
cargo run -p hook_backend -- migration up pnpm build:frontend:embedded cargo run -p hook_backend ```
GET /health: health check./api/*: console, admin, auth, wallet, billing, provider, model, and monitoring APIs./v1/*: OpenAI, Claude, and Jina compatible proxy./v1beta/*: Gemini compatible proxy.Common proxy routes include /v1/models, /v1/chat/completions, /v1/responses, /v1/messages, /v1/images/generations, /v1/embeddings, /v1/rerank, /v1/realtime, /v1beta/models/{model}:generateContent, and /v1beta/models/{model}/embedContent.
GitHub Releases publish platform packages for Linux and macOS:
hook-vX.Y.Z-linux-amd64.tar.gzhook-vX.Y.Z-linux-arm64.tar.gzhook-vX.Y.Z-macos-amd64.tar.gzhook-vX.Y.Z-macos-arm64.tar.gzinstall.shSHA256SUMSThese packages contain hook_backend, generate_password_hash, a binary deployment config template, and the license. They are useful when PostgreSQL and Redis are already managed outside Hook. They do not start PostgreSQL or Redis.
curl -fsSL https://github.com/zzispp/Hook/releases/latest/download/install.sh | sudo bash
To install a specific version:
curl -fsSL https://github.com/zzispp/Hook/releases/download/v0.1.0/install.sh | sudo bash -s -- --version v0.1.0
The installer downloads the current platform package, verifies it against SHA256SUMS, installs it under /opt/hook/releases/<version>, updates /opt/hook/current, writes /etc/hook/config.example.yaml, and creates /etc/hook/config.yaml when it does not already exist. Edit /etc/hook/config.yaml, then run:
/opt/hook/current/bin/generate_password_hash "your-password"
/opt/hook/current/bin/hook_backend --config /etc/hook/config.yaml migration up
/opt/hook/current/bin/hook_backend --config /etc/hook/config.yaml
高性能AI网关和运营平台,支持统一模型路由和访问控制
AI Skill Hub 为第三方内容聚合平台,本页面信息基于公开数据整理,不对工具功能和质量作任何法律背书。
建议在沙箱或测试环境中充分验证后,再部署至生产环境,并做好必要的安全评估。
✅ MIT 协议 — 最宽松的开源协议之一,可自由商用、修改、分发,仅需保留版权声明。
经综合评估,Hook AI网关 在AI工具赛道中表现稳健,质量良好。如果你已有明确的使用需求,可以直接上手体验;如果还在评估阶段,建议对比同类工具后再做决策。
| 原始名称 | Hook |
| 原始描述 | 开源AI工具:AI API gateway and operations platform for unified model routing, token/RBAC acc。⭐15 · Rust |
| Topics | aigatewayllmrust |
| GitHub | https://github.com/zzispp/Hook |
| License | MIT |
| 语言 | Rust |
收录时间:2026-06-09 · 更新时间:2026-06-09 · License:MIT · AI Skill Hub 不对第三方内容的准确性作法律背书。