Skip to main content
The Luna Studio SDK gives you a code-first workflow for building custom Luna metrics. You can generate or label training data, fine-tune a Luna metric, evaluate the results, and register the trained metric in Galileo.

What you can do

Install the SDK

Set up the Python package and optional extras for your LLM provider and deployment environment.

Train a Luna metric

Follow the end-to-end workflow for preparing data, configuring the pipeline, and fine-tuning your metric.

Deploy to Galileo

Register a trained Luna metric so it can be used across the Galileo platform.

Browse tutorials

Pick a hands-on guide for your metric input shape, including spans, traces, and sessions.

Minimal example

Copy this sample config to a YAML file called config.yaml:
run_steps:
  - data_generation
  - training

pipeline_provider: "local"
metric_name: "custom"

pipeline:
  pipeline_name: "galileo-luna-ft-sample-run"

data_generation:
  metric:
    name: off_topic_detection
    description:
    type: binary
    input_format: single
    llmaj_source_prompt: "Detect if the user query is off-topic."
  source_data:
    dataset:
      source_type: "huggingface"
      huggingface:
        name: "rungalileo/off-topic-sample"
  generation:
    total_examples: 50
  output:
    push_to_hub: false
    local_path: "./data/generated_data"
    dataset:
      repo_name: off-topic-sample-training
  data_quality_metrics:
    enabled: false

training:
  metric:
    type: boolean
  dataset:
    name: off-topic-sample-training
    local: true
    local_path: "./data/generated_data"
  prompt_template:
  output:
    model_name: "off-topic-detection-galileo-luna-ft"
    push_to_hub: false
    local_path: finetuned_models
  training:
    num_train_epochs: 1
    use_wandb: false

Where to go next

Installation

Install the package and choose the right optional extras.

How to train your Luna metric

Understand the full workflow for data generation and training.

Deployment

Learn how to register the trained model in Galileo.

Tutorials

Jump straight to an example that matches your input shape.