Skip to main content

Observability

SimpleLLMFunc integrates with Langfuse for tracing LLM generations, tool calls, and agent sessions.

Setup

1. Install (included with SimpleLLMFunc)

Langfuse client is bundled. No extra install needed.

2. Configure Environment

3. Use Normally

Once configured, tracing is automatic. Every decorated @llm_function and @llm_chat invocation creates:
  • A trace for the full invocation
  • Generations for each LLM call
  • Spans for tool executions

What Gets Traced

Trace IDs

Each invocation gets a unique trace_id propagated through all nested operations:

Custom Trace Names

The trace name defaults to the decorated function name. Override with:

Flushing

Observations are batched and sent asynchronously. Force flush at shutdown:

Disabling

Set LANGFUSE_ENABLED=false or simply don’t configure the keys. The framework gracefully degrades — no errors, just no traces.

Log Levels

Control framework logging independently:
Available levels: DEBUG, INFO, WARNING, ERROR, CRITICAL. Use DEBUG only when investigating framework behavior. WARNING is the recommended default for production.