phamnazage-jpg 1db813cb6b
Some checks failed
CI / go-test (push) Has been cancelled
CI / frontend-build (push) Has been cancelled
CI / docker-build (push) Has been cancelled
docs: 移动云语音计费字段扩展 API 文档更新
- API_REFERENCE: 新增 pricingMode/priceUnit/flatPrice 字段说明
- PLAN_CATALOG_COVERAGE_MATRIX: 移动云标记为已入库(△→✓)
- NEXT_IMPORTER_RUNTIME_PRIORITY: P2-1 标记为已完成
2026-05-22 14:46:56 +08:00

LLM Intelligence Hub

面向 LLM 模型、定价与日报产出的情报采集项目,当前仓库提供:

  • Go 采集脚本:采集 OpenRouter、多源补充数据与官方补录数据
  • PostgreSQL 数据层:保存模型、区域定价、订阅套餐、日报与运行审计
  • Go HTTP API提供模型列表、套餐列表、最新正式日报入口
  • Vite + React 前端:提供 Dashboard / Explorer 两个只读页面
  • Shell 运维脚本:迁移、调度、备份、恢复、验收与性能门禁

两大模块

项目现在按运行职责拆成两大模块:

  1. 情报采集与信号沉淀模块 负责真实采集、官方补录、套餐导入、目录核验,以及把“新模型 / 价格变化 / 官方发布 / 活动窗口”等关键信号物化到 daily_signal_snapshot
  2. 日报与下游表达模块 负责消费 modelsregion_pricingsubscription_plandaily_signal_snapshot 等结构化事实,生成 HTML / Markdown 日报;后续视频、卡片流、推送等形态也应挂在这一层。

当前能力边界

  • 真实生产主链路是“采集/导入脚本 + PostgreSQL + 日报生成器 + API Server + Nginx”
  • 最新正式日报由 scripts/run_daily.sh 生成,并写入 daily_report / report_runs
  • 手工复跑使用 scripts/run_real_pipeline.sh,不会把产物标记成正式日报
  • 历史补跑使用 scripts/rebuild_historical_report.sh YYYY-MM-DD
  • HTTP API 当前未内建认证、授权和限流;公网暴露前必须在网关层补齐

目录概览

cmd/server/                  Go API Server
internal/                    通用内部库collector、retry
scripts/                     采集、导入、日报、验收、运维脚本
db/migrations/               PostgreSQL 迁移
frontend/                    Vite + React 前端
reports/daily/               日报产物与归档
ops/                         运维配置(如 logrotate
docs/                        补充说明与上线文档

本地启动

1. 准备环境

cp .env.example .env

至少需要配置:

  • DATABASE_URL
  • OPENROUTER_API_KEY(仅真实采集需要)

详细变量说明见 docs/CONFIGURATION.md

2. 应用数据库迁移

bash scripts/apply_migration.sh

3. 启动 API Server

go run ./cmd/server

默认端口为 8080,可通过 PORT 覆盖。

4. 启动前端开发环境

cd frontend
npm install
npm run dev

生产运行主链路

第一模块独立运行

bash scripts/run_intel_pipeline.sh

该入口只执行第一模块:

  1. 真实采集与多源补充
  2. 官方模型价格与套餐导入
  3. 平台目录核验
  4. 每日关键信号物化到 daily_signal_snapshot

它不会生成日报,适合先把“数据与信号层”单独跑通。

正式日报调度

bash scripts/run_daily.sh

该脚本负责:

  1. OpenRouter 真实采集
  2. 多源补充同步
  3. 官方导入脚本执行
  4. 每日关键信号物化
  5. 数据质量检查
  6. Markdown / HTML 日报生成
  7. 日报归档
  8. daily_report / report_runs 审计写入
  9. 失败时降级复制昨日报告并可选飞书告警

手工真实复跑

bash scripts/run_real_pipeline.sh

适用于联调、排障、上线后人工验证。该入口写入:

  • run_kind=manual
  • trigger_source=pipeline
  • is_official_daily=false

历史补跑

bash scripts/rebuild_historical_report.sh 2026-05-13

该入口写入:

  • run_kind=historical_rebuild
  • trigger_source=rebuild_script
  • is_official_daily=false

常用命令

go test ./...
bash scripts/test.sh
bash scripts/verify_pre_phase6.sh
bash scripts/verify_phase6.sh
bash healthcheck.sh
cd frontend && npm run test -- --run
cd frontend && npm run build

API 概览

  • GET /health
  • GET /api/v1/models
  • GET /api/v1/subscription-plans
  • GET /api/v1/reports/latest
  • GET /api/v1/reports/latest/markdown
  • GET /api/v1/reports/latest/html

完整字段与示例见 docs/API_REFERENCE.md

文档索引

生产上线最低门禁

建议把以下检查作为发布前硬门禁:

bash scripts/verify_pre_phase6.sh
bash scripts/verify_phase6.sh

上线后首轮冒烟建议至少覆盖:

curl -fsS http://127.0.0.1:8080/health
curl -fsS http://127.0.0.1:8080/api/v1/models
curl -fsS http://127.0.0.1:8080/api/v1/reports/latest
Description
LLM intelligence workspace and application project
Readme 1.7 MiB
Languages
Go 78%
Shell 15.7%
TypeScript 3.3%
PLpgSQL 1.2%
CSS 1%
Other 0.7%