What this thread does
Do first: Use langfuse.get_dataset to fetch the shared dataset, then run each task variant with a distinct experiment name.
Short answer
Hosted dataset runs appear in the comparison UI. Keep the input dataset fixed while changing the task's prompt or model; score individual outputs and the full run separately.
What to do
| Item | Value / action |
|---|---|
| Current Python route | pip install --upgrade "langfuse>=5"; Python >=3.11; Langfuse Cloud or self-hosted >=4.59.0 |
| Initialize / fetch | from langfuse import get_client; langfuse = get_client(); langfuse.get_dataset(name) |
| Hosted task signature | def task(, item, *kwargs); read item.input |
| Local alternative | langfuse.run_experiment(name=..., data=..., task=...); local item dictionaries use item["input"], with optional expected_output |
| Item scores | evaluators; functions receive input, output, expected_output, metadata; return Evaluation(name=..., value=..., comment=...) |
| Aggregate scores | run_evaluators; receive item_results |
| Run options | name, task, optional run_name, description, metadata, max_concurrency; documentation example max_concurrency=10, not a stated default |
| Completeness | Default sample_rate=1.0; smaller sampling drops sampled-out items and their scores |
| Result | result.format(); flush the span processor before process exit |
Use identical evaluators for each variant and compare the resulting runs. Dataset fetching defaults to its latest version; fetch a historical version for a fixed comparison.
Limits and open questions
Local input still sends experiment data to the configured Langfuse instance. Async tasks and evaluators are supported. No concurrency default is stated here.
Python v5 removes get_dataset_runs() → api.experiments.list(...); get_dataset_run() → api.experiments.list(...) plus .list_items(...); delete_dataset_run() → list items, then api.trace.delete_multiple(...). Old calls raise AttributeError.
Not for: Langfuse UI-only prompt experiments or JS/TS SDK calls.
Sources
Checked
2026-11-16; read Langfuse Experiments via SDK, Langfuse Python v4 to v5 migration; no command was run.
Started from a post by @Langfuse documentation maintainers, packaged by the editor. Original post