@maplezzk/llm-proxy 0.25.0 → 0.27.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -78,6 +78,7 @@ The admin UI supports:
78
78
  - **Provider management**: Add/edit/delete AI providers, pull model lists from APIs, declare input modalities (text/image)
79
79
  - **Adapter config**: Create virtual endpoints with model remapping and protocol adaptation
80
80
  - **Vision settings**: Enable external vision (image-to-text) for non-multimodal models, view cache stats
81
+ - **Management key**: Store an independent admin API key in this browser for protected management endpoints
81
82
  - **Proxy key**: Set API authentication key
82
83
  - **Live test**: Send test requests directly to verify configuration
83
84
  - **Protocol capture**: Real-time request/response inspection
@@ -90,6 +91,7 @@ The admin UI supports:
90
91
  log_level: debug # debug | info | warn | error
91
92
  port: 9000 # Optional: default 9000
92
93
  max_body_size: 10485760 # Optional: max request body in bytes (default 10MB)
94
+ admin_key: ${ADMIN_KEY} # Optional: protects admin APIs (the /admin UI shell stays public)
93
95
  proxy_key: sk-xxx # Optional: if set, /v1/* requires auth
94
96
 
95
97
  providers:
@@ -203,6 +205,8 @@ llm-proxy status # Show status
203
205
  | `/admin/test-adapter` | POST | Send a test request through an adapter |
204
206
  | `/admin/debug/captures/*` | GET / POST | Protocol capture ring buffer + SSE stream |
205
207
 
208
+ When `admin_key` is configured, all management APIs require `Authorization: Bearer <key>` or `x-api-key: <key>`. The static `GET /admin` shell stays public so the browser can save its key under **Settings → Management API Key**. To rotate or remove the key with hot reload, authenticate with the currently running key: `llm-proxy reload --admin-key <current-key>` (or set `LLM_PROXY_ADMIN_KEY`).
209
+
206
210
  ## Protocol Translation Matrix
207
211
 
208
212
  | Source | Target | Non-streaming | Streaming (SSE) |
package/README.zh.md CHANGED
@@ -78,6 +78,7 @@ llm-proxy start
78
78
  - **Provider 管理**:增删改 AI 服务商、拉取远程模型列表、声明输入模态(文本/图片)
79
79
  - **适配器配置**:创建带模型重映射和协议转换的虚拟端点
80
80
  - **识图设置**:为不支持图片的模型启用外挂识图、查看缓存命中率
81
+ - **管理密钥**:在当前浏览器保存独立的管理 API 密钥,用于访问受保护的管理接口
81
82
  - **代理密钥**:设置 API 认证密钥
82
83
  - **连通性测试**:直接发送测试请求验证配置
83
84
  - **协议抓包**:实时查看请求/响应原文
@@ -90,6 +91,7 @@ llm-proxy start
90
91
  log_level: debug # debug | info | warn | error
91
92
  port: 9000 # 可选:默认 9000
92
93
  max_body_size: 10485760 # 可选:请求体大小上限(字节,默认 10MB)
94
+ admin_key: ${ADMIN_KEY} # 可选:保护管理 API;/admin 页面外壳保持公开
93
95
  proxy_key: sk-xxx # 可选:设置后 /v1/* 需认证
94
96
 
95
97
  providers:
@@ -189,6 +191,8 @@ llm-proxy status # 查看状态
189
191
  | `/admin/test-adapter` | POST | 通过适配器发送测试请求 |
190
192
  | `/admin/debug/captures/*` | GET / POST | 协议抓包环形缓冲 + SSE 推送 |
191
193
 
194
+ 配置 `admin_key` 后,所有管理 API 都必须携带 `Authorization: Bearer <key>` 或 `x-api-key: <key>`;静态 `GET /admin` 页面外壳保持公开,以便在 **设置 → 管理 API Key** 中首次录入密钥。热重载轮换或删除密钥时,需用当前运行密钥鉴权:`llm-proxy reload --admin-key <当前密钥>`(也可设置 `LLM_PROXY_ADMIN_KEY`)。
195
+
192
196
  ## 协议转换矩阵
193
197
 
194
198
  | 源 | 目标 | 非流式 | 流式 (SSE) |
@@ -255,4 +259,4 @@ rm ~/.llm-proxy/vision-cache.json
255
259
 
256
260
  **识图缓存在哪里?** `~/.llm-proxy/vision-cache.json`,重启后保留,5s 防抖刷盘。
257
261
 
258
- **怎么给模型开启图片输入?** 在管理界面 → Providers → 编辑模型 → 勾选 **输入模态 → 图片**,或在 `config.yaml` 中加 `input: [text, image]`。未声明 `image` 的模型在配置了 `vision:` 后会自动走外挂识图。
262
+ **怎么给模型开启图片输入?** 在管理界面 → Providers → 编辑模型 → 勾选 **输入模态 → 图片**,或在 `config.yaml` 中加 `input: [text, image]`。未声明 `image` 的模型在配置了 `vision:` 后会自动走外挂识图。