Skip to content
Home » Installing TokenShark
Table of Contents (Jump to Section) +

Installing TokenShark

TokenShark (github.com/sumit-1/tokenshark) is an open-source, pure-Python mechanistic interpretability workbench for inspecting, editing, and wiring open-weight models in the browser.


1. Quick Launch (run.bat / run.sh)

Clone the repository and run the launcher script. It automatically creates a .venv virtual environment, installs dependencies (torch>=2.2, safetensors, tokenizers, fastapi, uvicorn), and starts the workbench:

git clone https://github.com/sumit-1/tokenshark.git
cd tokenshark
.\run.bat
git clone https://github.com/sumit-1/tokenshark.git
cd tokenshark
chmod +x run.sh
./run.sh

2. Editable pip Installation

If you also want the tokenshark CLI, the Python API (from tokenshark.api import Lab), and the MCP server (python -m tokenshark.mcp_server):

git clone https://github.com/sumit-1/tokenshark.git
cd tokenshark
python -m venv .venv
# Windows: .venv\Scripts\activate  |  macOS/Linux: source .venv/bin/activate
pip install -e .
tokenshark --port 8080

3. Copy-Paste Prompt for AI Coding Agents (Cursor / Claude Code)

Paste this prompt into your AI coding assistant so it can install TokenShark and connect to its built-in MCP server:

Clone https://github.com/sumit-1/tokenshark, create a Python virtual environment (.venv), run `pip install -e .`, start the TokenShark server (`python -m tokenshark --port 8080 --no-browser`), and register `python -m tokenshark.mcp_server` in my MCP configuration so you can inspect and wire models directly.

Responses & Technical Discussion

Leave a Reply
Loading comments...