LangSmith and Langfuse allow ranking on cost per step, but as dashboard widgets aggregating data over many runs over a period of time. Helicone allows doing so if you label your call and have to write your own SQL queries. Phoenix provides cost per span and per project but no middle ground. So if you need to know what made this particular run cost the way it costs, you will still need to read the trace tree manually. None of them detect repeated contexts in subsequent steps, which, in my experiments, is the higher figure. limitations because you will discover them anyway:
Repeat detection works with exact matching and prefix sharing. Mismatched strings in between aren't detected. The token counts in repeat detection are len(text) // 4, not true tokenization. Marked as such in the output. Two model price examples are hard coded. All other input produces n/a instead of guessing. This was tested on the included fixtures and one live trace run, the three node LangGraph case. The outputs of Phoenix, Langfuse, CrewAI, and AutoGen have not been processed by it yet.
rrkher059•54m ago
Requires Python 3.10+ and no dependencies. The repository comes with a sample trace for testing purposes.