Skip to Content
FabricFabricExperiments
AI Quality

Databricks-native AI quality

Keep MLflow, Unity Catalog, Model Serving, and AI Gateway authoritative while Fabric adds TypeScript automation and cross-workload release gates.

Fabric Experiments is an adoption accelerator for Databricks, not a replacement for Databricks AI tooling. Managed MLflow remains authoritative for native evaluation runs, scorers, traces, evaluation datasets, feedback, and model lineage. Unity Catalog remains the governance boundary. Model Serving and AI Gateway remain the inference and serving-governance layer.

Fabric adds the parts that span those native surfaces: TypeScript developer workflows, Databricks workload tests, A/B experiment guardrails, durable automation, and one Quality Center release decision.

Choose the native path first

Use managed MLflow when a capability is already available there:

  • create and version evaluation datasets;
  • run built-in, custom, or multi-turn scorers;
  • retain traces and human feedback;
  • compare model or agent versions;
  • continuously score production traces;
  • preserve model, prompt, dataset, and run lineage.

Use Fabric around that run when you need to combine its outcome with BDD, Lakeflow, SQL, Delta, Jobs, application, security, recovery, or A/B experiment evidence before a release is promoted.

First create and evaluate the run using Databricks and MLflow. Then define the small release policy Fabric should enforce over metrics recorded on that run:

export DATABRICKS_HOST="https://adb-<workspace-id>.<region>.azuredatabricks.net"
export DATABRICKS_TOKEN="..." # OAuth M2M is recommended for CI

fx login --profile production
fx test import-mlflow <run-id> \
  --workspace-host "$DATABRICKS_HOST" \
  --gates "accuracy>=0.90,toxicity<=0.02" \
  --suite "Support agent release quality"

For OAuth M2M, set DATABRICKS_CLIENT_ID and DATABRICKS_CLIENT_SECRET instead of DATABRICKS_TOKEN. The service principal needs permission to read the MLflow experiment and run. The Fabric publisher key only needs permission to publish Quality Center evidence for its organization; the two credentials have separate trust boundaries.

The command exits with:

  • 0 when the native run is terminal and every configured metric gate passes;
  • 2 when a gate fails or a required metric is missing;
  • 1 for configuration or usage errors.

What Fabric stores

The published Quality Center row contains:

  • the Databricks workspace and managed MLflow run and experiment identifiers;
  • the native run status;
  • each metric name, operator, threshold, and observed value;
  • an immutable external id, databricks-mlflow:<run-id>, for idempotent CI retries;
  • a deep link back to the native MLflow run.

Fabric does not copy MLflow artifacts, traces, datasets, scorer implementations, or model lineage. evidenceOwnership: databricks is recorded on the Quality row so Studio and downstream audit exports preserve that boundary.

Missing metrics fail closed. Re-running the command updates the same Quality row because publication is idempotent on the native run id.

Score precomputed TypeScript outputs in managed MLflow

Generate outputs in Node using your application's configured provider. Build RunItem[] from the cases and the returned outputs, then use the Databricks subpath of @fabricorg/experiments-evals to write the scoring input:

import { writeFile } from 'node:fs/promises';
import {
  buildMlflowEvaluationRecords,
  serializeMlflowEvaluationRecords,
} from '@fabricorg/experiments-evals/databricks';
import { generateAnswer } from './my-provider.js'; // Your configured provider adapter

const inputs = { question: 'What is the capital of France?' };
const output = await generateAnswer(inputs);
const items = [{
  itemId: 'capital-france',
  input: { input: inputs, output, expectedOutput: 'Paris' },
}];
const records = buildMlflowEvaluationRecords(items, {
  datasetId: 'geography',
  datasetVersion: 1,
});
await writeFile('records.jsonl', serializeMlflowEvaluationRecords(records));

For a generation phase result, pass generation.items and set modelEndpoint: generation.modelEndpoint. If you also run TypeScript evaluators, pass execution: { result: execution, evaluators } and optionally a passThreshold. Run executeEvalRun with trials: 1 and supply the same evaluator list to the exporter. The v1 exporter rejects scores and failures with a later trial index. The exporter fills evaluator pairs with a null score when the runner recorded a failure or skipped evaluation for budget. Failure messages stay in Node. Use scores to supply independent results. An evaluator named in those results is expected on each record. For items produced by @fabricorg/experiments-harness-evals, a caller can map the observed metadata explicitly:

itemProvenance: ({ input }) => {
  const { promptId, promptVersion, model } = input.metadata ?? {};
  return {
    ...(typeof promptId === 'string' ? { promptId } : {}),
    ...(typeof promptVersion === 'string' || typeof promptVersion === 'number'
      ? { promptVersion }
      : {}),
    ...(typeof model === 'string' ? { model } : {}),
  };
},

The exporter preserves plain-object inputs, wraps other JSON inputs as { input: value }, and preserves outputs as supplied. When present, expectedOutput becomes expectations.expected_response. Choose mapInputs, mapOutputs, or mapExpectations to adapt the data to your selected scorer. For example, correctness reads an expected response or expected facts. The MLflow scorer API documents scorer-specific expectations.

Upload the JSONL to a Unity Catalog volume that may hold the application's inputs, outputs, expectations, and provenance. Keep credentials out of those fields and the caller's tag values. Use a Job identity with read access to the volume and write access to the MLflow experiment.

