Skip to main content

skimp

Skimp on tokens, not on quality.

skimp is a local, privacy-first Python CLI that profiles OpenTelemetry (gen_ai.*) and MLflow AI agent traces to diagnose structural token waste and project monthly dollar burn.

Unlike passive observability dashboards that only show what you spent, skimp is prescriptive: it flags why tokens are being wasted and estimates how much money you can save.


Why skimp?

  • 100% Privacy-First by Default: All core detectors run strictly on span metadata (token counts, model names, durations, span hierarchy, status codes). Prompt/message payloads (gen_ai.input.messages, gen_ai.output.messages, mlflow.spanInputs, etc.) are stripped at ingest by default.
  • Multi-Dialect Telemetry: Parses standard OTLP JSON (resourceSpans), OTLP NDJSON, opentelemetry-sdk flat exports, OpenLLMetry/OpenInference, and MLflow trace JSON exports.
  • 4 Prescriptive Waste Detectors:
    1. Context Snowballing — Flags multi-turn chat sequences with runaway/quadratic input_tokens growth.
    2. Retry & Tool Thrashing — Flags repeated execute_tool loops and repeated failed (ERROR) spans, attributing nested LLM retry costs.
    3. Model Overkill — Flags short, low-output-token spans (routing, classification, extraction) running on expensive frontier models.
    4. Broken Prompt Caching — Flags repeated large-input spans with zero cached tokens on cache-capable models.
  • Configurable for All Models (Current & Future): Override built-in rates or define any future/custom model ID in skimp.toml, [tool.skimp] in pyproject.toml, or ~/.config/skimp/config.toml.

Installation

Requires Python 3.11+.

# With uv (recommended)
uv tool install skimp

# Or with pip
pip install skimp

For local development:

git clone https://github.com/rajsinghparihar/skimp.git
cd skimp
uv sync

Quickstart

Generate a realistic, noisy sample OTel trace with baked-in structural waste patterns:

uv run skimp generate-sample --out sample_trace.json

Analyze the trace, project monthly spend at 1,000 runs/day, and export a self-contained HTML audit report:

uv run skimp analyze sample_trace.json --daily-runs 1000 --html report.html

Custom Model Pricing (skimp.toml)

skimp ships with reference per-1M token pricing for OpenAI, Anthropic, Google Gemini, and common open models, and automatically strips provider prefixes (openai/, anthropic/, bedrock/, models/) and dated snapshot suffixes (gpt-4o-2024-11-20).

To configure custom or future models, add a skimp.toml file (or [tool.skimp] in pyproject.toml):

daily_runs = 2500

[models."claude-opus-5-preview"]
input_per_1m = 12.00
output_per_1m = 60.00
cached_input_per_1m = 1.20
tier = "frontier"
provider = "anthropic"

[models."my-finetuned-router"]
input_per_1m = 0.15
output_per_1m = 0.45
tier = "mini"

Pass an explicit config file at runtime with --config path/to/skimp.toml.


Development

uv run pytest -v
uv run ruff check .
uv build

License

Apache-2.0 — see LICENSE.

Metadata

Release files for skimp 0.1.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for skimp 0.1.1
File Size Uploaded Provenance Actions
skimp-0.1.1.tar.gz 329.3 kB Without provenance Details for skimp-0.1.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for skimp 0.1.1
File Interpreter ABI Platform Actions
skimp-0.1.1-py3-none-any.whl Python 3 none any Details for skimp-0.1.1-py3-none-any.whl

Total release size: 365.1 kB

Release files / skimp-0.1.1.tar.gz

Download URL skimp-0.1.1.tar.gz
Size 329.3 kB
Tags Source
SHA-256 checksum
How to use checksums
a4c4459d815d843d8f8783963e7ac4571939a21f955edaf75d96c529cae6c67b
BLAKE2b-256 checksum
How to use checksums
16afd2574616ff3933bd0d9601c9969540e83916c26c95eeb6b572ac07f62dac
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.13.10 {"installer":{"name":"uv","version":"0.13.10","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / skimp-0.1.1-py3-none-any.whl

Download URL skimp-0.1.1-py3-none-any.whl
Size 35.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
1948a92eff161b6361ff7fa448004e0da06fc19d302eaf1b51c59443b1110b39
BLAKE2b-256 checksum
How to use checksums
95e1aa81f418fe218f2d3f97977221db49c1d5a6f85a7a198105fb5fad9d3ff1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.13.10 {"installer":{"name":"uv","version":"0.13.10","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Security for skimp 0.1.1

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.

Release history Release notifications | RSS feed

This release

0.1.1 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page