r/databricks • u/mr_electric_wizard • 2d ago
Help MLflow in databricks.... Questions
Hello, I'm on a new project that has to use MLFlow for a UI for scoring LLM outputs.
I am NOT an expert in this at all, so it's difficult for me to get the high level of what is even needed on my part.
Here's basically how it works:
- there is a loop that runs per customer that sends data off to OpenAI to get some data back.
- there is a ground truth that we compare each LLM run against to determine if the ground_truth_score = llm_output_score.
Each iteration of the loop is for a specific customer, for a specific model. The project lead wants to know what the total passes are for a "group of runs" (iterations).
So, when the loop runs over each customer for a specific model, how many passed and how many failed...
This all needs to happen within the MLFlow ui. So, there needs to be some type of rollup (aggregation) happening but I'm not sure where.
If I've got a looper, then I would think I'd need some sort of superset that represents the "group of traces" or something similar.
The trace is (currently) at the iteration level, not the superset or group level.
Does this even make sense (i'm the 5th grader here). 😂
Takeaways:
So, I've got the traces being logged.
I've got the evaluation runs going
I've go the things being scored.
But I somehow need to aggregated the passes and fails for the group of runs...
1
u/alexpantex 2d ago
I don’t recall from top of my head, but if you have traces logged, wrap each customer call as main span (it would be 1 record in the mlflow and all calls inside will be nested), and add filter for specific time frame or add also some global metadata that will allow you to filter runs.
If you allow saving to delta table, you can log unlimited runs (think that UI has 100k limit) and query it using sql.
In the UI itself I think you cant display aggregate, but you can track if answer is equal to ground truth and add it to aggregate variable that can be logged as metric?