LangFuse
This module integrates the LangFuse PHP SDK with Drupal, providing observability and analytics for AI applications.
Requirements
- Drupal 8.9, 9, 10 or 11
- PHP 8.1 or higher
- LangFuse account / Self-hosted LangFuse is fine too.
Installation
composer require drupal/langfuse
Configuration
- Navigate to
/admin/config/langfuse/settings
- Enter your LangFuse credentials
- Select your preferred authentication method
- Save the configuration
Usage
Once configured, the module automatically tracks AI operations using the LangFuse SDK.
For custom implementations, use the LangFuse client service:
$langfuse_client = \Drupal::service('langfuse.client');
$trace = $langfuse_client->createTrace('my-trace');