#104104th of 105 in ML frameworks and libraries

bertviz

Interactive attention visualizer for Transformer models in Jupyter and Colab

Stars
8.2k
License
Apache-2.0
Last commit
Jan 2026
Last release
Jun 2025
Language
Python
Stars, last 29 weeks+265
1 Apr 2026: 7,937 stars8 Apr 2026: 7,947 stars15 Apr 2026: 7,970 stars22 Apr 2026: 7,984 stars29 Apr 2026: 7,997 stars6 May 2026: 8,009 stars13 May 2026: 8,021 stars20 May 2026: 8,032 stars27 May 2026: 8,038 stars3 Jun 2026: 8,044 stars10 Jun 2026: 8,057 stars17 Jun 2026: 8,065 stars24 Jun 2026: 8,073 stars1 Jul 2026: 8,083 stars8 Jul 2026: 8,094 stars15 Jul 2026: 8,102 stars22 Jul 2026: 8,115 stars29 Jul 2026: 8,120 stars5 Aug 2026: 8,130 stars12 Aug 2026: 8,137 stars19 Aug 2026: 8,142 stars26 Aug 2026: 8,148 stars2 Sept 2026: 8,157 stars9 Sept 2026: 8,167 stars16 Sept 2026: 8,175 stars23 Sept 2026: 8,182 stars30 Sept 2026: 8,188 stars7 Oct 2026: 8,194 stars14 Oct 2026: 8,199 stars21 Oct 2026: 8,202 stars

7,937 on 1 Apr 20268,202 on 21 Oct 2026

From GitHub's daily star counts.

Checked on GitHub.

Overview

BertViz renders attention weights from Hugging Face Transformer models inside Jupyter or Colab notebooks through a Python API. It offers a head view, a model view across all layers and heads, and a neuron view of query/key vectors. Encoder-decoder models are supported in the head and model views.

Who it is for: ML researchers and engineers inspecting attention in Transformer models

Strengths

  • Three views: per-layer head view, all-layer model view, and neuron view of query/key vectors
  • Works with most Hugging Face models that return attention via output_attentions=True
  • Handles encoder, decoder and cross attention for models such as BART and MarianMT
  • Can export visualizations as standalone HTML via html_action='return'

Weaknesses

  • Designed for short inputs; slow on long text or large models
  • Neuron view only works with bundled custom BERT, GPT-2 and RoBERTa
  • Needs a notebook environment; Colab can disconnect on long inputs
  • Attention weights are not necessarily an explanation of predictions, per the README

What it needs

  • GPU optional
  • Needs Jupyter, ipywidgets, Hugging Face transformers
  • Models: Hugging Face Transformers, BERT, GPT-2, RoBERTa, BART

Also in ML frameworks and libraries

See all 105
Also in ML frameworks and libraries
RankProjectScore
1transformersPython library defining open models for text, vision, audio and multimodal tasks168k starsApache-2.094 out of 100
2pytorchPython tensor library with GPU support and tape-based autograd for deep learning105k starscustom license94 out of 100
3ultralyticsPython library and CLI for training and running YOLO vision models62.7k starsAGPL-3.093 out of 100
#4pytorch-image-modelsPyTorch library of image models, pretrained weights and reference training scripts37.2k starsApache-2.092 out of 100
#5supervisionPython toolkit for loading, annotating and counting computer vision detections Live demo ↗ (opens in a new tab)51.3k starsMIT91 out of 100