10 Commits

Author SHA1 Message Date
43e8b40774 feat: multi-currency billing — llmusage currency fields + real-time exchange 2026-07-07 15:43:03 +08:00
6c2ccda2c7 修复llmusage展示脚本500错误并优化CRUD性能
- 将llmusage_ioinfo_display.ui和llmusage_usages_display.ui从Jinja模板改为.dspy脚本
- 在utils.py中添加get_llmusage_by_id和read_ioinfo_content两个函数
- 重写get_llmusage.dspy,避免sqlPaging子查询包装,分离count和data查询
- 为llmusage表添加use_time索引提升排序性能
- 更新load_path.py和json/llmusage.json引用新的.dspy文件
2026-06-26 17:55:52 +08:00
dcb0cd5cba bugfix 2026-06-26 11:06:52 +08:00
13c123c967 refactor: 重命名llmusage字段标题为orgname/username/model 2026-06-25 18:21:32 +08:00
a32249375d perf: 优化llmusage查询-移除大文本字段+添加userorgid索引 2026-06-25 18:04:02 +08:00
Hermes Agent
1aa28430e0 refactor: appcodes编码改用models codes段定义,清理json alters 2026-06-17 19:09:51 +08:00
d4e455ba9a perf: optimize get_inference_history query and add indexes
Query optimization (dspy):
- Replace UNION ALL + sort with two parallel queries (asyncio.gather)
  that each use (userid, use_time) composite index
- Python-side merge-sort of two pre-sorted sequences O(n)
- Concurrent FileStorage reads for ioinfo (asyncio.gather)

Indexes (models/*.json + /tmp/llmage_history_indexes.sql):
- llmusage: add idx_llmusage_userid_usetime (userid, use_time)
- llmusage_history: add idx_lh_userid_usetime (userid, use_time)
  (was missing userid index entirely - main bottleneck)
2026-06-05 17:42:15 +08:00
d44c2dae74 refactor(models): convert to json format per database-table-definition-spec 2026-05-27 13:23:28 +08:00
9fa8f9fa62 feat(llmage): 日期变更触发备份(use_date<昨天) + llmusage添加(accounting_status,use_date)组合索引 2026-05-24 17:21:34 +08:00
81bed1d384 feat: add json table definitions for all models (converted from xlsx) 2026-05-21 12:46:20 +08:00