V1.8.6 - #1341
Merged
Merged
V1.8.6#1341
Conversation
…TagLevel - Remove QuotaPlan.CreateTime/ResetMode from token_rule.data. - Remove Token.status/update_time; change Token.Enabled from int to bool. - Add TagLevel to ApikeyTag and access log protobuf. - Update validation, auth logic, tests, testdata and docs accordingly. - Upgrade bfe-access-pb to v0.3.0.
refactor(mod_ai_token_auth): simplify token_rule.data fields and add …
- Extend TokenUsage with CacheReadTokens and CacheWriteTokens - Add cache price constants and fixed-point conversion in cluster_conf - Parse cache usage in non-streaming and streaming paths - Update calcCostUnits to split cache billing with fallback logic - Serialize cache fields in access log protobuf - Upgrade bfe-access-pb to v0.3.1 - Add unit tests and SC03 integration tests for cache billing - Update design docs and integration test design docs Signed-off-by: zhangmiao <zhangmiao@yf-networks.com>
- Add TestTC08_CacheTokenFields to verify ai_cache_read_tokens, ai_cache_write_tokens and cache-aware ai_cost_value in access log. - Update SC05 test design docs with TC-08. - Update cache billing design-changes.md to include SC05 access log test. Signed-off-by: zhangmiao <zhangmiao@yf-networks.com>
Signed-off-by: zhangmiao <zhangmiao@yf-networks.com>
Signed-off-by: zhangmiao <zhangmiao@yf-networks.com>
- Add Mode to AiBasicInfo and DetectModeFromPath for path-based mode inference - Add ImageCount to TokenUsage and QuotaUsage - Support output_cost_per_image in ModelTable price conversion - Update usage parsing to read image_count / data.# / request.n fallback - Branch calcCostUnits by mode with calcImageGenerationCost and calcChatCost - Log ai_mode and ai_image_count in mod_access_pb3 - Add integration tests for image generation RMB billing and access log fields - Update bfe-access-pb dependency to v0.3.3 - Update sys_design and test design docs Signed-off-by: zhangmiao <zhangmiao@yf-networks.com>
…ration tests - Detect request auth style (openai/anthropic) by path and headers - Inject x-api-key and anthropic-version for Anthropic-style requests - Reject requests when cluster AIConf.ModelProtocols does not match - Add ModelProtocols field to AIConf and parse it from cluster_conf.data - Add ai_protocol to protobuf access logs - Update sys_design and configuration docs for Claude protocol support - Add SC06 integration tests for OpenAI/Anthropic forwarding and mismatch rejection Signed-off-by: zhangmiao <zhangmiao@yf-networks.com>
- Use control-plane generated redis_key for RPM/TPM limiter keys - Fallback to original name-based key when redis_key absent - Ignore max_concurrency=0 to avoid rejecting all requests - Add SC07 integration tests for redis key stability - Sync Chinese and English configuration docs Signed-off-by: zhangmiao <zhangmiao@yf-networks.com>
Modifications to v1.8.6
…key cleanup - Use full Redis key exported by ai-gateway-api for rate-limit counters. - Add DeleteKeys support to Redis client/BNS wrapper for control-plane cleanup.
feat(bfe): consume full Redis key from rate-limit export and support …
- Cache bodyModel across fallback/retry attempts to avoid repeated JSON parsing. - Recompute targetModel from ClientModel for every cluster attempt. - Unconditionally update aiMeta.TargetModel. - Add computeTargetModel helper and unit tests. - Fix mockRedisClient to implement redis_client.Client.Delete. - Add integration tests and design docs for SC06/SC07/SC08. 本次 commit 合并了 5cc3335 中提交的修改。 Fixes #1323 Signed-off-by: zhangmiao <zhangmiao@yf-networks.com>
fix: model modification when retry between clusters in ServeHTTPForAI
…tion tests - Add Tiers/TierPrices parsing and validation in cluster_conf - Update mod_ai_token_auth to select tier price based on request time - Add SC09 integration tests for peak tier, fallback, and cache billing - Add SC09 test design docs under 测试设计文档 - Update cluster_conf.data.md and rmb_quota.md documentation - Update overall scenario list to include SC09
feat: RMB tiered pricing support with peak/off-peak tiers and integra…
…tives Add two BFE condition primitives for routing based on HTTP Content-Length: - req_body_larger_than(<bytes>): matches when body size > threshold - req_body_less_than(<bytes>): matches when body size < threshold Both primitives return false when Content-Length is absent. Includes implementation, parser registration, unit tests, and docs (zh_cn + en_us).
feat: add req_body_larger_than and req_body_less_than condition primi…
- 在 reverseproxy 中实现基于 Redis 的会话级 API-Key 绑定 - cluster_conf 新增 KeyAffinity/KeyAffinityRedis 配置解析 - 更新 multi_api_key 系统设计文档与中英文 configuration 文档 - 新增 modifications 修改说明文档 - 新增 SC10 集成测试及测试设计文档 - 新增 bfe-rd-workflow Skill 到多个 Agent 目录
- 将 SessionAffinityTTL 默认值从 300 秒调整为 600 秒 - 命中 Redis 绑定后调用 Expire 刷新 TTL,实现空闲超时语义 - 同步更新 modifications / sys_design / configuration 中英文文档 - 更新相关单元测试期望值
Add GetInt64Batch to redis_client.Client interface and RedisClient implementation to support MGET-based batch quota balance reads in ai-gateway-api. Fix mockRedisClient implementations in mod_ai_token_auth and bfe_server tests to implement the new interface method.
Modifications to V1.8.6
- Add fallback for usage.prompt_cache_hit_tokens and usage.prompt_tokens_details.cached_tokens in: - mod_ai_token_auth.UpdateCtxByUsage - mod_body_process.SSEEvent.GetQuotaUsage - mod_body_process.RawEvent.GetQuotaUsage - Add unit tests for DeepSeek cache field parsing - Add SC09 integration tests TC05/TC06 for DeepSeek cache fields - Update rmb_quota.md sys_design doc to document DeepSeek cache fallback - Add design-changes.md under modifications/2026-08-27-deepseek-busy-hour-billing-fix Relates to ai-gateway-api#101
fix bug for deepseek quota-rmb
Signed-off-by: zhangmiao <zhangmiao@yf-networks.com>
doc: add BFE AI gateway error codes documentation
Signed-off-by: zhangmiao <zhangmiao@yf-networks.com>
chore: bump version to 1.8.6 and update CHANGELOG
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.