Registry / llm-agents / lunary

lunary

JSON →
library1.4.41pypypi✓ verified 80d ago

Python SDK for Lunary, an open-source platform for managing, monitoring, and improving LLM chatbots. Current version 1.4.41, actively maintained with frequent releases.

pip install lunary
INSTALL
IMPORT
SIG · LUNARY
L
lunary
llm-agentspythonv1.4.41
Install
13.8s avg
Import
Disk
184MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v1.4.41 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.103.95 runs
installs and imports cleanly · install 0.0s · import 0.000s · 207.7MB
glibc
py 3.103.95 runs
installs and imports cleanly · install 13.8s · import 0.000s · 211MB
184MB installed
● package 184MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

AgentFinish
from lunary import AgentFinish
from lunary import LunaryHandler

Initialize LunaryHandler with your API key and track an event.

import os from lunary import LunaryHandler # Set your Lunary API key os.environ['LUNARY_PUBLIC_KEY'] = 'your-public-key' handler = LunaryHandler( public_key=os.environ.get('LUNARY_PUBLIC_KEY', ''), # Optional: specify a different endpoint # endpoint="https://api.lunary.ai" ) # Usage example: track a chat completion handler.track_event("chat", { "model": "gpt-3.5-turbo", "messages": [{"role": "user", "content": "Hello"}], "output": "Hi there!" })
Debug
Known issues
gotchaDo NOT use the deprecated langchain callback import path. The correct import is from lunary import LunaryHandler.
fix
Use 'from lunary import LunaryHandler' instead of 'from langchain.callbacks import LunaryCallbackHandler'.
affects: <=1.4.41
gotchaThe environment variable for API key is LUNARY_PUBLIC_KEY (not LUNARY_API_KEY). Some older docs may mention the wrong name.
fix
Set os.environ['LUNARY_PUBLIC_KEY'] = 'your-key'.
affects: <=1.4.41
deprecatedThe 'track_event' method is part of the v1 API and may be deprecated in future versions. Use 'log_event' or the callback decorator instead.
fix
Switch to from lunary import log_event or use the @callback decorator.
affects: >=1.2.0
Upgrade
Version history
1.4.41latest on PyPI · released Apr 8, 2026
Audit
Dependencies
openaioptionalOptional integration for OpenAI. If you want to use Lunary's OpenAI monitoring, install with lunary[openai].
Agent activity
22 hits · last 30 days
node
18
OpenAI (training)
2
Resources
lunary — pip install lunary · libregistry