Download the PHP package lingoda/langfuse-bundle without Composer

On this page you can find all versions of the php package lingoda/langfuse-bundle. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package langfuse-bundle

Lingoda Langfuse Bundle

A Symfony bundle for integrating with Langfuse, providing AI operation tracing, prompt management, and observability for AI applications built with the Lingoda AI SDK.

Features

Requirements

Installation

  1. Install the bundle via Composer:

  2. Add the bundle to config/bundles.php:

  3. Configure the bundle in config/packages/lingoda_langfuse.yaml:

Core Features

Automatic AI Operation Tracing

The bundle automatically traces all AI operations by decorating the Lingoda AI SDK's PlatformInterface:

Automatic trace data includes:

Every platform an app can inject is traced: the main PlatformInterface, and the single-provider platforms ai-bundle registers ($openaiPlatform, $bedrockPlatform, ...). Attachments appear in the input as {mime, size} only; their bytes and filenames never reach Langfuse.

Keeping personal data out of Langfuse

Pass trace_content: false to keep a call's content out of Langfuse:

The trace still records the name, model, provider, usage, duration and status. The input is recorded as {type: redacted}, there is no output, and an error is recorded as its exception class only (provider errors can quote the input). Nothing sensitive reaches the Messenger message or the failure transport either.

Linking generations to Langfuse prompts

PromptRegistryInterface::reference() resolves the actual version (also for a label or the latest), and the generation is linked to that prompt version in Langfuse.

Sessions and users

Groups traces into a Langfuse session and attributes them to a user, so session cost and filters work. Pass ids, never names or e-mail addresses. trace_name, trace_content, langfuse_prompt, langfuse_session_id and langfuse_user_id are removed before the call reaches the provider.

What a trace measures

Decision Tracing (TypeSafe Jev)

When ai-bundle registers TypeSafe Jev (providers.typesafe), DecisionPlatformInterface::decide() is traced the way Langfuse's own TypeSafe integration records it: a generation named typesafe-system-one, the model TypeSafe answered with (e.g. jev-1.13.0 for jev-latest), the request {state, model, questions} as input, the typed answers with their probabilities as output, and the input tokens as usage. Jev as a judge evaluators run inside Langfuse on these traces and need nothing from this bundle.

Usage Metrics and Cost Tracking

The bundle automatically extracts and sends usage metrics in the proper format for Langfuse:

This enables accurate cost tracking and usage analysis in the Langfuse dashboard.

Async Trace Flushing

For production applications, enable asynchronous trace processing to eliminate latency impact:

1. Configure Messenger Transport

2. Enable Async Processing

3. Run Message Consumers

Benefits:

Prompt Management

The bundle provides a complete prompt management system with intelligent caching and fallback storage:

Prompt Flow:

  1. Cache lookup - Fast in-memory retrieval
  2. API call - Fresh fetch from Langfuse if cache miss
  3. Storage fallback - Local storage if API unavailable
  4. Automatic caching - Cache API results for future use

Storage Configuration Options

Path-based Storage (Default):

Flysystem Integration (Cloud Storage):

Manual Tracing

For operations the decorators do not cover, trace them through TraceManagerInterface: the same path, sampling, trace_content handling and flushing as the automatic traces.

Langfuse v4 Ingestion

Traces are sent to Langfuse's OpenTelemetry endpoint (POST /api/public/otel/v1/traces, OTLP/HTTP JSON, header x-langfuse-ingestion-version: 4), the v4 ingestion path. The legacy /api/public/ingestion endpoint is served only until November 16, 2026 and is not used. Each trace is one root observation, a generation when the result names a model, carrying input, output, usage (input, output, total, input_cached_tokens, output_reasoning_tokens), model, prompt link, level and metadata as langfuse.* attributes. Prompt management uses GET /api/public/prompts, which v4 keeps.

Configuration Reference

Console Commands

Test Connection

Verify your Langfuse API credentials and connection:

Cache Prompts

Cache specific prompts from Langfuse to local fallback storage:

Options:

Performance Optimization

Sync Mode (Default):

Async Mode:

Sampling Configuration:

Development

Running Tests

Architecture

The bundle follows clean architecture principles with focused, single-responsibility services:

Core Components

Trace Processing Architecture

Async Flow:

Prompt Management Architecture

Architecture Principles

Design Philosophy

Logging

The bundle uses a dedicated langfuse Monolog channel for all operations. Configure it in your Monolog configuration:

Troubleshooting

Common Issues

  1. Connection failures: Verify your API keys and host URL using langfuse:test-connection
  2. Missing prompts: Use langfuse:cache-prompt to cache prompts locally for offline access
  3. Async processing not working: Ensure Symfony Messenger is configured and consumers are running
  4. Token usage not tracked: Verify the AI SDK returns proper usage metrics

Debug Mode

Enable debug logging to troubleshoot issues:

License

MIT License. See LICENSE for details.


All versions of langfuse-bundle with dependencies

PHP Build Version
Package Version
Requires php Version ^8.4
lingoda/ai-bundle Version ^2.0
lingoda/ai-sdk Version ^2.1
psr/log Version ^3.0
symfony/cache Version ^7.4|^8.0
symfony/clock Version ^7.4|^8.0
symfony/config Version ^7.4|^8.0
symfony/console Version ^7.4|^8.0
symfony/dependency-injection Version ^7.4|^8.0
symfony/expression-language Version ^7.4|^8.0
symfony/http-client Version ^7.4|^8.0
symfony/http-foundation Version ^7.4|^8.0
symfony/http-kernel Version ^7.4|^8.0
webmozart/assert Version ^1.11
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package lingoda/langfuse-bundle contains the following files

Loading the files please wait ...