admin
401f9be351
feat(llm): token 计量 + 对话审计日志(10GiB 容量触发式清理)
- llm_usage.rs: body filter 旁路(FFI 注册 top_body_filter,无需额外 C 模块),
透传 SSE 的同时抓尾部 usage chunk(OpenAI stream_options.include_usage / Anthropic message_delta),
解析 prompt/completion tokens 写 shm utt:/utms: 键
- llm_audit.rs: log 阶段把请求体临时文件复制进审计目录(audit/ = data 兄弟目录),
meta.jsonl 记 user/slot/status/token;10 GiB 容量阈值触发式清理,按日期目录从最旧删起
- conf/nginx.conf: LLM location 去掉 proxy_request_buffering off(它管请求体方向、
与 SSE 无关且与 client_body_in_file_only 互斥),SSE 流式由 proxy_buffering off 保障
- stats/api: 用量接口增加 tokens 维度(today/total per user per slot)
- ipass-agent.py: 容器重建时自动挂审计卷(宿主 audit/ = data 兄弟目录,自动建目录)
- update-agent-face.sh: 控制面自更新脚本(.11 上一行命令完成下载/备份/校验/重启/自检)
- tests: LLM 117/117(+6: 审计 4 + token 2)、网关 90/90,共 207 全绿
2026-09-12 17:59:34 +08:00
..
2026-09-12 17:59:34 +08:00
2026-09-11 15:37:09 +08:00
2026-09-11 15:37:09 +08:00
2026-09-11 15:37:09 +08:00
2026-09-11 15:58:41 +08:00