The easy-to-use open source Business Intelligence and Embedded Analytics tool that lets everyone work with data :bar_chart:
TypeScript analyticsbibusiness-intelligencebusinessintelligenceclojuredashboarddatadata-analysisdata-visualizationdatabasemetabasemysqlpostgrespostgresqlreportingslacksql-editorvisualization
Use mini LLM model for Explorations contextual interestingness (#83292)
Kevin Kelleher25d804d4757a
diff --git a/src/metabase/contextual_interestingness/llm.clj b/src/metabase/contextual_interestingness/llm.cljindex f80aa62d50c..5bdf5c69d02 100644--- a/src/metabase/contextual_interestingness/llm.clj+++ b/src/metabase/contextual_interestingness/llm.clj@@ -167,7 +167,7 @@ Always return a single object matching the supplied schema. Do not respond with[{:keys [card-description] :as inputs}](try(let [response (metabot.self/call-llm-structured- (metabot.settings/llm-metabot-provider)+ (metabot.settings/llm-mini-model)[{:role "system" :content rubric-preamble}{:role "user" :content (build-user-message inputs)}](response-schema (str/blank? card-description))diff --git a/test/metabase/contextual_interestingness/core_test.clj b/test/metabase/contextual_interestingness/core_test.cljindex e81f6fbfd65..5a5739fdbe3 100644--- a/test/metabase/contextual_interestingness/core_test.clj+++ b/test/metabase/contextual_interestingness/core_test.clj@@ -130,6 +130,21 @@(is (= "Monthly revenue trend over the past year" (:chart-description out)))(is (= "Total monthly revenue from completed orders" (:metric-description out)))))))))+(deftest score-and-describe-uses-mini-model-test+ (testing "scoring runs on the quick-task model, not the Metabot chat model"+ (let [model (atom nil)]+ (mt/with-temporary-setting-values [llm-metabot-provider "anthropic/claude-sonnet-4-6"+ llm-mini-model "anthropic/claude-haiku-4-5-20251001"]+ (mt/with-dynamic-fn-redefs+ [metabot.self/call-llm-structured+ (fn [provider-and-model & _]+ (reset! model provider-and-model)+ {:score 0.5 :chart_description "c" :reasoning "x"})]+ (with-llm-configured!+ (fn []+ (call {})+ (is (= "anthropic/claude-haiku-4-5-20251001" @model)))))))))+(deftest score-and-describe-with-card-description-test(testing "When card-description is provided, the schema does not require metric_description and parse-response surfaces it as nil"(mt/with-dynamic-fn-redefs