FN-6876: add editable model pricing refresh
Add editable model pricing overrides and a LiteLLM refresh path for usage cost analytics.
- Add persisted model pricing override settings and apply them to token and team analytics cost calculations.
- Add a Command Center pricing fetch endpoint that imports chat pricing from LiteLLM and invalidates settings caches.
- Add a Global Models pricing editor with manual rows, removal, and one-click fetch support.
- Cover override lookup, settings parity, analytics, route behavior, and UI editing with tests and docs.
Files changed:
.changeset/model-pricing-overrides.md | 5 +
docs/architecture.md | 3 +-
docs/dashboard-guide.md | 5 +-
docs/settings-reference.md | 3 +
packages/core/src/__tests__/model-pricing.test.ts | 101 +++++++++++
.../core/src/__tests__/settings-parity.test.ts | 4 +
packages/core/src/__tests__/store-settings.test.ts | 25 +++
.../core/src/__tests__/token-analytics.test.ts | 39 +++++
packages/core/src/index.ts | 4 +
packages/core/src/model-pricing.ts | 118 +++++++++++--
packages/core/src/settings-schema.ts | 3 +
packages/core/src/team-analytics.ts | 17 +-
packages/core/src/token-analytics.ts | 19 +-
packages/core/src/types.ts | 12 ++
.../dashboard/app/components/SettingsModal.tsx | 2 +
.../settings/sections/GlobalModelsSection.tsx | 8 +-
.../settings/sections/ModelPricingSection.css | 82 +++++++++
.../settings/sections/ModelPricingSection.test.tsx | 126 ++++++++++++++
.../settings/sections/ModelPricingSection.tsx | 193 +++++++++++++++++++++
.../register-command-center-routes.test.ts | 172 +++++++++++++++++-
.../src/routes/register-command-center-routes.ts | 58 +++++++
21 files changed, 967 insertions(+), 32 deletions(-)
Fusion-Task-Id: FN-6876
Fusion-Task-Lineage: 4d4e3b9d-bec4-4e14-b7bc-88f846465566