Skip to main content

GenAI Monitor

Observability for Generative AI

Overview

GenAI Monitor provides robust observability tools for Generative AI applications with zero additional effort. Simply import the library, and it automatically monitors, tracks, and analyzes your AI model's inputs, outputs, and performance in production environments - no code changes required to your existing AI workflows.

The library seamlessly integrates with popular AI frameworks and automatically captures model calls, stores responses for later retrieval without requiring you to modify your application code.

Features

  • Implicit Observability for Popular Frameworks: Works out-of-the-box with most popular frameworks and providers without any code changes: Transformers, Diffusers, OpenAI, LiteLLM

  • Persistent Data Storage & Retrieval: Store model inputs and outputs so identical calls can be retrieved from the database without re-running expensive and time consuming model inference.

  • Custom Function & Method Registration: Easily extend monitoring to any GenAI tool. The flexible registration system allows you to monitor any Python function or method with minimal configuration.

  • Artifact Tracking: Attach metadata and artifacts to model calls for comprehensive traceability.

  • Modular Installation: Install only what you need to keep your dependencies lean.

Installation

To start tracking your GenAI models, install the genai-monitor package:

pip install genai-monitor

Install with support for specific frameworks:

# HuggingFace Transformers
pip install genai-monitor[transformers]

# Diffusers
pip install genai-monitor[diffusers]

# OpenAI
pip install genai-monitor[openai]

# LiteLLM
pip install genai-monitor[litellm]

Quick Start

GenAI Monitor automatically intercepts calls to supported frameworks. When you make the second API call with identical parameters, GenAI Monitor retrieves the cached response directly from the database instead of sending another request to OpenAI - saving time, reducing costs, and decreasing latency. This all happens transparently without any changes to your application code - simply import the library and it works!

import os

# Import genai_monitor.auto to automatically enable monitoring
# for supported frameworks with zero code changes
import genai_monitor.auto
from openai import OpenAI

api_key = os.getenv("OPENAI_API_KEY")
client = OpenAI(api_key=api_key)
question = "What if the meaning of life is to be happy? Answer in single sentence."

# First API call - This request is sent to OpenAI and the result is stored in the database
response = client.chat.completions.create(
    messages=[{"role": "user", "content": question}],
    model="gpt-4o-mini-2024-07-18",
    max_tokens=40,
    temperature=0.4,
)
print(response.choices[0].message.content)

# Second API call with identical parameters -
# NO request is sent to OpenAI! Instead, the result is retrieved from the local database
response = client.chat.completions.create(
    messages=[{"role": "user", "content": question}],
    model="gpt-4o-mini-2024-07-18",
    max_tokens=40,
    temperature=0.4,
)
print(response.choices[0].message.content)
# The application code remains unchanged, but you save time and API costs

Documentation

Full documentation for GenAI Monitor is available here.

Contributing

Contributions are welcome! Please see CONTRIBUTING.md for details on how to contribute to this project.

License

This project is licensed under the MIT License - see the LICENSE.md file for details.

Metadata

Release files for genai-monitor 0.0.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 genai-monitor 0.0.1
File Size Uploaded
genai_monitor-0.0.1.tar.gz 46.4 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for genai-monitor 0.0.1
File Interpreter ABI Platform
genai_monitor-0.0.1-py3-none-any.whl Python 3 none any Details

Total release size: 107.5 kB

Release files / genai_monitor-0.0.1.tar.gz

Download URL genai_monitor-0.0.1.tar.gz
Size 46.4 kB
Tags Source
SHA-256 checksum
How to use checksums
d2fc2e7f3c9f62da0d19847cc8e0ea5248d11e6336ea10e70b2f90ef774b040b
BLAKE2b-256 checksum
How to use checksums
fe66cd9bbfdbf3711e7ca12ab92057cd379fcb4184d29cf742c4e3ebb5d4a2c7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.12.9

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Apr 22, 2025.

Transparency log

Release files / genai_monitor-0.0.1-py3-none-any.whl

Download URL genai_monitor-0.0.1-py3-none-any.whl
Size 61.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
dfeae1d4f766890079802b4aa6585d7d3c975e44351a1f20e07ac97c41d43e54
BLAKE2b-256 checksum
How to use checksums
d93ec6535b550520c20c0c942d0ec7bbbab2c91580bd82d5f770ef2d16a496e6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.12.9

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Apr 22, 2025.

Transparency log

Release history Release notifications | RSS feed

This release

0.0.1 This release

2 release files

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