pip install tokenpak
Verify the install:
tokenpak --help
pip install "tokenpak[tokens]"
This installs tiktoken for exact token counts instead of estimates.
pip install "tokenpak[dev]"
Includes pytest and testing tools.
git clone https://github.com/kaywhy331/tokenpak.git
cd tokenpak
pip install -e .
For development:
pip install -e ".[dev]"
If you want the CLI globally without polluting your Python environment:
pipx install tokenpak
pip install --upgrade tokenpak
# Check version
tokenpak --version
# Start the proxy
tokenpak serve --port 8766
# View CLI help
tokenpak --help
pip uninstall tokenpak
tokenpak: command not foundMake sure your Python scripts directory is on your PATH. With pip, scripts go to:
~/.local/bin/ — add to PATH in ~/.bashrc or ~/.zshrc%APPDATA%\Python\Scripts\ — add to PATH in System settingsWith pipx, it handles this automatically.
TokenPak requires Python 3.10+. Check your version:
python --version
Use python3.10, python3.11, or python3.12 explicitly if needed.
tokenpak serve --port 8767
Or kill the existing process:
lsof -ti:8766 | xargs kill -9
See TROUBLESHOOTING.md for more detailed diagnostics.