LLM Observability is not available in the selected site () at this time.
Overview
In the context of LLM applications, it’s important to track user feedback and evaluate the quality of your LLM application’s responses.
While LLM Observability provides a few out-of-the-box evaluations for your traces, you can submit your own evaluations to LLM Observability in two ways: with Datadog’s Python SDK, or with the LLM Observability API. See Naming custom metrics for guidelines on how to choose an appropriate label for your evaluations.
Submitting evaluations with the SDK
To submit evaluations from your traced LLM application to Datadog, you’ll need to associate it with a span using the below steps:
Extract the span context from the given span by using LLMObs.export_span(span). If span is not provided (as when using function decorators), the SDK exports the current active span. See Exporting a span for more details.
Use LLMObs.submit_evaluation() with the extracted span context and evaluation information. See Submitting evaluations in the SDK documentation for details.
Example
fromddtrace.llmobsimportLLMObsfromddtrace.llmobs.decoratorsimportllm@llm(model_name="claude",name="invoke_llm",model_provider="anthropic")defllm_call():completion=...# user application logic to invoke LLMspan_context=LLMObs.export_span(span=None)LLMObs.submit_evaluation(span_context,label="sentiment",metric_type="score",value=10,)returncompletion
Submitting evaluations with the API
You can use the evaluations API provided by LLM Observability to send evaluations associated with spans to Datadog. See the Evaluations API for more details on the API specifications.