Skip to main content

OpenTelemetry-native Auto instrumentation library for monitoring LLM Applications and GPUs, facilitating the integration of observability into your GenAI-driven projects

Project description

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.

Project details


Download files

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

Source Distribution

tmam-1.6.1.tar.gz (129.1 kB view details)

Uploaded Source

Built Distribution

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

tmam-1.6.1-py3-none-any.whl (265.2 kB view details)

Uploaded Python 3

File details

Details for the file tmam-1.6.1.tar.gz.

File metadata

  • Download URL: tmam-1.6.1.tar.gz
  • Upload date:
  • Size: 129.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.7

File hashes

Hashes for tmam-1.6.1.tar.gz
Algorithm Hash digest
SHA256 929df7644077ccb60889b98a7425e8a76de751ccbdbdc48bbcb4d2c713020ec8
MD5 4546267b6077918579316b1dd9480001
BLAKE2b-256 b774d2b5e689252d5b4cbe1ca4c9782e0ee79b136fae5ec71582a6e586292b36

See more details on using hashes here.

File details

Details for the file tmam-1.6.1-py3-none-any.whl.

File metadata

  • Download URL: tmam-1.6.1-py3-none-any.whl
  • Upload date:
  • Size: 265.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.7

File hashes

Hashes for tmam-1.6.1-py3-none-any.whl
Algorithm Hash digest
SHA256 ae987e6fd1cf1fcc22088accd8a6fbfffa97b08943635ece5aa184eb7f58731c
MD5 3217afb01c305b32e732c1af3d5ede7f
BLAKE2b-256 48ad3ebf779e99ca1a0ae469d564b9b1730c369084ae9d689054df2d8347b8fc

See more details on using hashes here.

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