databricks fs cp records.jsonl dbfs:/Volumes/catalog/schema/evaluations/records.jsonl

Copy templates/databricks/mlflow_evaluate_records.py from the installed @fabricorg/experiments-evals package into Workspace Files. Point a serverless Python script task at that file. This Databricks bundle resource selects the built-in correctness scorer. The same parameter accepts comma-separated correctness, safety, and registered:<name> entries. Registered scorers are looked up in the selected experiment.

resources:
  jobs:
    score_node_outputs:
      name: Score Node outputs
      tasks:
        - task_key: score_records
          environment_key: scoring
          spark_python_task:
            python_file: /Workspace/Shared/mlflow_evaluate_records.py
            parameters:
              - --records-path
              - /Volumes/catalog/schema/evaluations/records.jsonl
              - --experiment
              - /Shared/node-output-evaluation
              - --run-name
              - geography-v1
              - --scorers
              - correctness
      environments:
        - environment_key: scoring
          spec:
            environment_version: "4"
            dependencies:
              - "mlflow[databricks]==3.18.0"

The template requires MLflow 3.18.0. It checks that version because its coverage check reads the result frame's trace tags and feedback assessments. For a registered scorer, choose a scorer that reports a numeric or yes/no assessment under its own name, with a run aggregate for that name. Use expected_response or expected_facts on each case when selecting correctness.

An empty file, malformed line, or unsupported format raises before a run starts. Inside the active run, the template logs caller metrics and verifies that each native aggregate has one usable assessment per input record. A missing assessment, scorer error, unexpected result layout, or incomplete caller coverage raises inside the active run and makes it FAILED. The script prints the run ID on success. For a failed job, use the run ID shown by MLflow to inspect the failure and recorded counts.

Use the printed ID with the authenticated CLI. MLflow documents correctness/mean as a run metric. Tune thresholds for your dataset and scorer:

fx test import-mlflow <run-id> \
  --workspace-host "$DATABRICKS_HOST" \
  --gates 'correctness/mean>=0.90' \
  --suite 'Node output quality'

The CLI rejects a FAILED run even when its aggregate clears the numeric threshold. When you also use a caller evaluator named schema, include its coverage counts alongside its pass rate:

fx test import-mlflow <run-id> \
  --workspace-host "$DATABRICKS_HOST" \
  --gates 'correctness/mean>=0.90,caller/schema/pass_rate>=0.90,caller/schema/unscored==0,caller/schema/missing==0' \
  --suite 'Node output and schema quality'

For each caller evaluator, caller/<name>/scored, /unscored, and /missing distinguish numeric results, null results, and absent entries. The mean uses numeric results and is absent when there are none. If a pass threshold was supplied, the pass rate divides the number of passes by the full record count. Names outside ASCII letters, digits, _, ., and - use caller/utf8/<lowercase-UTF-8-hex>/ as the metric prefix. Inspect the run metrics for other managed scorer names before setting gates.

The version 1 record tags are fabric.record_format_version, fabric.dataset_id, fabric.dataset_version, and the optional fabric.dataset_version_hash, fabric.model_endpoint, fabric.prompt_id, fabric.prompt_version, and fabric.model. Supply custom tags and metadata with the builder's tags and metadata callbacks. The serializer also accepts plain RAG records with inputs, outputs, optional expectations, string tags, and object metadata, and stamps their format version. The exporter reserves fabric.* tags and the metadata.itemId and metadata.scores keys. The template promotes shared tags to the run and passes per-record tags to MLflow for its traces. Caller score metadata stays outside the evaluation data.

TypeScript evaluators remain an integration option

The provider-neutral evaluator contract is useful when a TypeScript application needs deterministic code checks, local CI, or a scorer that must run inside its existing Node workflow. For the hosted Fabric evaluation runner, LLM judge calls use Databricks Model Serving and scores persist to Databricks SQL and Delta. Node callers can also export their own evaluator results alongside precomputed outputs for the managed MLflow job.

That path complements managed MLflow; it does not redefine MLflow APIs or AI Gateway controls. Prefer native managed MLflow evaluation when it satisfies the use case, and use the TypeScript path for application-side orchestration or cross-workload checks that are not represented by a native scorer.

Release architecture

One evidence path

Databricks stays authoritative

Native-first
  1. 01Run and govern on Databricks

    The workload, evaluation artifacts, lineage, and access controls remain in Databricks.

    • Model Serving + AI Gateway
    • Managed MLflow evaluation + traces
    • Unity Catalog governance
  2. 02Connect the evidence

    Fabric links native results with application and data-workload checks without copying MLflow artifacts.

    • fx test import-mlflow
    • TypeScript BDD + target packs
    • A/B experiment guardrails
  3. 03Make one release decision

    Quality Center applies tenant-scoped freshness and pass policies across every linked signal.

    Promote, hold, or investigateDeep links return engineers to the native Databricks evidence.
Fabric coordinates the release gate; Databricks remains the system of record for execution, AI quality, lineage, and governance.

The result is more Databricks usage—not a parallel model platform: teams use native Model Serving, MLflow, Unity Catalog, AI Gateway, SQL, Delta, and Lakeflow while Fabric shortens the path from development evidence to a safe production decision.

On this page