lunary
Python SDK for Lunary, the open-source platform where GenAI teams manage and improve LLM chatbots.
What it is and what it does
Lunary is a monitoring and analytics SDK for Python applications built around large language models and AI agents. It acts as middleware that intercepts calls to LLM providers and custom agent frameworks, capturing interaction data and sending it to the Lunary platform for analysis and debugging. The SDK is designed to work with any LLM model and supports both standard and streaming interactions.
The package integrates into existing code through a simple monitor() call on a client object, after which it transparently logs all subsequent LLM interactions. It depends on common libraries like aiohttp, requests, pydantic, and langchain-community, making it straightforward to add to projects already using those tools. The SDK requires Python 3.10 or later and a Lunary account to send data to.
Use it for:
- Monitor and debug LLM application behavior by capturing all model calls and responses in a centralized dashboard.
- Track performance metrics and usage patterns across multiple LLM providers in a single interface.
- Integrate observability into langchain-community-based agents to log and analyze multi-step reasoning.
- Collect analytics on AI chatbot interactions to identify failure modes and improve prompt engineering.
- Stream LLM responses while simultaneously logging them for later analysis and audit trails.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Lunary is a Python SDK that monitors and logs interactions with LLM models and custom agents, integrating with langchain-community and other libraries to capture and send telemetry to the Lunary platform.
Yes, if you are building production AI applications and need centralized monitoring of LLM interactions. The low install friction, active maintenance, and support for multiple LLM providers make it a practical choice. However, resolve the unclear license status before use in commercial or compliance-sensitive contexts, and verify that the data-collection model aligns with your privacy and security requirements.
Install
lunary on PyPI
pip
pip install lunaryuv
uv add lunarypoetry
poetry add lunaryInstalling lunary
Before you install
Low install friction with a pure-Python wheel and stable maintenance status. The package has 10 runtime dependencies including widely-used libraries like aiohttp, requests, and pydantic, all of which are standard in the Python ecosystem.
License in practice
License status is unclear—no SPDX identifier or raw license text is available in the package metadata. Before adopting this in a commercial or copyleft-sensitive project, verify the actual license terms directly with the project repository.
Quickstart
pip install lunary
import lunary
lunary.monitor(client)
# Subsequent LLM calls are now monitored and logged
Requires Python 3.10 or later and a Lunary project ID obtained by registering at lunary.ai.
Verify before relying
- Which LLM providers are supported beyond those shown in the description excerpt.
- What data is sent to Lunary's servers and whether it includes prompt/response content or only metadata.
- Performance overhead of monitoring on production LLM calls, especially with streaming.
- Whether the package works equally with all supported providers or has known limitations.
Package facts
| License | not declared (unclear) |
| Python support | supports the current Python release (<4.0.0,>=3.10.0) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 10 — aiohttp, chevron, jsonpickle, langchain-community, packaging, pydantic, pyhumps, requests, setuptools, tenacity |
| Maintenance | actively maintained — 128 days since the last release |
| First released | |
| Downloads | 160,369/month — #10,663 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: lunary-1.4.41-py3-none-any.whl
Keywords: Lunary, lunary.ai, Langchain, AI, Analytics, Monitoring, LLM, GenAI, SDK
Tags
More Monitoring packages
Wraps any iterable to display a real-time…
copyleft · top 100 on PyPI
opentelemetry-semantic-conventionsProvides generated Python code for…
permissive · top 100 on PyPI
opentelemetry-sdkProvides the reference implementation of the…
permissive · top 100 on PyPI
opentelemetry-apiProvides the abstract API and interfaces for…
permissive · top 100 on PyPI
opentelemetry-exporter-otlp-proto-httpExports OpenTelemetry observability data to an…
permissive · top 1,000 on PyPI
opentelemetry-instrumentationProvides automatic instrumentation commands and…
permissive · top 1,000 on PyPI
langchainLangChain provides a framework for building…
permissive · top 1,000 on PyPI
langchain-communityProvides third-party integrations for LangChain…
permissive · top 1,000 on PyPI
promptlayerPromptLayer is a Python SDK for managing,…
permissive · top 15,000 on PyPI
uipath-langchain-clientProvides LangChain-compatible chat models and…
unclear · top 15,000 on PyPI
litellm-enterpriseLiteLLM Enterprise provides a unified Python…
unclear · top 5,000 on PyPI
agentopsAgentOps provides observability and monitoring…
permissive · top 15,000 on PyPI
litellmLiteLLM provides a unified Python interface to…
permissive · top 100 on PyPI
llama-index-llms-google-genaiIntegrates Google's Gemini models into…
permissive · top 15,000 on PyPI
langchain-cliCommand-line interface for building, testing,…
permissive · top 15,000 on PyPI
mlflow-tracingInstrument GenAI applications with distributed…
permissive · top 1,000 on PyPI