Linklbee scanner
Find where your LLM API bill leaks. The scanner reads your LLM call log on your own machine and writes a one-page report of where token spend goes: prompts too short for the vendor's cache, the cache hit rate, prefixes repeated across calls, identical calls resent seconds apart, and failed or cut-off calls that were still billed. If your service writes new versions of the same documents, it also shows how much output could be saved by rewriting only the parts that changed.
If the log lacks a field an item needs, the report does not guess. It names the field that would show the item. Every number comes from the log you give it.
Install and run
pip install linklbee-scan
linklbee-scan <log file or folder> --lang en --out report.html
linklbee-scan --demo --lang en # see a report on a [synthetic] example log first
Python 3.9+, no dependencies. Reports are in Korean by default; --lang en gives English. Run it with no arguments and it looks in the current folder for something to read.
Without pip, the whole tool is one file: download linklbee_scan.py and run python3 linklbee_scan.py with the same arguments.
Not sure how your log will be read? --peek reads the first 200 records, prints which field comes from where, and writes nothing:
linklbee-scan calls.jsonl --peek --lang en
Log formats it reads
No conversion needed. JSONL, JSON arrays, CSV/TSV, .log and .gz files are read as they are; a folder is read file by file.
| Format | |
|---|---|
| OpenAI · Anthropic | raw SDK responses (Chat Completions · Responses · Messages · Batch) |
| CSV · TSV · JSON array | header row = field names / one element = one call |
| Langfuse | observation export |
| LangSmith | run export |
| Helicone | request record |
| LiteLLM | spend log |
| Amazon Bedrock | model invocation log · Converse response |
| Google Vertex AI · Gemini API | raw responses |
| Azure OpenAI | Chat Completions log |
Any other shape: map fields in one line, no script — --map ts=created output=data.body.text output_tokens=meta.usage.out.
No call log, only the vendor's usage or cost file? Pass it as downloaded. It reads the OpenAI Usage and Costs APIs, OpenAI console usage and cost CSVs, the Anthropic usage report (Admin API), the Anthropic console cost CSV, the AWS Cost and Usage Report, Azure cost details, Fireworks usage and the Together cost CSV. You get spend by model, input vs output, cache reads and busy hours.
A developer using Claude Code can try it on this machine's own records: linklbee-scan --claude-code --lang en.
What the report finds
- Output's share of the bill — from
modeland token counts alone - How much of the output could be saved by editing the previous answer instead of writing it again
- Calls that could be answered without a model call
- Failed calls that were billed
- Identical calls resent within seconds
- Answers cut off at the length limit
- Tool definitions and system text serialized inconsistently, which breaks the prompt cache
- Prompts under the vendor's cache minimum
- A billing check: billed output tokens against the answer text's own token count
- Cache hit rate
- Prefixes shared across calls that could be cached
- Calls that could use OpenAI Flex
Each item is reported as found, none, or needs more data — with the field that would show it.
No log file yet?
Add these lines right after each call (OpenAI SDK; for Anthropic use resp.content[0].text, u.input_tokens, u.output_tokens). Once calls build up, run the scanner on calls.jsonl.
import json, time
def log_call(resp, path="calls.jsonl"): # resp = what client.chat.completions.create(...) returned
u = resp.usage
with open(path, "a", encoding="utf-8") as f:
f.write(json.dumps({"ts": time.time(), "output": resp.choices[0].message.content, "model": resp.model, "input_tokens": u.prompt_tokens, "output_tokens": u.completion_tokens}, ensure_ascii=False) + "\n")
TypeScript (Node, OpenAI SDK):
import { appendFileSync } from "node:fs";
export function logCall(resp: any, path = "calls.jsonl") { // resp = await client.chat.completions.create(...)
const u = resp.usage ?? {};
appendFileSync(path, JSON.stringify({ ts: Date.now() / 1000, output: resp.choices[0].message.content, model: resp.model, input_tokens: u.prompt_tokens, output_tokens: u.completion_tokens }) + "\n");
}
Privacy
- No network code. No AI calls, no telemetry. Check it:
grep -cE "ht[t]p|sock[e]t|url[l]ib" linklbee_scan.pyprints0. - Standard library only. One file, nothing else to install or trust.
- Your log never leaves your machine. Answer text is read in memory only; the report holds counts, shares and dollars — no prompts, no answers, no document keys.
License
MIT (LICENSE), published by NOTEGG Corp. Copyright (c) 2026 NOTEGG. The embedded o200k token table is under tiktoken's MIT license (THIRD_PARTY_NOTICES).
Full documentation — every field, --flat, --hashify, how to read the report, and its limits — is in README.ko.md (Korean, with the full English reference at the end under "English").
Metadata
Release files for linklbee-scan 1.4.4
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| linklbee_scan-1.4.4.tar.gz | 1.9 MB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| linklbee_scan-1.4.4-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 3.9 MB
Release files / linklbee_scan-1.4.4.tar.gz
| Download URL | linklbee_scan-1.4.4.tar.gz |
|---|---|
| Size | 1.9 MB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
d040b3f75924d4522f236f226dfb66cea4800c6c3216a7001216e53c3fc79da3
|
|
BLAKE2b-256 checksum How to use checksums |
f6739a447eb34c3a566f8cc5704de3b65f58365f8c1941e49b964abff01c1cd0
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.14.7
|
Release files / linklbee_scan-1.4.4-py3-none-any.whl
| Download URL | linklbee_scan-1.4.4-py3-none-any.whl |
|---|---|
| Size | 1.9 MB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
19c762a4daa3c1483482c17924ebd9fa80a1aae308c33eca0d09bdd69049c317
|
|
BLAKE2b-256 checksum How to use checksums |
806ae356caa26fcfe8aabdc66e1726464f501ab9135543b6292f1eaea681ae44
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.14.7
|
Security for linklbee-scan 1.4.4
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.