mirror of
https://github.com/BaaRai/ARTEX.git
synced 2026-11-13 19:50:54 +08:00
The token metering is real now (input, output, cache read/write per profile), but it answers "how many tokens" while the question an operator actually asks is "what did this run cost". Converting requires per-profile prices, which nowhere exist. Changes: - llm_profiles gains four optional price columns (EUR per 1M tokens: input, output, cache read, cache write; 0/NULL = unset), migrated idempotently and round-tripped through SaveProfile / the profile API in one small auditable write - the usage aggregation computes cost_eur per profile from the stored prices, in Go after the archived-task merge so cold-storage tokens are priced identically; profiles without prices keep cost_eur nil instead of showing a fake zero - web types carry cost_eur and the price fields; the dashboard card and profile-dialog inputs consume them in a follow-up (the API serves the data already) - integration test: priced profile + usage rows -> expected EUR to the cent (2M in @1.5 + 0.5M out @4 + 1M cache-read @0.15 = 5.15), plus a prices round-trip check Note: the Go side activates on the next build; the schema migration is idempotent at startup.