feat: add GenesysCX study and fix Streamlit chart key collisions

- Add 202512_GenesysCX TEI study (config, seed data, notebooks, README)
  with NPV $10.8M / ROI 266% including AI-token cost line
- Add explicit `key` parameter to all chart wrappers in app/components
  to prevent StreamlitDuplicateElementId errors when the same figure
  type renders across Summary/Benefits/Costs tabs
- Render benefits bar and cost pie charts on their respective tabs
- Add benefits_vs_costs_by_year chart wrapper
This commit is contained in:
2026-06-10 14:26:49 -04:00
parent ecd164ee6d
commit 64fb83257d
34 changed files with 12902 additions and 39 deletions

View File

@@ -0,0 +1,82 @@
# CTM Token Calculator
**Genesys AI Token Cost & Business Case Calculator** — interactive,
defensible modeling of Genesys Cloud **CX 3** platform + AI feature costs
against realistic benefit scenarios, replacing single-point vendor ROI
outputs with sensitivity-aware **Floor / Realistic / Stretch** analysis.
> ⚠️ **Planning tool.** Uses published Genesys list rates unless overridden —
> explicitly not a replacement for contractual pricing. No Genesys API
> integration; this is a forward-looking model, not a production-consumption
> dashboard.
## CTM context
- 9 sites (NAM, EMEA, AUZ, 6× APAC), **2,088 contracted named users**
- NAM volumes from CTM discovery; **all other site data is estimated —
confirm with CTM** (flagged throughout the UI)
- Cost takeouts include the NICE IEX (NAM) retirement placeholder ($1.3M/yr,
estimated)
- Every meter carries a confidence flag: 🟢 confirmed (published rate) ·
🟡 estimated · 🔴 unknown (working default, rate not yet sourced)
## Install & run
```bash
cd ctm-token-calculator
python -m venv .venv && source .venv/bin/activate
pip install -r requirements.txt
# Streamlit app (7 pages: Inputs → Export)
streamlit run app/streamlit_app.py
# JupyterLab notebook variant (same numbers, same library)
jupyter lab notebooks/ctm_token_calculator.ipynb
# Tests
pytest
```
## Architecture
All math lives in the pure-Python `tokencalc/` library; the notebook and
Streamlit app are thin presentation layers calling the same functions —
Run-All in the notebook produces identical headline numbers to the app on
default inputs.
| Module | Purpose |
|---|---|
| `meters.py` | Token meter + pricing dataclasses, confidence enum |
| `defaults.py` | Genesys meter catalogue, CTM sites/takeouts/phasing, CX 3 rate ($111.28/user/mo) |
| `inputs.py` | Validated input dataclasses (sites, feature scopes, takeouts) |
| `scenarios.py` | Floor/Realistic/Stretch + benefit params (Genesys claim vs pressure-tested) |
| `cost_model.py` | Platform, per-user AI, consumption AI cost engines |
| `benefit_model.py` | AHT/ACW/email/deflection/STA benefit engines |
| `business_case.py` | 3-year P&L, NPV @ 8%, payback, ROI |
| `exports.py` | Multi-sheet Excel, CSV, JSON scenario save/load |
### Correctness rules encoded in the model
1. **Agent Copilot covers Supervisor AI Summary** — AI Summary & Insights is
never billed at sites where Copilot is enabled (Copilot's 40 tokens/user/mo
includes summarization). Implemented and tested.
2. **Billing-style rounding** — monthly consumption token totals are rounded
up (`ceil`) per site before pricing; per-user totals are exact.
3. **Regional pricing** — every site resolves its token rate through its
pricing region (US/EU/AU/APAC); nothing is hardcoded to US.
4. **Adoption ramp** — consumption features ramp (default Y1 = 70%); per-user
licences are paid in full from their phase year. Phasing is per-site,
per-feature, per-phase (1/2/3/off).
### Verified reference numbers
- STA: 2,088 users × 30 tokens × 12 × $1 = **$751,680** ✓ (test)
- Agent Copilot: 2,088 × 40 × 12 × $1 = **$1,002,240** ✓ (test)
- NPV hand-check: 100/yr × 3 @ 8% = 257.710 ✓ (test)
## Auditability
Every number traces to an input and a meter: cost rows carry the feature,
scope (sites), and confidence; benefit rows carry the driver line and scope;
the Excel export includes input, meter, cost-detail, benefit-detail, business
case, and three-scenario comparison sheets.