- get_search_providerid.dspy: return {providerid, providerid_text}
- get_search_upappid.dspy: return {upappid, upappid_text}
- get_search_apiname.dspy: return {apiname, apiname_text}
- json/llm.json: add valueField/textField for providerid, upappid
- json/llm_api_map.json: add valueField/textField for apiname, query_apiname
This ensures filter form and add/edit form use the same data format.
- utils.py: get_llms_by_catelog now queries all distinct ppids for each model
and calls get_pricing_display to get pricing text
- show_llms_cards.ui: added Filler with pricing-box CSS to display pricing info
- model_plaza.css: added styles for pricing-box and pricing-text (light/dark mode)
- utils.py: get_llmage_llm - when catelogid provided, use it instead of forcing isdefaultcatelog=1
- list_paging_catelog_llms.dspy: handle missing llmid in SQL, add llmcatelogid to returned rows
- llm_dialog.ui: use Jinja2 namespace for variable scoping in for loop
- utils.py: get_llmcatelogid -> get_llm_catelogs (returns ALL catelogs with name+isdefault)
- llmclient.py: inference() passes params_kw.llmcatelogid to get_llm()
- llm_dialog.ui: renders catelog tab buttons when model has multiple catelogs,
defaults to isdefaultcatelog, passes llmcatelogid to both LlmIO models and list_models_url
- init.py: export get_llm_catelogs
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)
- Add llmcatelogid parameter to filter by model catalog (joins llm table)
- Change default pagerows from 50 to 10
- Add pagerows parameter for custom page size
- UNION ALL query from llmusage + llmusage_history tables
- Filter by current user's userid, sorted by use_time desc
- 50 records per page with pagination support
- Reads ioinfo webpath via FileStorage to return actual input/output content
- Registered in load_path.py for RBAC (logined role)
- llm_launch_check_api.dspy: add check_charging action
* Takes usages JSON from inference result
* Calls env.buffered_charging(ppid, usages) to verify pricing works
* Returns pricing breakdown with amounts and costs
- llm_launch_check.ui: add '检查计费' button
* Appears after successful inference
* Passes usage data to check_charging API
* Displays pricing calculation results
- llm_launch_check_api.dspy: simplify inference action
* Direct uapi.call() instead of full inference pipeline
* Extracts usage from response without writing to database