618 Commits

Author SHA1 Message Date
45458159d4 docs: 快乐马 I2V 图片参数名更正为 image_file(非 image_url) 2026-05-30 23:15:52 +08:00
a7099d37f3 docs: add video model-specific input parameters to API.md
Extracted input parameters from video-model-api-doc.md for each platform:
- Vidu: T2V, I2V, 2I2V, Ref2V (v1/v2 subject/non-subject modes)
- Seedance: T2V, TI2V, Ref2V
- Tongyi/DashScope: T2V, I2V, 2I2V, Ref2V, IA2V
- Kling: T2V
- Hailuo/MiniMax: TI2V
- HappyHorse: T2V, I2V, Ref2V
2026-05-30 22:45:51 +08:00
fa99d04595 fix: reduce module card height (remove cheight, compact padding/icons) 2026-05-30 21:20:46 +08:00
5d52d02319 refactor: V1 API 支持新 catelogid 缩写(t2t/t2v/t2i等),向后兼容中文名
- v1/chat/completions: 默认值 '文生文' → 't2t',SQL 匹配 b.id OR b.name
- v1/video/generations: SQL 匹配 b.id OR b.name,注释示例更新
- v1/image/generations: SQL 匹配 b.id OR b.name,注释示例更新
- t2t/index.dspy: 默认值 '文生文' → 't2t',SQL 匹配 b.id OR b.name
- get_type_llms.dspy: 硬编码中文名改为 alias 映射(t2v/i2v/r2v)
- docs/API.md: 添加完整 catelogid ID 对照表,示例参数更新
2026-05-30 20:36:16 +08:00
08bebcd257 refactor: v1 API 统一使用 catelogid 参数替代 lctype/llmcatelogid 2026-05-30 16:22:21 +08:00
f32f49fb85 bugix 2026-05-30 16:13:45 +08:00
62dce1d3d7 chore: remove build/ from git tracking, add to .gitignore 2026-05-30 13:54:44 +08:00
5ec5946a90 fix: derive sage_root from script location instead of hardcoded path 2026-05-30 13:41:01 +08:00
e494c88977 fix: migrate_llmcatelog_ids script missing database config init
DBPools() was called without config.databases, causing NoneType error.
Load config from sage_root and pass config.databases like the other
migration script does.
2026-05-30 13:30:50 +08:00
7e4069f3b6 refactor: get_llm() uses get_llmage_llm() + cached uapi/uapiio lookups
Replace 6-table JOIN with 3-step approach:
1. get_llmage_llm() for base info (llm + llm_api_map + llmcatelog)
2. Cached uapi lookup (ioid, stream, callbackurl)
3. Cached uapiio lookup (input_fields)

