feat: 补充用量统计与上报的部署配置
- configmap 增加计价表与上报地址,改价不必重新发版 - lpt-ai 增加 LPT_AI_REPORT_URL/TOKEN,lpt-be 增加上报入站令牌 - 新增白名单变量,共用一个可选 secret key
This commit is contained in:
@@ -11,5 +11,19 @@ data:
|
|||||||
LPT_AI-SERVICE_URL: http://lpt-ai:5199
|
LPT_AI-SERVICE_URL: http://lpt-ai:5199
|
||||||
PORT: "5199"
|
PORT: "5199"
|
||||||
|
|
||||||
|
# AI 用量统计(计价表按 DeepSeek 官方 PEAK 一列,USD / 1M tokens)
|
||||||
|
# 改价只需改这里并重启 lpt-ai,历史账不受影响:费用在结算时已冻结进数据库。
|
||||||
|
LLM_PRICE_CACHE_HIT_PER_M: "0.006"
|
||||||
|
LLM_PRICE_CACHE_MISS_PER_M: "0.3"
|
||||||
|
LLM_PRICE_OUTPUT_PER_M: "1.2"
|
||||||
|
LLM_PRICE_OFFPEAK_FACTOR: "0.5"
|
||||||
|
LLM_PRICE_PEAK_WINDOWS: "01:00-04:00,06:00-10:00"
|
||||||
|
# 中国法定节假日(UTC 的 yyyy-MM-dd,逗号分隔),按谷时计价;每年需要更新
|
||||||
|
LLM_PRICE_PEAK_HOLIDAYS: ""
|
||||||
|
# lpt-ai 把用量推给 lpt-be;留空表示不上报,只保留 lpt-ai 本地面板(无长期账本)
|
||||||
|
LPT_AI_REPORT_URL: http://lpt-be:8888
|
||||||
|
# 可见「AI 用量统计」入口的用户名白名单(Spring Boot 松绑定到 lpt.ai-usage.admin-usernames)
|
||||||
|
LPT_AI-USAGE_ADMIN-USERNAMES: admin
|
||||||
|
|
||||||
# Spring Boot Database
|
# Spring Boot Database
|
||||||
SPRING_DATASOURCE_URL: jdbc:mysql://mysql:3306/learning_progress_tracker?allowPublicKeyRetrieval=true&characterEncoding=utf-8&useSSL=false&serverTimezone=GMT%2B8
|
SPRING_DATASOURCE_URL: jdbc:mysql://mysql:3306/learning_progress_tracker?allowPublicKeyRetrieval=true&characterEncoding=utf-8&useSSL=false&serverTimezone=GMT%2B8
|
||||||
|
|||||||
@@ -62,6 +62,20 @@ spec:
|
|||||||
name: lpt-secrets
|
name: lpt-secrets
|
||||||
key: lpt-ai-token
|
key: lpt-ai-token
|
||||||
optional: true
|
optional: true
|
||||||
|
# 用量上报(lpt-ai → lpt-be):地址为空时不上报,只保留本地面板
|
||||||
|
- name: LPT_AI_REPORT_URL
|
||||||
|
valueFrom:
|
||||||
|
configMapKeyRef:
|
||||||
|
name: lpt-config
|
||||||
|
key: LPT_AI_REPORT_URL
|
||||||
|
# 与 lpt-be 的 lpt.ai-usage.report-token 共用一个 secret key;
|
||||||
|
# optional 表示没设也能启动(此时 lpt-be 不校验上报令牌)
|
||||||
|
- name: LPT_AI_REPORT_TOKEN
|
||||||
|
valueFrom:
|
||||||
|
secretKeyRef:
|
||||||
|
name: lpt-secrets
|
||||||
|
key: lpt-ai-report-token
|
||||||
|
optional: true
|
||||||
resources:
|
resources:
|
||||||
requests:
|
requests:
|
||||||
cpu: 100m
|
cpu: 100m
|
||||||
|
|||||||
@@ -55,6 +55,14 @@ spec:
|
|||||||
name: lpt-secrets
|
name: lpt-secrets
|
||||||
key: lpt-ai-token
|
key: lpt-ai-token
|
||||||
optional: true
|
optional: true
|
||||||
|
# 用量上报入站令牌(与 lpt-ai 的 LPT_AI_REPORT_TOKEN 同一个 secret key);
|
||||||
|
# 为空表示不校验。该接口在 /internal/** 下,已排除 Sa-Token 登录校验。
|
||||||
|
- name: LPT_AI-USAGE_REPORT-TOKEN
|
||||||
|
valueFrom:
|
||||||
|
secretKeyRef:
|
||||||
|
name: lpt-secrets
|
||||||
|
key: lpt-ai-report-token
|
||||||
|
optional: true
|
||||||
resources:
|
resources:
|
||||||
requests:
|
requests:
|
||||||
cpu: 250m
|
cpu: 250m
|
||||||
|
|||||||
@@ -11,5 +11,19 @@ data:
|
|||||||
LPT_AI-SERVICE_URL: http://lpt-ai:5199
|
LPT_AI-SERVICE_URL: http://lpt-ai:5199
|
||||||
PORT: "5199"
|
PORT: "5199"
|
||||||
|
|
||||||
|
# AI 用量统计(计价表按 DeepSeek 官方 PEAK 一列,USD / 1M tokens)
|
||||||
|
# 改价只需改这里并重启 lpt-ai,历史账不受影响:费用在结算时已冻结进数据库。
|
||||||
|
LLM_PRICE_CACHE_HIT_PER_M: "0.006"
|
||||||
|
LLM_PRICE_CACHE_MISS_PER_M: "0.3"
|
||||||
|
LLM_PRICE_OUTPUT_PER_M: "1.2"
|
||||||
|
LLM_PRICE_OFFPEAK_FACTOR: "0.5"
|
||||||
|
LLM_PRICE_PEAK_WINDOWS: "01:00-04:00,06:00-10:00"
|
||||||
|
# 中国法定节假日(UTC 的 yyyy-MM-dd,逗号分隔),按谷时计价;每年需要更新
|
||||||
|
LLM_PRICE_PEAK_HOLIDAYS: ""
|
||||||
|
# lpt-ai 把用量推给 lpt-be;留空表示不上报,只保留 lpt-ai 本地面板(无长期账本)
|
||||||
|
LPT_AI_REPORT_URL: http://lpt-be:8888
|
||||||
|
# 可见「AI 用量统计」入口的用户名白名单(Spring Boot 松绑定到 lpt.ai-usage.admin-usernames)
|
||||||
|
LPT_AI-USAGE_ADMIN-USERNAMES: admin
|
||||||
|
|
||||||
# Spring Boot Database
|
# Spring Boot Database
|
||||||
SPRING_DATASOURCE_URL: jdbc:mysql://mysql:3306/lpt_prod?allowPublicKeyRetrieval=true&characterEncoding=utf-8&useSSL=false&serverTimezone=GMT%2B8
|
SPRING_DATASOURCE_URL: jdbc:mysql://mysql:3306/lpt_prod?allowPublicKeyRetrieval=true&characterEncoding=utf-8&useSSL=false&serverTimezone=GMT%2B8
|
||||||
|
|||||||
@@ -62,6 +62,20 @@ spec:
|
|||||||
name: lpt-secrets
|
name: lpt-secrets
|
||||||
key: lpt-ai-token
|
key: lpt-ai-token
|
||||||
optional: true
|
optional: true
|
||||||
|
# 用量上报(lpt-ai → lpt-be):地址为空时不上报,只保留本地面板
|
||||||
|
- name: LPT_AI_REPORT_URL
|
||||||
|
valueFrom:
|
||||||
|
configMapKeyRef:
|
||||||
|
name: lpt-config
|
||||||
|
key: LPT_AI_REPORT_URL
|
||||||
|
# 与 lpt-be 的 lpt.ai-usage.report-token 共用一个 secret key;
|
||||||
|
# optional 表示没设也能启动(此时 lpt-be 不校验上报令牌)
|
||||||
|
- name: LPT_AI_REPORT_TOKEN
|
||||||
|
valueFrom:
|
||||||
|
secretKeyRef:
|
||||||
|
name: lpt-secrets
|
||||||
|
key: lpt-ai-report-token
|
||||||
|
optional: true
|
||||||
resources:
|
resources:
|
||||||
requests:
|
requests:
|
||||||
cpu: 100m
|
cpu: 100m
|
||||||
|
|||||||
@@ -55,6 +55,14 @@ spec:
|
|||||||
name: lpt-secrets
|
name: lpt-secrets
|
||||||
key: lpt-ai-token
|
key: lpt-ai-token
|
||||||
optional: true
|
optional: true
|
||||||
|
# 用量上报入站令牌(与 lpt-ai 的 LPT_AI_REPORT_TOKEN 同一个 secret key);
|
||||||
|
# 为空表示不校验。该接口在 /internal/** 下,已排除 Sa-Token 登录校验。
|
||||||
|
- name: LPT_AI-USAGE_REPORT-TOKEN
|
||||||
|
valueFrom:
|
||||||
|
secretKeyRef:
|
||||||
|
name: lpt-secrets
|
||||||
|
key: lpt-ai-report-token
|
||||||
|
optional: true
|
||||||
resources:
|
resources:
|
||||||
requests:
|
requests:
|
||||||
cpu: 250m
|
cpu: 250m
|
||||||
|
|||||||
Reference in New Issue
Block a user