Practical overview
When it fits
Use Treescope when plain notebook printouts make nested model structures or multidimensional arrays difficult to inspect.
Who it is for
- Machine-learning researchers inspecting neural-network structures and parameters in notebooks
- Python developers working with JAX, NumPy, Penzai, Equinox, Flax NNX or PyTorch objects
- Developers who want to customize notebook renderings for application-specific data structures
Documented uses
- Expand and collapse parts of a nested model or data object to focus on relevant sections.
- Inspect tensor shapes and value distributions through embedded visualizations.
- Highlight shared neural-network structures with color coding and copy paths to object components.
- Set a rich renderer as the default for notebook output or render a specific object on demand.
Requirements & limits
The public GitHub repository identifies the project as open source under the Apache-2.0 license.
- The documented workflow targets IPython notebook output.
- Supported model libraries include Penzai, Equinox, Flax NNX and PyTorch; basic JAX and NumPy objects are also supported.
- Array visualizations can be enabled during setup, while specific objects can also be rendered with
treescope.show. - The README states that Treescope is not an officially supported Google product.
Check current requirements in the official documentation. Source-based guidance does not mean OpenViST has run or independently tested this project.
Set up interactive object rendering in an IPython notebook
Install Treescope and render an object with interactive notebook output.
Before you start
- Python environment with IPython notebook output
- pip
Steps
Install the package with the command below.
pip install treescopeImport it with
import treescope.Pass an object to
treescope.showin a notebook cell.
Expected outcome
The object is rendered as rich interactive output in the notebook.
Guide limitations
- This recipe covers rendering an object, not model training or deployment.
Enable default rendering and automatic array visualization
Configure Treescope as the notebook’s default pretty-printer and enable automatic array visualizations.
Before you start
- Treescope installed in the Python environment
- IPython notebook
Steps
Import Treescope with
import treescope.Call
treescope.basic_interactive_setup(autovisualize_arrays=True).
Expected outcome
Treescope is set up as the default pretty-printer with automatic array visualization enabled.
Guide limitations
- The documented setup is for IPython notebook rendering.
Sources & review
Source record details
- Source availability
- Active
- Sources checked
- 13 November 2026
- Original website title
- google-deepmind/treescope · Official homepage title · retained in its source language

