Skip to main content

Track LLM usage across DSPy program runs

Project description

Nanomon

LLM observability for DSPy applications.

What is Nanomon?

Nanomon is an observability platform for LLM applications built with DSPy. It automatically tracks token usage, costs, and tool calls across your DSPy program runs, giving you full visibility into your AI workflows.

Features

  • Automatic LLM token usage tracking
  • Cost calculation and analytics
  • Tool call tracking with the @nanomon decorator
  • DSPy integration (Predict, ReAct, ChainOfThought)
  • Run context management for grouping related calls
  • Multiple storage backends (API, SQLite)

Quick Start

import dspy
from nanomon import NanomonRunContext, configure_nanomon

# 1. Create context and configure tool tracking
context = NanomonRunContext(default_tags=["production"])
configure_nanomon(context._sink)

# 2. Instrument your LM
lm = dspy.LM(model="openai/gpt-4o-mini")
lm = context.instrument_lm(lm)
dspy.configure(lm=lm)

# 3. Track runs - DSPy callbacks are auto-configured
with context.run(tags=["my-task"], metadata={"version": "1.0"}):
    predictor = dspy.Predict(MySignature)
    result = await predictor.acall(input="Hello")
    # Each DSPy module call is automatically tracked as a separate run

Note: Use .acall() for async DSPy module calls to ensure proper callback integration.

Links

License

MIT

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

nanomon-0.2.2.tar.gz (16.9 kB view details)

Uploaded Source

Built Distribution

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

nanomon-0.2.2-py3-none-any.whl (24.5 kB view details)

Uploaded Python 3

File details

Details for the file nanomon-0.2.2.tar.gz.

File metadata

  • Download URL: nanomon-0.2.2.tar.gz
  • Upload date:
  • Size: 16.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.9

File hashes

Hashes for nanomon-0.2.2.tar.gz
Algorithm Hash digest
SHA256 db10cbf05fb5a5233a60639f16fd3dc152e7becdad2ebed610d2a7170d5823b7
MD5 a207287971d22e8eb29aaff24e799742
BLAKE2b-256 4776fe01c6054530c202181da2d9142764516d1c79e7620c6020fd973c96f80d

See more details on using hashes here.

File details

Details for the file nanomon-0.2.2-py3-none-any.whl.

File metadata

  • Download URL: nanomon-0.2.2-py3-none-any.whl
  • Upload date:
  • Size: 24.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.9

File hashes

Hashes for nanomon-0.2.2-py3-none-any.whl
Algorithm Hash digest
SHA256 2854a552fa11db6f24d48b75dca6c5260f7d8b2c7d09e5c391452f0295dafadc
MD5 ff923dce060419bcf21e326b9d5bca07
BLAKE2b-256 bcc9aa3d7ba7daac40da5b365f7fd1cb1b163686e3dfe7af05a5fed035c183ba

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