feat: 采集 LLM token 用量并上报 lpt-be
- 客户端解析上游 usage(含 DeepSeek 缓存命中/未命中),跨重试累加 - 新增计价表(三档单价 + 峰谷时段),费用在结算时冻结 - 新增用量上报与本地 outbox 重试;4xx 判定为确定性拒绝,不无限重试 - 面板补充 Token/费用/调用次数与计价快照 - 顺带修复面板内联脚本转义错误(模板字面量吃掉 \n 与 \',面板一直空白)
This commit is contained in:
+19
-1
@@ -1,2 +1,20 @@
|
||||
export { logStore, type LogEntry, type LogSummary } from "./store.js";
|
||||
export { logStore, resetLogStoreForTest, type LogEntry, type LogSummary } from "./store.js";
|
||||
export { adminRoutes } from "./routes.js";
|
||||
export {
|
||||
UsageReporter,
|
||||
usageReporter,
|
||||
loadReporterConfig,
|
||||
toUsageRecord,
|
||||
type UsageRecord,
|
||||
type ReporterConfig,
|
||||
} from "./reporter.js";
|
||||
export { fetchUpstreamBalance, type BalanceSnapshot } from "./balance.js";
|
||||
export {
|
||||
loadPricingConfig,
|
||||
priceUsage,
|
||||
isPeak,
|
||||
parsePeakWindows,
|
||||
type PricingConfig,
|
||||
type PricingSnapshot,
|
||||
type PricedUsage,
|
||||
} from "./pricing.js";
|
||||
|
||||
Reference in New Issue
Block a user