mozilla/smart-tab-grouping

Code for tuning Smart Tab Grouping models for Firefox

21

stars

65

commits

Jupyter Notebook

primary language

Aug 10, 2026

updated

README

Smart Tab Grouping

Smart Tab grouping encompasses:

Suggesting a title for user created group of tabs

Suggesting tabs from current window to be added to the current group

Suggesting groups from current window [Currently out of Scope]

Basic Architecture

Smart Tab grouping uses standard embedding models for grouping, and a fine tuned model for text generation. Smart Tab Grouping Diagram

Notes on Diagram: All inference is in browser using the Firefox AI runtime and other local algorithms.

‘Distinct keywords’ are picked for inference using c-tf-idf algorithm, which finds relatively unique keywords in the title and description of the document with respect to the rest of the document.This helps distinguish what is unique about a group.

Clustering tests

For interactive tests

streamlit run tab_grouping_streamlit.py

For batch testing of clustering methods:

python utils/grouping_pipeline.py

Tab Group Collector add-on

A Firefox add-on for collecting reference data: it exports the tab groups a person has made, with their own names for them, as JSON. Useful for evaluating clustering and group naming against how people actually organise their tabs.

See addon/README.md.

Topic Name Data Generation Pipeline

Smart Tab Grouping Diagram

• Generate Archetypes and Synthetic Browsing History gen_annotation_data.py

• Preprocess Clusters as Client does tab_title_tuning_data.py

• Generate Labels

   tab_title_tuning_data.py

• Simplify Labels

   SimplifyMLTopics.ipynb

• Optional - Cluster Labels

   /analysis/Directed Training Clusters.ipynb

The clustering was used to generate some hints in the file 'topic_fine_tuning_data__01_05__grouped_with_hints.csv' The hints provide n-Shot examples to help direct the labels for certain categories in the Generate Labels step.

•Fine tune the model, distill, quantize and export ML model see src/jobs/Readme.md for details on this step

• Analyze Results of Topic Model /notebooks/Benchmarking.ipynb

Contributors

rolf-moz

46 commits

vazish

19 commits

mozilla/smart-tab-grouping

Code for tuning Smart Tab Grouping models for Firefox

21

stars

65

commits

Jupyter Notebook

primary language

Aug 10, 2026

updated

README

Smart Tab Grouping

Smart Tab grouping encompasses:

Suggesting a title for user created group of tabs

Suggesting tabs from current window to be added to the current group

Suggesting groups from current window [Currently out of Scope]

Basic Architecture

Smart Tab grouping uses standard embedding models for grouping, and a fine tuned model for text generation. Smart Tab Grouping Diagram

Notes on Diagram: All inference is in browser using the Firefox AI runtime and other local algorithms.

‘Distinct keywords’ are picked for inference using c-tf-idf algorithm, which finds relatively unique keywords in the title and description of the document with respect to the rest of the document.This helps distinguish what is unique about a group.

Clustering tests

For interactive tests

streamlit run tab_grouping_streamlit.py

For batch testing of clustering methods:

python utils/grouping_pipeline.py

Tab Group Collector add-on

A Firefox add-on for collecting reference data: it exports the tab groups a person has made, with their own names for them, as JSON. Useful for evaluating clustering and group naming against how people actually organise their tabs.

See addon/README.md.

Topic Name Data Generation Pipeline

Smart Tab Grouping Diagram

• Generate Archetypes and Synthetic Browsing History gen_annotation_data.py

• Preprocess Clusters as Client does tab_title_tuning_data.py

• Generate Labels

   tab_title_tuning_data.py

• Simplify Labels

   SimplifyMLTopics.ipynb

• Optional - Cluster Labels

   /analysis/Directed Training Clusters.ipynb

The clustering was used to generate some hints in the file 'topic_fine_tuning_data__01_05__grouped_with_hints.csv' The hints provide n-Shot examples to help direct the labels for certain categories in the Generate Labels step.

•Fine tune the model, distill, quantize and export ML model see src/jobs/Readme.md for details on this step

• Analyze Results of Topic Model /notebooks/Benchmarking.ipynb

Contributors

rolf-moz

46 commits

vazish

19 commits

Languages

Jupyter Notebook

82.7%

Python

16.4%