Skip to main content

tmam

PyPI version License

OpenTelemetry-native auto-instrumentation library for monitoring LLM applications, enabling cost tracking, tracing, and observability for your GenAI projects.

Installation

pip install tmam

Quick Start

import tmam
from openai import OpenAI

# Initialize tmam — auto-instruments all supported LLM providers
tmam.init(
    environment="production",
    application_name="my-llm-app",
)

# Use OpenAI as normal — calls are automatically traced
client = OpenAI()
response = client.chat.completions.create(
    model="gpt-4o",
    messages=[{"role": "user", "content": "Hello, world!"}],
)
print(response.choices[0].message.content)
# Traces with token counts, latency, and cost appear in your tmam dashboard

Features

  • Auto-instrumentation for 40+ LLM providers (OpenAI, Anthropic, Cohere, Mistral, Bedrock, VertexAI, and more)
  • Tracing with @tmam.trace() decorator and tmam.start_trace() context manager
  • Metrics collection for token usage, cost, latency, and request volume
  • Evaluations with built-in evaluators for hallucination, bias, and toxicity detection
  • Experiments for running dataset-driven evaluations with concurrency control
  • Vault integration for secure secret retrieval
  • GPU monitoring for GPU utilization and memory tracking

Configuration

Environment Variable Description Default
OTEL_EXPORTER_OTLP_ENDPOINT tmam API endpoint https://api.tmam.ai
OTEL_EXPORTER_OTLP_HEADERS Headers including API key (x-api-key=pk_xxx.sk_xxx) —
Init Parameter Description Default
environment Deployment environment name 'default'
application_name Application name for grouping traces 'default'
otlp_endpoint Override OTLP endpoint env var
otlp_headers Override OTLP headers dict env var

Cost Allocation Tags

Track spending by team, department, or cost center using API key tags:

  1. Go to Settings > API Keys in the platform
  2. Add tags to your API key (e.g., team: engineering, department: ML)
  3. View cost breakdowns by tag in Cost Explorer

Guides

License

Apache 2.0 — see LICENSE for details.

Metadata

Release files for tmam 1.6.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 tmam 1.6.1
File Size Uploaded Provenance Actions
tmam-1.6.1.tar.gz 129.1 kB Without provenance Details for tmam-1.6.1.tar.gz

Built distribution (wheel)

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

Total release size: 394.3 kB

Release files / tmam-1.6.1.tar.gz

Download URL tmam-1.6.1.tar.gz
Size 129.1 kB
Tags Source
SHA-256 checksum
How to use checksums
929df7644077ccb60889b98a7425e8a76de751ccbdbdc48bbcb4d2c713020ec8
BLAKE2b-256 checksum
How to use checksums
b774d2b5e689252d5b4cbe1ca4c9782e0ee79b136fae5ec71582a6e586292b36
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.7

Release files / tmam-1.6.1-py3-none-any.whl

Download URL tmam-1.6.1-py3-none-any.whl
Size 265.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
ae987e6fd1cf1fcc22088accd8a6fbfffa97b08943635ece5aa184eb7f58731c
BLAKE2b-256 checksum
How to use checksums
48ad3ebf779e99ca1a0ae469d564b9b1730c369084ae9d689054df2d8347b8fc
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.7

Security for tmam 1.6.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.

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