Observed since 20 Oct, 22:34 UTC
No superseded metadata states collected. Unchanged observations do not create new revisions.
agent-lighthouse
Multi-Agent Observability SDK for Agent Lighthouse
The official Python client for instrumenting AI agents with Agent Lighthouse.
Install from PyPI:
pip install agent-lighthouse
Or install from source in development mode:
cd sdk
pip install -e .
from agent_lighthouse import LighthouseTracer
# Use your API Key (starts with lh_)
tracer = LighthouseTracer(api_key="lh_...")
Wrap your functions with @trace_agent, @trace_tool, or @trace_llm.
from agent_lighthouse import trace_agent, trace_tool, trace_llm
@trace_tool("Web Search")
def search_web(query):
# ... logic ...
return results
@trace_llm("GPT-4", model="gpt-4-turbo", cost_per_1k_prompt=0.01)
def call_llm(prompt):
# ... call OpenAI ...
return response
@trace_agent("Researcher")
def run_research_agent(topic):
data = search_web(topic)
summary = call_llm(f"Summarize {data}")
return summary
Just run your script as normal. The SDK will automatically send traces to the backend.
Allow humans to inspect and modify agent state during execution:
from agent_lighthouse import get_tracer
@trace_agent("Writer")
def writer_agent():
tracer = get_tracer()
# Expose state
tracer.update_state(
memory={"draft": "Initial draft..."},
context={"tone": "Professional"}
)
# ... execution continues ...
No code changes to your LLM calls. Just import once at the top of your script:
import agent_lighthouse.auto # auto-instruments OpenAI, Anthropic, requests, and frameworks
This automatically captures:
Content capture is off by default. Enable if you explicitly want payloads:
export LIGHTHOUSE_CAPTURE_CONTENT=true
You can configure the SDK via environment variables:
| Variable | Description | Default |
|---|---|---|
LIGHTHOUSE_API_KEY | Your machine API key | None |
LIGHTHOUSE_BASE_URL | URL of the backend API | http://localhost:8000 |
LIGHTHOUSE_AUTO_INSTRUMENT | Enable auto-instrumentation | 1 |
LIGHTHOUSE_CAPTURE_CONTENT | Capture request/response payloads | false |
LIGHTHOUSE_LLM_HOSTS | Allowlist extra LLM hosts for requests instrumentation | "" |
LIGHTHOUSE_PRICING_JSON | Pricing override JSON string | "" |
LIGHTHOUSE_PRICING_PATH | Pricing override JSON file path | "" |
LIGHTHOUSE_DISABLE_FRAMEWORKS | Disable framework adapters (csv) | "" |
Download counts and popularity will appear here as the collector receives them.
| Package / target | Requirement | Relationship |
|---|---|---|
httpxEnvironment{
"extras": "",
"marker": null,
"requires_python": ">=3.9",
"evaluation": "NOT_EVALUATED"
} | httpx>=0.25.0 | runtime |
crewaiEnvironment{
"extras": "",
"marker": "extra == \"crewai\"",
"requires_python": ">=3.9",
"evaluation": "NOT_EVALUATED"
} | crewai>=0.1.0; extra == "crewai" | runtime |
langgraphEnvironment{
"extras": "",
"marker": "extra == \"langgraph\"",
"requires_python": ">=3.9",
"evaluation": "NOT_EVALUATED"
} | langgraph>=0.0.1; extra == "langgraph" | runtime |
pytestEnvironment{
"extras": "",
"marker": "extra == \"dev\"",
"requires_python": ">=3.9",
"evaluation": "NOT_EVALUATED"
} | pytest>=8.3.0; extra == "dev" | runtime |
pytest-asyncioEnvironment{
"extras": "",
"marker": "extra == \"dev\"",
"requires_python": ">=3.9",
"evaluation": "NOT_EVALUATED"
} | pytest-asyncio>=0.24.0; extra == "dev" | runtime |
pytest-covEnvironment{
"extras": "",
"marker": "extra == \"dev\"",
"requires_python": ">=3.9",
"evaluation": "NOT_EVALUATED"
} | pytest-cov>=5.0.0; extra == "dev" | runtime |
ruffEnvironment{
"extras": "",
"marker": "extra == \"dev\"",
"requires_python": ">=3.9",
"evaluation": "NOT_EVALUATED"
} | ruff>=0.8.0; extra == "dev" | runtime |
banditEnvironment{
"extras": "",
"marker": "extra == \"dev\"",
"requires_python": ">=3.9",
"evaluation": "NOT_EVALUATED"
} | bandit>=1.8.0; extra == "dev" | runtime |
bdist_wheel · 20.03 KB · Python py3
sdist · 21.08 KB · Python source
Shared repository data · GitHub
Observed since 20 Oct, 22:34 UTC
No superseded metadata states collected. Unchanged observations do not create new revisions.
package_version:d6e34342af3be787982fbeb8735e76a24f4157937f31209a2eba7a4bc4d0a6fc