Visualization
CARL’s result and chain objects render themselves. Everything is text by
default — opt into PNG output with pip install 'mmar-carl[viz]'.
From a result
Section titled “From a result”result = chain.execute(context)
print(result.format_token_pie()) # "text" | "mermaid" | "png"print(result.format_prompt_completion_breakdown())print(result.format_profiling_table()) # per-step cost / latency / cacheprint(result.format_cost_by_model(pricing={"qwen/qwen3-8b": (0.00002, 0.00006)}))Also handy: result.token_usage_by_step, result.partial_outputs,
result.get_partial_final_output().
From a chain
Section titled “From a chain”print(chain.to_mermaid()) # the DAGprint(chain.to_mermaid_critical_path(result)) # highlight the critical pathprint(chain.to_mermaid_heatmap(result, metric="tokens")) # "tokens" | "latency" | "cost"ChainVisualizer — compose many views
Section titled “ChainVisualizer — compose many views”ChainVisualizer is a fluent facade that buffers several views into one output:
from mmar_carl import ChainVisualizer
ChainVisualizer(result, chain=chain).token_pie().gantt().heatmap(metric="tokens").print()It also accepts evolution_result= to fold in evolution charts.
Jupyter
Section titled “Jupyter”ReasoningResult, EvolutionResult, DatasetEvaluationReport, CostEstimate,
and ChainVisualizer all implement _repr_markdown_ — type the object bare in a
notebook cell and it renders a status banner + tables + Mermaid, no print().
See also
Section titled “See also”- Tracing & observability
- Cost estimation
- The chain DAG in MAESTRO CARE — the TUI renders this same DAG live as a coloured box-and-arrow graph, with an ASCII glyph mode for plain terminals.