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

@maplezzk/llm-proxy

v0.11.0

Published

本地统一 LLM 模型代理工具 — 多协议路由、协议互转、流式 SSE 转换、token 统计、协议抓包调试

Downloads

3,532

Readme

llm-proxy

English | 简体中文

本地 LLM 代理服务,单端口同时提供管理 UI 和 AI API,支持多协议路由、协议互转、流式 SSE 转换、token 统计、协议抓包调试。

功能特性

  • 🔀 多协议支持:单端口提供 Anthropic、OpenAI、OpenAI Responses 三种协议
  • 🔄 协议互转:三个协议间双向转换(流式 + 非流式)
  • 🖥️ macOS 桌面应用:原生菜单栏 App,内嵌代理服务,拖拽安装、零依赖
  • 📊 管理界面:Alpine.js 单页应用,包含仪表盘、Provider 管理、适配器配置、抓包调试
  • 🎯 虚拟适配器:自定义端点 + 模型重映射(/{adapter-name}/v1/...
  • 📡 SSE 流式:4 个双向流转换器,每行带时间戳
  • 🔍 协议抓包:环形缓冲记录原始请求/响应,支持左右对比 + 差异分析
  • 🔥 热加载:配置原子替换,进行中请求不受影响
  • 📈 Token 统计:按 Provider 统计 token 使用量

截图

安装

macOS(推荐):Releases 下载 LLMProxy.dmg,拖入 /Applications。如果 macOS 阻止运行,执行:

xattr -cr /Applications/LLMProxy.app

再次打开即可。内含完整代理服务和管理界面。

macOS(Homebrew):

brew tap maplezzk/tap && brew install --cask llm-proxy

仅 CLI:

npm install -g @maplezzk/llm-proxy

快速开始

# 启动
llm-proxy start

# 打开管理界面 → http://127.0.0.1:9000/admin/

On first launch, the config directory is created automatically. Open the admin UI to configure everything in your browser — no manual YAML editing needed.

The admin UI supports:

  • Provider management: Add/edit/delete AI providers, pull model lists from APIs
  • Adapter config: Create virtual endpoints with model remapping and protocol adaptation
  • Proxy key: Set API authentication key
  • Live test: Send test requests directly to verify configuration
  • Protocol capture: Real-time request/response inspection

配置

~/.llm-proxy/config.yaml:

log_level: debug          # debug | info | warn | error
proxy_key: sk-xxx         # 可选:设置后 /v1/* 需认证

providers:
  - name: deepseek
    type: openai          # anthropic | openai | openai-responses
    api_key: ${DEEPSEEK_API_KEY}
    api_base: https://api.deepseek.com
    models:
      - id: deepseek-chat

  - name: anthropic
    type: anthropic
    api_key: ${ANTHROPIC_API_KEY}
    models:
      - id: claude-sonnet-4

adapters:
  - name: my-tool
    type: anthropic
    models:
      - sourceModelId: claude-sonnet-4
        provider: anthropic
        targetModelId: claude-sonnet-4-20250514

API Key 通过环境变量注入(${VAR}),配置文件不保存明文密钥。

CLI 命令

llm-proxy start     # 启动代理
llm-proxy stop      # 停止代理
llm-proxy restart   # 重启
llm-proxy reload    # 热加载配置(零中断)
llm-proxy status    # 查看状态

管理 API

| 端点 | 方法 | 说明 | |----------|--------|-------------| | /admin/config | GET | 查看配置(Key 脱敏) | | /admin/config/reload | POST | 热加载配置 | | /admin/health | GET | 健康检查 | | /admin/status/providers | GET | Provider 状态统计 | | /admin/logs | GET | 请求日志 | | /admin/logs/stats | GET | 日志统计 | | /admin/token-stats | GET | Token 统计 |

协议转换矩阵

| 源 | 目标 | 非流式 | 流式 (SSE) | |--------|--------|:---:|:---:| | Anthropic | OpenAI | ✅ | ✅ | | OpenAI | Anthropic | ✅ | ✅ | | Anthropic | OpenAI Responses | ✅ | ✅ | | OpenAI Responses | Anthropic | ✅ | ✅ |

架构

  • 运行时:Node.js >= 20, TypeScript ESM
  • 前端:Alpine.js 单页应用
  • 构建tsc + esbuild
  • 测试:Node.js 原生测试运行器 + tsx(115 tests)

开发

详见 DEVELOPMENT.md

npm run dev          # 开发模式启动代理
npm test             # 运行 115 个测试
npm run build:app    # 构建 macOS .app + .dmg

FAQ

Homebrew 安装显示旧版本? 强制刷新 tap:

brew untap maplezzk/tap && brew tap maplezzk/tap && brew install --cask llm-proxy

macOS 阻止应用运行? 清除隔离标记:

xattr -cr /Applications/LLMProxy.app