Sending custom scores and evaluation results to Langfuse: what it does and when you need it
If your team already runs its own checks, you can store their results next to the traces they judge in self-hosted Langfuse. Scripts, rule engines, judge models and pipeline tests all produce a result for an LLM output. Custom scores let you send that result to Langfuse through the SDKs or the API and attach it to a trace, an observation, a session or a dataset run. Per the Langfuse custom scores documentation, a score can be numeric, categorical or boolean, so a pass or fail rule, a 1 to 5 rating and a category label all fit the same model. Once stored, the score sits beside the trace in the UI, can be filtered and charted, and can be compared across prompt or model versions.
Teams usually need this in three situations. The first is external evaluators: a moderation service, a fact-checking model or an internal rubric runs outside Langfuse and must report back to the trace it judged. The second is batch scoring of historic traces, where a job reads existing traces from your data stores, computes a result and writes it back, often to answer a question that arose after the traces were recorded. The third is CI results, where a test run against a dataset publishes pass rates or regression flags so reviewers can see them next to the affected runs. Before building, confirm which object each score must attach to, because a trace-level score and an observation-level score answer different questions.
This page covers the write path only. It does not replace the pages on LLM-as-a-judge evaluators, code evaluators, human annotation or user feedback, which decide how a score is produced. Use this page once you already have a result and need to store it correctly. Plan the score naming and value types early, because changing them later affects every dashboard and filter that depends on them. The next sections explain the score types, how score configs keep values consistent across writers and how to attach scores to each object type.
How a custom score travels from your pipeline into Langfuse
The flow starts in your evaluation pipeline, which computes a result for a trace, observation, session or dataset run. The pipeline sends that score through the Langfuse SDK or API, crossing the trust boundary into the self-hosted instance. Langfuse Web checks the score against any score config, stores it, and the UI and APIs then display it next to the target. Confirm that the score config and the target ID are validated on your instance before you rely on the pipeline.
Custom scores move from your pipeline through the SDK or API into Langfuse Web and its storage.
Numeric, categorical and boolean scores: which result fits which check
Numeric scores fit checks that grade output along a continuous or ordered scale, such as a quality rating, a relevance measure or a 0 to 1 similarity value. They are the natural choice when you want averages, distributions and trends across many traces, and when a judge or metric returns a graded value rather than a verdict. Illustrative example: a summarization check that returns 0.72 for one trace and 0.91 for another can be averaged per prompt version and compared across experiments.
- Aggregation: averages, minimums and distributions are meaningful, so you can watch drift in the mean over time.
- Scale definition: write down what the minimum, maximum and midpoint mean before scoring starts, because the number has no meaning without it.
- Common mistake: collapsing a graded result into pass or fail at an arbitrary cut-off, which discards the detail that shows gradual regressions.
- Calibration: check that scores from different evaluators or judge prompts sit on the same scale before comparing them.
- Thresholds: set any alerting or gating threshold from your own baseline data, not from a number copied from documentation.
Before you ship, confirm that each numeric score has a documented range and that reviewers can interpret a value without reading the evaluator code.
Categorical scores fit checks that assign one label from a fixed set, such as a tone category, a support intent, or a route outcome like answered, escalated or refused. They suit cases where the outcome is a class, not a position on a scale, and where you need counts per label to understand behavior. Illustrative example: a triage check labels each response as resolved, needs-human or out-of-scope, and the dashboard shows how the share of each label moves between releases.
- Aggregation: counts and proportions per label show where output shifts between categories.
- Closed label set: define every allowed value up front so evaluators and human reviewers choose from the same list.
- Common mistake: adding a numeric score to a categorical outcome to make it sortable, which invents an order the categories do not have.
- Ambiguous categories: overlapping labels produce inconsistent scoring, so give each one a short definition and an example.
- Coverage: include an other or unclear option only if you will review those results, or they hide problems.
Check that a sample of results from two independent reviewers agrees on the label often enough for the counts to mean something to your team.
Boolean scores fit yes or no checks where the question has a clear answer, such as whether the output is valid JSON, whether a required field is present, or whether a forbidden term appeared. They are fast to explain, easy to automate in code and easy to gate a release on. Illustrative example: a deterministic check marks each response true when the tool-call arguments parse against the expected schema and false otherwise.
- Aggregation: the pass rate across traces is the main figure, and failing examples can be opened directly.
- Clear criteria: write the exact condition for true and false, so the score does not depend on who reviewed the trace.
- Common mistake: using a boolean for a judgment with degrees, such as whether an answer is helpful, which hides near misses behind a single bit.
- Pairing: keep a numeric or categorical score alongside a boolean when you need both a gate and an explanation of why it failed.
- Gating: use boolean results in CI only for conditions you have tested on known good and bad examples.
Before you rely on a boolean check for release decisions, confirm it returns the expected result on a small set of examples you labeled yourself.
The right score type comes from the question the check answers, not from the tool that produces it. A single evaluator can return several scores, and a pipeline often mixes types: a boolean for a hard requirement, a categorical label for the failure reason and a numeric score for overall quality. Deciding this early also determines whether a score config is needed so that every writer uses the same name, type and allowed values.
- Start from the decision: ask what a team will do with the result, such as block a release, review a trace or compare two prompts.
- Split hard and soft checks: keep requirements that must hold separate from judgments that can vary in degree.
- Common mistake: choosing a type only because a judge model happens to return a number.
- Score configs: create a config for each score name so that type and allowed values are enforced across SDKs and API calls.
- Ownership: record which team owns each score name so changes to its meaning are reviewed.
Confirm how your Langfuse version handles score configs and type validation for your SDK and API calls before you build pipelines that depend on them.
Configuration options for custom scores and when each fits
This table compares the main choices you make when sending custom scores: data type, whether to use a score config, the object the score attaches to, and whether to send through an SDK or the API directly. Read each row as a decision, then check the fit against your pipeline's language and how strictly results must be compared over time. The main takeaway is that score configs cost a little setup effort but pay off when several pipelines or reviewers must produce comparable numbers.
| Option | When it fits | Trade-off and effort |
|---|---|---|
| Numeric score | Continuous or graded results such as a similarity value or a rubric total that you want to average and chart over time. | Easy to send, but without a score config nothing stops different pipelines from using different scales for the same name. |
| Categorical score | Results that fall into a fixed set of labels, such as a triage outcome or a support category. | Labels must be agreed up front. Renaming a label later splits history, so confirm how your version handles label changes. |
| Boolean score | Pass or fail checks such as a schema validity test or a policy rule that either held or did not. | Simplest to interpret and aggregate, but it hides degree of failure, so pair it with a numeric score when severity matters. |
| Score config with allowed values or range | Scores produced by several pipelines, judges or reviewers that must share one definition and stay comparable. | Needs one-time setup and an owner who maintains the definition. Confirm the exact config parameter names in the current docs. |
| Free-form score name | Early experiments, one-off analyses or exploratory checks where the definition is still changing. | Fast to start, but names drift across teams and services, which makes dashboards and comparisons unreliable later. |
| Attach to trace | Judgments about a whole request or end-to-end answer, such as overall helpfulness. | Simple to link. Aggregates across the full interaction, so it cannot say which step caused a problem. |
| Attach to observation | Judgments about one generation, tool call or retrieval step, such as whether a specific retrieval was relevant. | Gives finer diagnosis but requires your pipeline to know the observation ID at scoring time, which adds wiring. |
| Attach to session or dataset run | Quality across a conversation, or a summary score for an experiment run compared against other runs. | Useful for trends and regression checks. Requires you to track session or run identifiers consistently. |
| SDK | Pipelines already written in a supported language that also send traces, so IDs and client setup are shared. | Less plumbing and fewer version mismatches to manage. Keep SDK versions aligned with your Langfuse server version. |
| Direct API calls | Languages without an SDK, batch jobs in existing tooling, or integrations that must avoid an extra dependency. | More control over payloads, but your team owns request formatting, retries and error handling. |
Why score configs keep results comparable across pipelines
A score config fixes a score name, its data type and its allowed values or range, so that scores written by different scripts, teams and time periods mean the same thing and can be filtered and compared together. Without one, a faithfulness check written by one team as faithfulness on a 0 to 1 scale and another team's Faithfulness on a 1 to 5 scale will both appear in Langfuse, but no dashboard, experiment comparison or annotation queue can treat them as one measure. The config is the contract between every pipeline that writes to a given score name.
The trade-off is between strict and loose naming. Strict configs keep numeric ranges, categories and boolean meanings consistent across producers and make reviews easier, but every new score needs a config created and agreed before a pipeline can use it, which slows experimentation. Free-form names let a developer start sending a score in minutes, but over months the same idea tends to appear under several names and types, and the experiments and dashboards built on them drift apart. A practical middle ground is to create configs for scores that feed dashboards, experiments or decisions, and to keep exploratory scores in a clearly named prefix until they earn a config.
Renaming a score or changing its config affects how historical scores are read, and this is the step most often underestimated. Before changing a config, confirm with the documentation for your Langfuse version how existing scores are displayed and filtered, whether changed ranges or categories apply to old records, and how a rename separates new results from old ones in charts and experiment comparisons. Test the change on a non-production project first, and record the old and new names in your evaluation runbook so that analysts can still find historical results.
How to set up custom score ingestion in your self-hosted instance
This sequence takes a self-hosted Langfuse instance from first connection to production batch scoring, with a check at each stage so your team knows scores are landing on the right traces before pipelines depend on them. It produces a tested, named scoring setup that your evaluation code can reuse.
Confirm reachability and version compatibility
The platform or security engineer who owns the Langfuse deployment confirms that the host running your evaluation pipeline can reach the instance's public URL over HTTPS, and that any proxy or network policy allows the SDK's requests. Then the pipeline owner checks the installed Python or JS/TS SDK version against the instance version. The supplied facts state that Python SDK v5 and JS/TS SDK v6 need Langfuse v4.59.0 or later, so confirm the instance version in the admin area before installing. Done when a simple authenticated request from the pipeline host returns a successful response and the SDK version matches the requirement for your instance.
Create score configs and a naming convention
Before writing any score code, the evaluation lead agrees on score names and types, for example a naming pattern such as a product area, a dimension and a version, and records each one as a score config in the Langfuse project. Use numeric configs for graded values, categorical configs for fixed labels and boolean configs for pass or fail checks, and set allowed ranges or labels so every pipeline writes values the same way. Confirm the configs appear in the project settings with the expected data type and values. Done when a reviewer can list the configs and every planned score name has exactly one matching config.
Identify a test trace and its ID
The pipeline owner picks one existing trace from a non-production or low-risk environment and copies its trace ID from the Langfuse UI or from the SDK response that created it. Scores attach to a specific trace, observation, session or dataset run, so the ID must belong to the same project as the score config. Note whether you will attach the score to the trace or to a nested observation, because the target ID changes. Done when the chosen ID opens the expected trace in the UI and the project matches the one holding your score configs.
Write one test score with the target ID
The developer adds a single score call in the pipeline code, passing the score name, value, data type that matches its config and the test trace ID, and runs it once from the same host and credentials your production job will use. Keep the first call to one score so any failure is easy to isolate. Check the SDK or API response for success and note the returned score identifier. Done when the call completes without error and the response confirms the score was stored against the intended target.
Verify the score on the trace and in filters
The developer opens the test trace in the self-hosted UI and confirms the score appears with the correct name, value and data type. Then they apply a score filter on the trace list using the same name and a threshold or label, and confirm the trace is returned. If the score is missing, check the project and environment, the target ID and whether the config type matches the value sent. Done when the score is visible on the trace and the filter returns that trace, which confirms the score is usable by reviewers and dashboards.
Test invalid values and rerun behavior
Before scaling, the developer sends one value outside the config's range or label set and records how the instance and SDK respond, so the pipeline has a defined path for rejected writes. They also repeat the test call to confirm how duplicate writes behave in your version, and document whether your pipeline should update, skip or record a failure. Done when the team has a short written note of the rejection and duplicate behavior and the pipeline handles both paths in code.
Scale to batch scoring with monitoring
The pipeline owner moves from single calls to batched writes over the set of trace IDs produced by a sampled run, using the same score names and configs. Add logging for each batch's count of accepted and failed writes, and confirm the scores appear in the UI for a sample of traces from the batch. Ask your platform team to watch ingestion load on the instance during the first large run. Done when a full sampled batch completes, the success count matches the number of expected scores, and a random check of traces shows the correct values.
Security and data handling for scores written from your pipelines
Scores written from your evaluation pipelines carry the same sensitivity as the traces they describe, and they often leave a copy of personal data behind. The cards below cover the credentials, data content, read and write permissions, network path and audit trail that connect the pipeline to your self-hosted instance, with the control to confirm for each.
Project-scoped API keys
Each Langfuse project issues its own API keys, so a pipeline holding a key can write scores only to the project that key belongs to. Keep the public and secret keys in your secrets manager and inject them at runtime, not in repository code, container images or CI logs. Confirm which project each key is bound to and set a rotation process before the first production run.
Custom scores docsPersonal data copied into scores
A score can carry a comment, a category label or a reason text that quotes the user's input or model output, which copies personal data out of the trace and into a second record. Retention and deletion of the trace will not automatically remove text your pipeline wrote into a score comment. Confirm that your evaluator strips or hashes identifiers before writing and that you have a deletion path for score records.
Who can read and edit scores
Project-level RBAC roles, which control who can view, create or edit scores within a project, need an Enterprise license key. Without that key, confirm which users hold project membership and whether they can change scores written by automated evaluators. Decide whether reviewers may overwrite judge-generated values and document who owns each score name.
License key docsNetwork path from pipeline to instance
Pipelines usually run in CI runners, batch jobs or a cluster that is separate from the Langfuse network. Send score requests over TLS to the instance's external or internal address, and allow egress only to that hostname. Confirm the path, the certificate chain your runners trust, and whether the evaluator environment can reach the instance without going through the public internet.
Self-hosting docsAudit trail for score writes
Audit logs that record who changed or created a score need an Enterprise license key. Without them, you cannot easily tell whether a score came from a pipeline, a reviewer or an API call made with a personal key. Confirm whether your edition provides this record, and if not, log score write requests in your pipeline with the run identifier and key name.
Running custom scoring batches without filling your instance with noise
Batch scoring is where custom scores most often go wrong on a self-hosted instance. A backfill job that scores historic traces, a retry after a timeout, or a rerun of a nightly job can each write the same score twice, and the result is a score table that looks populated but no longer means one judgment per trace. Design the job so that rerunning it produces the same end state. Give each score a stable identity built from the trace or observation ID, the score name, and the evaluator version, and make the job check for an existing score with that identity before writing. Use the score id field to make writes deterministic where your SDK or API version supports it, and confirm in the Langfuse scores API reference how duplicate IDs are handled before you rely on it.
Size batches with your instance in mind, not only your job. Each batch adds write load to langfuse-worker and ClickHouse at the same time that live traffic is arriving, so a backfill that is fast in staging can slow ingestion in production. Start with small batches, watch ingestion latency and worker CPU, and increase only when headroom is clear. Langfuse's scaling guide gives minimum resources of 2 CPU and 4 GiB for web, worker and PostgreSQL, and 2 CPU and 8 GiB for ClickHouse, with at least 16 GiB of ClickHouse memory for larger deployments. Treat these as a floor for a small instance, not a capacity plan. Scale workers on CPU load, as the scaling guide recommends, and schedule large backfills outside peak hours.
Monitor writes, not only job completion. A job that reports success can still have rejected payloads, such as a value outside a score config's range or a categorical value missing from its allowed list, so log every rejected or failed write with its trace ID and error, and alert when the failure rate climbs. Record a run identifier on each score through metadata so you can find and remove a bad batch later. Before production use, confirm in the Langfuse self-hosting operations docs which worker and ClickHouse metrics and logs are exposed, how failed ingestion events surface, and what the retention behavior is for scores written by a faulty run.
Limits to confirm before you rely on custom scores
Custom scores depend on SDK methods, score configs, licensing, data lifecycle and instance limits that differ by version and deployment. The cards below list what to confirm on your own self-hosted instance before your evaluation pipeline writes scores that downstream reviews and dashboards will depend on.
Exact SDK methods and target types
Confirm the exact SDK method names, parameters and supported target types for your Langfuse version and SDK release. Custom scores can attach to traces, observations, sessions or dataset runs, but support for each target can vary by SDK and API version. Ask the vendor for the current reference, then write a small test that posts one score to each target type on your own instance and reads it back in the UI and API before your pipeline depends on it.
Custom scores docsScore config edit behavior
Find out what happens to existing scores when a score config is edited. Ask whether changing the allowed categories, numeric range or data type affects scores already stored, and whether the API rejects or accepts writes that no longer match the config. Test an edit on a staging project, then confirm how old and new scores appear in filters, charts and exports before you change a config used by production evaluators.
Enterprise-only score features
The supplied license key docs do not list score ingestion as an Enterprise-only feature, so ask the vendor to confirm in writing whether custom score writes, score configs and score APIs are available under the MIT-licensed open source version. Also confirm whether any related feature, such as RBAC roles that restrict who can write scores or the instance management API, needs a license key. Record the answer with the version you tested.
License key docsScore retention and deletion
Confirm how scores are retained and removed. Ask whether deleting a trace also deletes its attached scores, whether scores follow a project-level retention policy, and whether deleting scores individually is supported through the API. If you handle personal data in evaluation comments or reviewer notes, test a deletion end to end on your instance and check the ClickHouse and blob storage copies, not only the UI view.
Rate and payload limits
Ask the vendor or check on your own deployment what request rate, batch size and payload size the score endpoints accept, and what happens under retries. Evaluation pipelines that score many observations in a burst can create ingestion backlog on the worker. Load test with your expected score volume, watch worker CPU and queue behavior, and set client-side batching and backoff before you scale the evaluator.
Questions teams ask before sending custom scores to Langfuse
How much effort does it take to send the first custom score to Langfuse?
For a single pipeline that already produces a result per trace, the first score is usually a small code change: call the Langfuse SDK or API with a score name, a value and the ID of the trace, observation or session it belongs to. The larger share of effort is agreeing what the score means, defining its name and type, and confirming the scores appear where your team expects them in the UI. Ask any partner to separate that design work from the code change in the quote, because the design work is what determines whether later scores stay comparable.
What drives the effort of sending scores from your evaluation pipelines?
The main drivers are the number of pipelines writing scores, the mix of score types, whether historic results must be backfilled, and how much governance you need. Each pipeline adds its own data mapping and error handling. Numeric, categorical and boolean scores each need consistent value handling, and score configs add a definition step that must be agreed across teams. Batch backfills need a planned job that can be rerun safely. Governance adds naming rules, review of who may create scores, and ownership of changes. Ask for the work to be itemized by these drivers.
What does your internal team need to provide for score work?
You need three things. First, someone who owns score names, types and score configs, since those decisions affect every dashboard and evaluator that reads them. Second, an engineer who owns each evaluation pipeline and can change how it writes results. Third, access to the Langfuse instance with a project and API keys that the pipeline can use, plus a test project or environment for trial runs. Your security team should also confirm how keys are stored in your pipeline runtime before any production write.
Can our own engineers send custom scores without a partner?
Yes, if an engineer who already knows your evaluation code can read the Langfuse custom scores documentation and follow the SDK and API examples for the language your pipeline uses. The parts most teams find harder are consistent naming across several pipelines, idempotent retries when a job fails halfway, and agreeing score configs before the first write. A partner is most useful when those decisions need to be made quickly across several teams, or when your team has no capacity to own the pipeline after the work ends.
How long does a pilot for custom scores take, and what changes its length?
Duration depends on scope, so no fixed figure applies here. A pilot covering one pipeline, a few score types and a shared naming plan is shorter than one that spans several pipelines, requires backfilling months of results, or must pass a governance review before production use. Dependencies also matter: access to the instance, approval of score names by owners of downstream dashboards, and the time your security team needs to review credential handling. Ask any provider to state the pilot scope in writing with its exit criteria before the timeline is agreed.
What does a DeployOpen fixed-scope engagement for custom scores cover?
DeployOpen works from a written scope, so the engagement lists the pipelines in scope, the score types and configs to create, the attachment targets (traces, observations, sessions or dataset runs), the backfill jobs, and the handover material. Deliverables are agreed before work starts, and the quote follows from that scope. Work that is not named in the scope, such as building new evaluators or capturing end-user feedback, would be quoted separately. Ongoing support, upgrades and continuous testing are available as retainers.
Do custom scores need a Langfuse Enterprise license?
No. Sending scores through the SDKs and API and attaching them to traces, observations, sessions or dataset runs is part of the core features that Langfuse describes as available in the MIT-licensed open source version. Enterprise features such as RBAC roles, audit logs and data retention policies need a license key, so check those separately if your score governance depends on them.
How DeployOpen scopes, delivers and supports custom scoring in self-hosted Langfuse
DeployOpen approaches custom scores as part of the self-hosted Langfuse platform, not as a standalone script. We agree the scoring model, the pipelines that produce scores and the operating checks in writing, then build and hand them over inside your infrastructure so your own teams can run and extend them.
How we scope
- Inventory which evaluation pipelines exist and which Langfuse object each result should attach to: trace, observation, session or dataset run.
- Agree the score types for each metric, numeric, categorical or boolean, and who owns the definition of each one.
- Confirm your self-hosted Langfuse version, SDK versions and whether the score config features you need are available on your license.
How we build
- Create score configs for each metric so that scores from different pipelines use the same names, ranges and category labels.
- Write and test the code that sends scores through the SDKs and API, including retries and handling of scores that arrive late.
- Test scores against sample traces in a non-production instance before production pipelines start writing results.
How we hand over
- Document each score config, its meaning, its source pipeline and the Langfuse object it is attached to.
- Walk your engineers through adding a new score, changing a config and checking that scores appear on the right traces.
- Deliver the code, configuration files and runbook in your repositories, under your control.
How we support
- Engagements are fixed-scope, with scope, deliverables and timelines agreed in writing before work starts.
- Ongoing support, upgrades and continuous testing are available as a retainer, including checks after Langfuse and SDK upgrades.
- Ask any partner to confirm how score APIs change between SDK and Langfuse versions before committing to a support arrangement.

