Universal AI CLI Proxy, Firewall, and Token Intelligence Gateway
Project description
👁️⚡ LLM Heimdall
Heimdall is the all-seeing Guardian of your API limits. It stands at the gate of your terminal, inspecting every single token trying to cross the bridge to OpenAI, Anthropic, or Google. If a developer unknowingly executes a wildly unoptimized prompt that blows your daily enterprise budget, Heimdall physically slams the gate shut and blocks the network execution.
Heimdall is a local, privacy-first Universal Token Intelligence Gateway. It seamlessly wraps your favorite AI CLIs (claude, gemini, cursor, openai) to act as an interceptor, cache-engine, and cost-firewall.
🔥 Why Run Heimdall?
- 🛡️ Enterprise Budget Firewall: Set a hard daily budget (e.g.
heimdall config 5.00). If a command costs $5.01, Heimdall aborts the execution before a single penny reaches the cloud. - 🧠 Semantic Prompt Caching: Why pay the LLM for the exact same prompt twice? Heimdall intercepts your prompts locally, hashes them, and returns $0.00 cached hits instantly.
- ⚡ Pre-Flight Compression: If Heimdall detects massive files being uploaded to your terminal prompt, it pauses to automatically compress and optimize the text.
- 📊 The God-Mode Dashboard: Visualize every penny your machine is spending on tokens broken down by Git Repository (Automatic Project Attribution).
⚡ Installation & Quick Start
Heimdall is deployed via PyPI. Because it is a standalone CLI application, we strongly recommend using pipx to install it globally without breaking your system's Python packages (avoids PEP 668 errors).
# Recommended global installation
pipx install llm-cli-token-heimdall
(If you know what you are doing and want to install it manually in a specific virtual environment, you can use pip install llm-cli-token-heimdall)
Install the Magic Shell Guard
Don't worry about remembering heimdall run. Our installer binds Heimdall directly into your terminal automatically.
heimdall init
heimdall install-aliases
source ~/.zshrc
Now, when you type claude "Refactor this module" or gemini "Explain gravity", the all-seeing Heimdall silently steps in to analyze your payload!
💻 Guard Commands
heimdall run <tool> <args>- Intercept and track an AI command manually.heimdall dashboard- Launch the central Token UI.heimdall config <limit>- Set your absolute daily dollar firewall limit.heimdall export report.csv --days 30- Data dump your analytics for management.heimdall update-pricing- Fetch the latest live pricing APIs for accurate cost tracking.
🔌 Expanding with Universal Adapters
Heimdall ships out of the box with auto-detected tracking for:
- 📝 Anthropic CLI (
claude) - 🤖 OpenAI / Codex CLIs (
gpt,codex,openai) - 🔮 Google Gemini CLI (
gemini) - ...and falls back to robust file-size estimation heuristics for literally any other tool.
Check the Plugin Development Guide to add Heimdall tracking to your proprietary internal enterprise CLIs.
License
This project is licensed under the MIT License - see the LICENSE file for details.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file llm_cli_token_heimdall-0.1.1.tar.gz.
File metadata
- Download URL: llm_cli_token_heimdall-0.1.1.tar.gz
- Upload date:
- Size: 20.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
dcc61cec133216183bcedd3e0146ce4fb6a6109e636b35d45f0d819eef9635b3
|
|
| MD5 |
7954acdcf0e91ebe54b0bb6f18087e6d
|
|
| BLAKE2b-256 |
ba5cbcede3aa9143cc8efac565b38e600347403aafff025c17bfd90f09ba0d7c
|
File details
Details for the file llm_cli_token_heimdall-0.1.1-py3-none-any.whl.
File metadata
- Download URL: llm_cli_token_heimdall-0.1.1-py3-none-any.whl
- Upload date:
- Size: 28.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
865285d0d7eed599e652c11ac50d15e00dfec5a8e4b937da3f48afa70ee4cdab
|
|
| MD5 |
ef6ae05bd7ce77f427d99b2882d315df
|
|
| BLAKE2b-256 |
85814f5d36321406230da27962d43443865e5a2c9db44d0b4db1379633f15c4c
|