Benefits:
- Code reuse: eliminates duplicate SQL
- Performance: uapi/uapiio cached with 5min TTL
- Maintainability: separate concerns for model info vs API config
- Adds invalidate_uapi_cache() for config changes
2026-05-30 12:19:42 +08:00
3ba1c50eb6 feat: add llmcatelog ID migration script (random IDs to meaningful abbreviations) 2026-05-30 12:07:19 +08:00
d84cc1d859 fix: API返回纯数组格式,添加模型上下架功能
- get_organizations/get_upapps/uapi_options: 返回纯数组[{value,text}]
- 新增 get_catelogs/get_apis/get_ppids: 独立下拉数据API
- llm_api_map_manage.ui: 使用独立API替代data_field嵌套格式
- json/llm.json: 移除data_field,添加上架/下架toolbar
- llm_status_update.dspy: 模型上下架状态更新API
- 重新生成 llm/index.ui CRUD界面
2026-05-30 01:43:09 +08:00
283b7d498c fix: wrap Tabular in VBox with cheight for proper scrolling 2026-05-29 22:09:51 +08:00
42f3a41b06 fix: remove duplicate get_llmage_llm (user's buggy version), keep corrected version 2026-05-29 17:44:06 +08:00
93ec47f198 refactor: add get_llmage_llm() for non-API-call llm data access, replace get_llm() in accounting and pricing 2026-05-29 17:41:43 +08:00
cef4859574 Merge branch 'main' of git.opencomputing.cn:yumoqing/llmage 2026-05-29 17:23:54 +08:00
4cc818b98b bugfix 2026-05-29 17:22:08 +08:00
adb0bafc0a chore: remove CRUD definition dirs from tracking, add gitignore 2026-05-29 13:18:20 +08:00
44d94dace5 refactor: optimize debug output - use debug_params for compact logging, truncate SQL; add CRUD definitions 2026-05-29 12:07:53 +08:00
c65cf35a85 refactor: use wildcard % in load_path.py for auto-coverage 2026-05-29 00:52:19 +08:00
eed21ce6a5 fix: responsive UI with VScrollPanel, cfontsize, css:card 2026-05-29 00:13:08 +08:00
d6e4221a7b feat: add model publish/unpublish (上架/下架) functionality
- llm table: add status field (published/unpublished, default unpublished)
- User-facing queries: filter by status='published' in 11 query points:
  - utils.py: get_llms_by_catelog_to_customer, get_llms_by_catelog,
    get_llm, get_llmproviders, get_llms_sort_by_provider
  - v1 endpoints: chat/completions, image/generations, video/generations
  - user pages: t2t, get_type_llms, list_catelog_models,
    list_paging_catelog_llms, llmcheck
- CRUD: status column visible/editable with select dropdown
- Admin CRUD list shows ALL models regardless of status
- Migration SQL: sql/add_status_field.sql (existing models set to published)
2026-05-28 23:42:29 +08:00
cb5efd5550 Revert "fix: 展平嵌套usage数据以支持pricing引擎点号路径查找"
This reverts commit 71626468e2cc701410801db31c5879ce6dfdb59f.
2026-05-28 16:58:37 +08:00
71626468e2 fix: 展平嵌套usage数据以支持pricing引擎点号路径查找
根因:pricing引擎的config_data.get(k)是平面dict查找,
当k='prompt_tokens_details.cached_tokens'时无法从嵌套结构取值。
在llm_charging()中将prompt_tokens_details和completion_tokens_details
的子键展平为顶层key(如'prompt_tokens_details.cached_tokens')。
2026-05-28 16:57:08 +08:00
534e4fe8e0 fix: remove hardcoded dark theme colors from stat cards for light theme support 2026-05-28 16:16:07 +08:00
65d5020fc7 bugfix 2026-05-27 13:41:48 +08:00
d44c2dae74 refactor(models): convert to json format per database-table-definition-spec 2026-05-27 13:23:28 +08:00
59d3c406ab fix: remove hardcoded dark theme colors from index.ui and show_llms pages
- Remove bgcolor/color/border hardcoded dark theme values from index.ui
- Use css:'card' class instead of inline bgcolor for navigation cards
- Remove conflicting bgcolor:#def0f0 from show_llms/show_llms_by_providers/show_same_catelog_llm
- Let system theme (bricks.css/shell_theme.css) handle styling
2026-05-27 11:31:13 +08:00
a4e3411584 feat: add scripts/load_path.py for RBAC permission management
- Migrate all llmage permission entries from sage/load_path.py
- Include new data_filter API endpoints (llm_list/create/update/delete, get_organizations, get_upapps)
- Include all existing v1, api, CRUD directory, and page endpoints
- Follow product_management/scripts/load_path.py pattern
2026-05-26 14:32:44 +08:00
9aa917bce5 feat: add data_filter and CRUD endpoints for llm table
- Add data_filter with 4 searchable fields (name LIKE, model LIKE, providerid, upappid)
- Add filter_labels for search form display
- Create llm_list.dspy with DBFilter support and LIKE wildcard handling
- Create llm_create.dspy, llm_update.dspy, llm_delete.dspy
- Create get_organizations.dspy and get_upapps.dspy for dropdown options
- Add browserfields alters for providerid and upappid dropdowns
- Add editable URLs for DataViewer CRUD operations
2026-05-26 14:26:38 +08:00
04913dbe42 refactor: 3-part layout - title (fixed), tab header/cards (fixed), content (filler, scrollable) 2026-05-26 13:42:44 +08:00
ca51e168dc docs: add API documentation for all /v1 endpoints
- docs/API.md: comprehensive API docs covering:
  - POST /v1/chat/completions (text generation)
  - POST /v1/video/generations (video generation, new)
  - POST /v1/image/generations (image generation, new)
  - GET /v1/tasks (async task status)
  - GET /v1/models (list available models)
  - Authentication, balance check, and billing notes
2026-05-26 13:10:05 +08:00
e9a20a091f revert: restore self-orgid balance bypass in checkCustomerBalance()
The 'if llm.ownerid == userorgid: return True' shortcut is correct
behavior — own organization's models should not require balance check.
2026-05-26 12:05:46 +08:00
265702b894 fix: remove self-orgid balance bypass in checkCustomerBalance()
Removed the 'if llm.ownerid == userorgid: return True' shortcut from
checkCustomerBalance() in llmage/accounting.py. All requests now go
through the full balance check regardless of whether the model belongs
to the caller's organization.
2026-05-26 12:02:23 +08:00
f151ad2c30 fix: add dark mode background (#0B1120) to llmage index.ui 2026-05-26 11:56:45 +08:00
146ebb2b4a feat: add /v1/video/generations and /v1/image/generations API endpoints
- wwwroot/v1/video/generations/index.dspy: video generation endpoint
  Required params: model, llmcatelogid, prompt
  Supports async task submission via existing inference infrastructure

- wwwroot/v1/image/generations/index.dspy: image generation endpoint
  Required params: model, llmcatelogid, prompt
  Supports both sync and async models depending on config

Both endpoints follow the same pattern as /v1/chat/completions:
  1. Validate required params (model + llmcatelogid + prompt)
  2. Look up llm via llm_api_map join with catalog type
  3. Check customer balance
  4. Route to inference (async/sync based on model config)
2026-05-26 11:45:37 +08:00
b558059dc8 Merge feat/dataviz-llmage: add llmage module stat cards
- Create stats.py with get_llmage_stats() helper function
- Add 4 stat widgets: stat_total_models, stat_today_calls, stat_today_amount, stat_catelog_count
- Update index.ui to display stat cards row above navigation cards
- Register get_llmage_stats in load_llmage()
2026-05-26 11:27:29 +08:00
9364989be3 Merge feat/modern-ui-llmage: modernize llmage index.ui with standardized card navigation
- Replace hardcoded colors with modern #1E293B card style
- Add 12px borderRadius to match design system
- Standardize SVG icons (36px, 1.5 stroke width)
- Fix entire_url paths to use /llmage/ module prefix
- Add page header with Title2 + description text
2026-05-26 11:27:23 +08:00
fd6d17e3c2 feat: add llmage module stat cards - model count, today's usage, amount, catalog count
- Create stats.py with get_llmage_stats() helper function
- Add 4 stat widgets: stat_total_models, stat_today_calls, stat_today_amount, stat_catelog_count
- Update index.ui to display stat cards row above navigation cards
- Register get_llmage_stats in load_llmage()
2026-05-25 18:48:09 +08:00
ae61193454 feat: modernize llmage index.ui with standardized card navigation
- Replace #1e3a5f hardcoded colors with modern #1E293B card style
- Add 12px borderRadius to match design system
- Add subtle #334155 borders for depth
- Standardize SVG icons to 36px with 1.5 stroke width
- Update colors: F1F5F9 text, 94A3B8 secondary descriptions
- Fix entire_url paths to use /llmage/ module prefix
- Add page header with Title2 + description text
2026-05-25 18:27:32 +08:00
56871dc906 fix(llmage): 修复backup_accounted_llmusage中sor.execute()返回值误用(MySQL cursor.execute返回None非rowcount) 2026-05-24 22:03:05 +08:00
7911750127 feat(llmage): 备份改用INSERT SELECT+DELETE单SQL语句 + 新增失败记录重试功能 2026-05-24 21:57:56 +08:00
686b05d8fe bugfix 2026-05-24 20:44:31 +08:00
489ba1ad88 bugfix 2026-05-24 19:48:36 +08:00
9fa8f9fa62 feat(llmage): 日期变更触发备份(use_date<昨天) + llmusage添加(accounting_status,use_date)组合索引 2026-05-24 17:21:34 +08:00
8755ab5d6d fix(llmage): 修复备份SQL条件 use_date < today(非yesterday)+ 提高备份频率到每5分钟 2026-05-24 17:06:23 +08:00
96317c1512 feat(llmage): menu.ui 添加记账失败记录菜单项 2026-05-24 15:36:33 +08:00
93bbd529db fix(llmage): failed_accounting.ui 日期控件改为UiDate 2026-05-24 15:16:01 +08:00
1e335d35cb fix(llmage): 规范检查修复
- accounting.py: 删除重复datetime导入, 清理未使用env变量
- failed_accounting.ui: Button text→label(规范), DatePicker→TextInput(不确定的widget)
- index.ui: backgroundColor→bgcolor(规范), 3处修复
- llmusage_accounting_failed_update.dspy: 删除ServerEnv()违规(.dspy禁用), 用datetime替代
- 新增llmusage_history只读DSPY(create/update/delete返回只读提示)
2026-05-24 14:11:33 +08:00
07b4893252 feat(llmage): 添加llmusage历史记录备份和记账失败检索功能
- 新增 llmusage_history 表:定时备份已记账(use_date<today)的历史记录
- 新增 llmusage_accounting_failed 表:记录记账失败详情,支持检索
- 新增 backup_accounted_llmusage() 函数:备份+清理历史数据
- 新增 get_failed_accounting_records() 函数:按条件检索失败记录
- 更新 llm_accoung_failed():同时写入失败表记录
- 新增 failed_accounting.ui 页面和 failed_accounting_list.dspy API
- 新增 llmusage CRUD API (create/update/delete)
- 新增表索引优化查询性能
- 更新 setup_llmage_perms.sh 添加新端点权限
- 生成生产迁移SQL: scripts/migrate_llmusage_history.sql
2026-05-24 13:55:48 +08:00