Skip to content

Repository files navigation

Smart Tab Grouper (Edge extension + AI bridge)

Groups your open Edge tabs into meaningful, named groups using an LLM — the model reads your tab titles/URLs and clusters them by topic / project / task (e.g. it will put Google Flights and a ferry schedule together as "Travel", or a GitHub repo, a Learn doc, and a subreddit together as "Azure / Sentinel"). It is not a static domain-rules table.

How it works

Edge extension  --(your tabs)-->  local bridge (127.0.0.1:8770)  --(prompt)-->  LLM
       ^                                                                          |
       +-------------------- group assignments (titles/colors) <------------------+
  • ai_bridge.py runs locally and calls an LLM to do the clustering. By default it uses GitHub Models (openai/gpt-4o) authenticated with your existing gh auth token, so no API key is stored anywhere and the token never enters the extension.
  • The extension sends the tabs, receives {groups:[{title,color,tabIds}]}, and applies the groups via the Tab Groups API (extension-only, which is why this is an extension).
  • Your tabs (titles + URLs) are sent to the LLM endpoint to be clustered. With the default GitHub Models endpoint that's your own GitHub-authenticated inference. To keep everything on-box, point it at a local model (see "Other models").

Setup

1. Start the bridge

cd path\to\edge-tab-grouper   # the folder containing this README
.\start-bridge.ps1

Leave it running (it launches windowless via pythonw.exe — no console window appears). Re-run after a reboot. Requires python on PATH and gh logged in (gh auth status). To run it visibly for debugging: .\start-bridge.ps1 -Foreground.

2. Load the extension (one time)

  1. Open edge://extensions → enable Developer mode.
  2. Load unpacked → select this folder.
  3. Pin Smart Tab Grouper (puzzle-piece icon).

Use

  • Click the icon → AI group this window (or AI group all windows). The popup shows a live bridge: on/off indicator.
  • Or press Ctrl+Shift+G to AI-group the current window.
  • Collapse groups toggle is remembered.
  • Ungroup all (this window) clears grouping.
  • More ▸ Export tabs (JSON) copies all open tabs (title + URL) to the clipboard and downloads them as edge-tabs.json.
  • Re-running is safe: tabs move into the matching group; same-named groups are reused.

If the bridge is off, the More ▸ Offline grouping (no AI) button falls back to the local rules engine in rules.json, and Ctrl+Shift+G auto-falls-back too.

Other models / endpoints

The bridge reads these env vars (all optional):

Var Default Purpose
TABAI_ENDPOINT https://models.github.ai/inference/chat/completions Chat-completions URL
TABAI_MODEL openai/gpt-4o Default model id
TABAI_MODELS (curated list) Comma-separated model ids offered in the popup's picker
TABAI_TOKEN gh auth token Bearer token
TABAI_PORT 8770 Local port

Picking a model in the popup

The popup has a Model dropdown so you can experiment with different models without restarting the bridge. It's populated from the bridge's GET /models (the TABAI_MODELS list, plus the TABAI_MODEL default). Your choice is saved and sent per-request, so it also applies to the Ctrl+Shift+G shortcut. To offer your own set, e.g.:

$env:TABAI_MODELS = "openai/gpt-4o,openai/gpt-4o-mini,meta/Llama-3.3-70B-Instruct"

Examples:

  • Azure OpenAI: set TABAI_ENDPOINT to your deployment's chat-completions URL, TABAI_MODEL to the deployment name, TABAI_TOKEN to the key.
  • Local (Ollama/LM Studio, OpenAI-compatible): point TABAI_ENDPOINT at http://localhost:11434/v1/chat/completions, set TABAI_MODEL, TABAI_TOKEN=x. Keeps all tab data on your machine.

Files

File Role
ai_bridge.py Local HTTP bridge; calls the LLM and returns group assignments.
start-bridge.ps1 Launches the bridge windowless (pythonw.exe, no console) and health-checks it.
manifest.json MV3 manifest (perms: tabs, tabGroups, storage; host: 127.0.0.1:8770).
grouper.js Engine: AI path (aiGroup), offline rules path (smartGroup), apply/ungroup.
background.js Service worker — Ctrl+Shift+G (AI, with offline fallback).
popup.html / popup.js Toolbar UI.
rules.json Fallback only — offline domain/keyword rules when the bridge is off.

Notes / limits

  • Tab Groups can't span windows, so grouping happens per window.
  • The bridge must be running for AI mode; otherwise use offline mode.
  • Want the bridge to auto-start at login? Add start-bridge.ps1 to a Task Scheduler logon task — ask and I'll set it up.

License

MIT © Ofer Shezaf

About

One-click AI grouping of Edge tabs into meaningful named groups via a local LLM bridge, with an offline rules fallback.

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages