Skip to main content

AI Margin Intelligence — Python SDK + optional CLI/backend. One-line init() that fails open.

Project description

valuemaxx (Python SDK)

Know what each AI agent actually costs you — correctly — and what it earned, per outcome, with confidence.

The Python SDK for valuemaxxAI margin intelligence for teams that build AI agents. One line captures the correct cost of every LLM call (off the hot path, never throwing into your app), so valuemaxx can bind it to the business outcome each agent run produced.

Install

pip install valuemaxx

Use

import valuemaxx

valuemaxx.init()   # zero-code cost capture starts here

That's it. init() instruments the openai / anthropic clients (and frameworks that use them — LangChain, LlamaIndex, CrewAI) at the transport layer, capturing correct token/cost per call: streaming usage taken from terminal values (never delta-summed), cache token classes priced separately, retries counted. It fails open — internal errors are caught and logged, never propagated into your call path, and it adds <1ms.

Attribute a run to an outcome

Wrap a unit of work so its cost can later be tied to a business outcome:

with valuemaxx.run(customer_id=user.id):
    response = client.messages.create(...)   # cost captured AND tagged to this run

The entity IDs you pass are the natural keys valuemaxx uses to bind delayed/out-of-process outcomes (a deal closing days later, a ticket resolving) back to the run that caused them — with an honest confidence label on every link.

What's captured (and what isn't)

  • Captured: model, token counts (input / cache-read / cache-write / output / reasoning), computed cost with provenance (measured → reconciled to the provider invoice later), latency, the run context.
  • Off by default: prompt/response content (PII-sensitive). Enable it only for the eval/replay features, on self-hosted deployments.

The honesty model

Every number valuemaxx produces carries its trustworthiness — cost provenance (measured/estimated/allocated/provider_reconciled), and once joined to outcomes, a binding tier and signal class. A rollup always shows the least-trusted of its parts; estimates never render as billed.

Self-hosting

The SDK ships telemetry over OTLP/HTTP to a valuemaxx backend you run (a container + Postgres; SQLite for local dev). The SDK itself holds nothing and needs no database. See the main repo for the backend, the TypeScript SDK (npm i valuemaxx), and the onboarding flow that wires outcomes for you.

License

Apache-2.0

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

valuemaxx-0.1.0-py3-none-any.whl (326.8 kB view details)

Uploaded Python 3

File details

Details for the file valuemaxx-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: valuemaxx-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 326.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for valuemaxx-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 4f6e7ae6f47c36fb7c26b5ca175d6382dd72b6e34dd6c64a89887843d9aeb426
MD5 51497f188b31d8520ba5cd64aa5eaa20
BLAKE2b-256 aa12d3d8dc1edc520ae6dc047b927451445209e90aada1ca6c0b4b8084520f14

See more details on using hashes here.

Provenance

The following attestation bundles were made for valuemaxx-0.1.0-py3-none-any.whl:

Publisher: release.yml on monaal10/valuemaxx

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page