Documentation Index
Fetch the complete documentation index at: https://simplellmfunc.cn/llms.txt
Use this file to discover all available pages before exploring further.
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
| Component | Langfuse Entity | Contains |
|---|---|---|
@llm_function call | Trace | Full invocation lifecycle |
@llm_chat call | Trace | Full ReAct loop |
| Each LLM API call | Generation | Messages in/out, tokens, latency |
| Each tool execution | Span | Tool name, args, result, duration |
| ReAct iterations | Span | Iteration boundaries |
Trace IDs
Each invocation gets a uniquetrace_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
SetLANGFUSE_ENABLED=false or simply don’t configure the keys. The framework gracefully degrades — no errors, just no traces.
Log Levels
Control framework logging independently:DEBUG, INFO, WARNING, ERROR, CRITICAL.
Use DEBUG only when investigating framework behavior. WARNING is the recommended default for production.