Show an estimated AI‑credit cost for the next message on the usage gauge
- Ngôn ngữ chính
- Không có dữ liệu ngôn ngữ
- Star
- 2.1k
- Fork
- 153
- Chỉ số merge pull request
- Không có pull request nào được merge trong 30 ngày
Mô tả
### Feature summary
_No response_
### What problem are you trying to solve?
Cost per turn varies depending on the selected model, the reasoning effort, how much context is loaded, and how the assistant is being run (e.g. a single interactive reply vs. a longer autonomous run). Today users only learn the cost *after* spending it, which makes it hard to make informed choices (switch to a cheaper model, lower reasoning effort, trim context, etc.) before sending.
### Proposed solution
Add a lightweight **"Next message" estimate**: a single, compact prediction of what the upcoming turn will roughly cost, learned only from the user's own recent usage (on‑device, no server calls or extra data collection). Changing the model, reasoning effort, or run mode should visibly move the number.
**UX**
- Visualized in a usage popover, e.g. **"Next message — ~X credits (est.)"**, on a single line alongside "Session" spend.
- Framing: it's an estimate of the *typical* next turn, not a guarantee.
**How the estimate is built**
1. **Learn a typical cost ("anchor") at several granularities.** Maintain a smoothed, geometric (log‑space) moving average of realized per‑turn cost so a few unusually large or small turns don't dominate. Track and blend it at a few levels:
- **Per‑configuration** — keyed by the cost‑relevant choices the user controls: model, reasoning effort, context size tier, and run mode. This is what makes the estimate react when the user switches any of those.
- **Per‑session** — captures the "weight" of the current conversation (a heavy session tends to keep being heavy), ramped in as the session accumulates turns.
- **Global** — a cross‑session fallback used before a given configuration has any history.
2. **Cold start.** Before any history exists, fall back to a context‑proportional approach.
3. **Self‑calibrate.** After each turn, compare what actually happened to what was predicted and fold the realized cost back into the averages, so the estimate improves over time and adapts to the user's habits.
### Workflow impact
_No response_
### Installation context
_No response_
### Additional context
_No response_
Hướng dẫn đóng góp
Hướng nghiên cứu
Bắt đầu bằng cách xác định popover về mức sử dụng và dữ liệu chi phí hiện có theo từng lượt. Theo dõi cách mô hình, mức độ suy luận, ngữ cảnh và chế độ chạy được biểu diễn, sau đó xác định nơi có thể đọc và cập nhật lịch sử sử dụng của phiên cũng như lịch sử sử dụng toàn cục. Hoàn thành có nghĩa là popover hiển thị một ước tính cho tin nhắn tiếp theo với khung rõ ràng, phản hồi theo các lựa chọn đó và được hiệu chỉnh từ các lượt sau mà không cần gọi máy chủ.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Đánh giá
- Lĩnh vực
- ai, desktop
- Loại issue
- Tính năng
- Độ khó
- 5/5
- Thời gian dự kiến
- Hơn một tuần
- Mức độ hoạt động
- Ít trao đổi
- Độ rõ ràng
- Khá rõ ràng
- Mức phù hợp với người mới
- 38/100