gproxy v3.0.9
v3.0.9
Restore route balancing strategies and model access controls, and fix v2 upgrade compatibility and late validation failures.
English
Added
- Route settings now offer
round_robin, smoothweighted, andfailoverstrategies. Round robin alternates members per request regardless of their weights; weighted spreads requests in proportion to weights; failover keeps a fixed order within each tier, by descending weight then member ID. New routes default to round robin. (#232) - Permissions support exact public model names and
*patterns for organizations, teams, users, and API keys, combined with provider and operation-group restrictions. Model lists, Portal capabilities, inference, and retries enforce the same grants and deny precedence. Provider-scoped rules match local model names; global rules use public names such asprovider/model. (#233)
Fixed
- Equal weights such as
100/100no longer create 100-request blocks. Credential round robin also uses smooth weighted selection. Session affinity applies only to sticky provider pools and cannot override the route-selected provider/model; model-catalogue reads no longer advance live rotation counters. (#232) - v2 import preserves round-robin, weighted, and failover route strategies.
least_latencyis not implemented in this release: legacy routes using it are explicitly reported and converted to round robin. - v2 model grants are imported instead of dropped. Legacy provider-name grants expand to public model namespace patterns rather than granting every route sharing that provider. The report identifies each converted grant and each skipped invalid subject by source row and scope. (#233)
- Legacy provider
credential_strategyvalues such asapi_keyare normalized to round robin, matching v2's non-sticky behavior; sticky remains sticky. Each normalization is reported with the provider ID and name. (#234) - Configuration preflight validates an isolated in-memory v3 store before automatic upgrade copies the source database or reads historical usage/log rows. Manual dry runs use the same validation. Actual imports validate the combined configuration before writing history, and late failures are appended to
report.txt. (#234) - Credential quota capacity estimates include settled estimated usage when authoritative usage is unavailable, without counting requests twice when later observations arrive.
Upgrade notes
- Existing v3 routes receive
weighted, preserving their weight proportions while smoothing distribution. The original v2 route strategy cannot be inferred from a database that already discarded it; select the intended strategy in Console settings. - If automatic migration previously failed, stop gproxy, install v3.0.9, inspect the saved report, and remove
.gproxy-v2-upgrade-blockedonce the reported cause is resolved before restarting. Retain the original database and backup files. The.lockfile does not need removal: the operating-system lock is released when the old process exits. - Grants dropped by an earlier completed migration cannot be recreated from the upgraded database alone. Restore them through the new model permission editor using the original v2 database or saved configuration. A narrower allow rule does not cancel an existing broader allow rule; review any provider-wide workaround grants.
- Model-limited grants do not authorize model-less service control operations or existing Realtime sideband connections. These need an appropriate unrestricted-model grant; query parameters cannot rename an existing call for authorization.
简体中文
新增
- 路由设置支持
round_robin(轮询)、平滑weighted(加权轮询)和failover(故障转移)。轮询按请求交替选择成员,不按权重分配流量;加权轮询按比例平滑分配;故障转移在每个优先层内按权重降序、成员 ID 保持固定主备顺序。新路由默认轮询。(#232) - 权限支持按精确公开模型名和
*通配符授权给组织、团队、用户及 API Key,并可组合供应商和操作组限制。模型列表、Portal 能力列表、推理和重试统一检查,拒绝规则优先。指定供应商时匹配供应商内的模型名;全局规则使用provider/model等公开名称。(#233)
修复
100/100等权成员不再连续集中处理 100 个请求;凭据轮询也改为平滑加权选择。只有 sticky 供应商池启用会话亲和性,且不能覆盖路由选定的供应商/模型;查询模型列表不再消耗实际请求的轮询计数。(#232)- v2 导入保留轮询、加权和故障转移策略。本版暂不实现
least_latency,旧库使用此策略时明确报告并转换为轮询。 - v2 的模型授权不再直接丢弃。旧供应商名称授权转换为公开模型命名空间匹配,不会直接放开共享该供应商的全部路由;报告按源记录和授权对象列出转换结果及跳过的无效授权。(#233)
- 将
api_key等旧credential_strategy值规范化为轮询,保持 v2 非 sticky 分支的实际行为;sticky 保持不变。报告包含发生转换的供应商 ID 和名称。(#234) - 自动升级先在隔离的内存 v3 数据库中验证配置,再复制源库、读取历史用量和日志;手动 dry-run 使用相同预检。实际导入在写入历史数据前再次验证完整配置,后续失败也会追加到
report.txt。(#234) - 凭据额度容量估算在缺少权威用量时纳入已结算的估算用量,并避免后续观测到达后重复计数。
升级说明
- 已有 v3 路由默认补为
weighted,保持权重比例并改善分布。此前已经丢失的 v2 策略无法从新库推断,请在 Console 路由设置中选择原先期望的策略。 - 自动迁移曾失败的实例,请先停止服务、安装 v3.0.9、检查保存的报告,确认错误原因已解决后删除
.gproxy-v2-upgrade-blocked再启动;保留原库及备份。无需删除.lock文件,旧进程退出后操作系统会释放锁。 - 早期迁移已丢弃的授权无法仅凭新库恢复,请根据原 v2 数据库或保存的配置,在模型权限编辑器中重新设置。较窄的允许规则不会抵消已有的较宽授权,请检查此前为恢复访问而添加的供应商级授权。
- 模型受限授权不会放行没有模型名的服务控制操作或已有 Realtime 通话的 sideband 连接,这些操作需要适当的全模型授权;不能通过查询参数伪装已有通话的模型。