How to debug your LLM apps
Like building any type of software, at some point you'll need to debug when building with LLMs. A model call will fail, or model output will be misformatted, or there will be some nested model calls and it won't be clear where along the way an incorrect output was created.
There are three main methods for debugging:
- Verbose Mode: This adds print statements for "important" events in your chain.
- Debug Mode: This add logging statements for ALL events in your chain.
- LangSmith Tracing: This logs events to LangSmith to allow for visualization there.
Verbose Mode | Debug Mode | LangSmith Tracing | |
---|---|---|---|
Free | ✅ | ✅ | ✅ |
UI | ❌ | ❌ | ✅ |
Persisted | ❌ | ❌ | ✅ |
See all events | ❌ | ✅ | ✅ |
See "important" events | ✅ |