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
[BOT-2144] Add Claude Fable 5.1 support to Metabot (#83836)
Voytek Pituła196533f57710
diff --git a/docs/ai/providers.md b/docs/ai/providers.mdindex 1f186b16105..9118a613713 100644--- a/docs/ai/providers.md+++ b/docs/ai/providers.md@@ -28,6 +28,7 @@ Supported models:| Model | Model ID | Context window (tokens) || ----------------- | ---------------------------- | ----------------------- || Claude Fable 5 | `claude-fable-5` | 1,000,000 |+| Claude Fable 5.1 | `claude-fable-5-1` | 1,000,000 || Claude Haiku 4.5 | `claude-haiku-4-5-20251001` | 200,000 || Claude Opus 4.1 | `claude-opus-4-1-20250805` | 200,000 || Claude Opus 4.5 | `claude-opus-4-5-20251101` | 200,000 |@@ -82,6 +83,7 @@ Supported models:| Model | Model ID | Context window (tokens) || ---------------------- | --------------------------------- | ----------------------- || Claude Fable 5 | `anthropic/claude-fable-5` | 1,000,000 |+| Claude Fable 5.1 | `anthropic/claude-fable-5.1` | 1,000,000 || Claude Haiku 4.5 | `anthropic/claude-haiku-4.5` | 200,000 || Claude Opus 4.1 | `anthropic/claude-opus-4.1` | 200,000 || Claude Opus 4.5 | `anthropic/claude-opus-4.5` | 200,000 |@@ -213,6 +215,7 @@ Supported models:| Model | Model ID || ----------------- | ------------------------------------- || Claude Fable 5 | `anthropic/claude-fable-5` |+| Claude Fable 5.1 | `anthropic/claude-fable-5-1` || Claude Haiku 4.5 | `anthropic/claude-haiku-4-5@20251001` || Claude Opus 4.6 | `anthropic/claude-opus-4-6` || Claude Opus 5 | `anthropic/claude-opus-5` |@@ -274,6 +277,7 @@ Supported models:| Model | Model ID | Context window (tokens) || -------------------- | ----------------------------- | ----------------------- || Claude Fable 5 | `anthropic.claude-fable-5` | 1,000,000 |+| Claude Fable 5.1 | `anthropic.claude-fable-5-1` | 1,000,000 || Claude Haiku 4.5 | `anthropic.claude-haiku-4-5` | 200,000 || Claude Opus 4.7 | `anthropic.claude-opus-4-7` | 1,000,000 || Claude Opus 4.8 | `anthropic.claude-opus-4-8` | 1,000,000 |diff --git a/src/metabase/llm/provider.clj b/src/metabase/llm/provider.cljindex d992aa62926..bf0496768f8 100644--- a/src/metabase/llm/provider.clj+++ b/src/metabase/llm/provider.clj@@ -214,6 +214,7 @@:models [{:id "google/gemini-3.5-flash" :display_name "Gemini 3.5 Flash"}{:id "google/gemini-3.6-flash" :display_name "Gemini 3.6 Flash"}{:id "google/gemini-3.7-flash" :display_name "Gemini 3.7 Flash"}+ {:id "anthropic/claude-fable-5-1" :display_name "Claude Fable 5.1"}{:id "anthropic/claude-fable-5" :display_name "Claude Fable 5"}{:id "anthropic/claude-opus-5-5" :display_name "Claude Opus 5.5"}{:id "anthropic/claude-opus-5" :display_name "Claude Opus 5"}diff --git a/src/metabase/metabot/self/azure.clj b/src/metabase/metabot/self/azure.cljindex ea9809ae36b..90b9b17ca55 100644--- a/src/metabase/metabot/self/azure.clj+++ b/src/metabase/metabot/self/azure.clj@@ -76,7 +76,8 @@"Input context windows for the models Azure sells, keyed by model id.GPT values are max input tokens (Microsoft's listed windows are input + output totals):https://learn.microsoft.com/en-us/azure/foundry/foundry-models/concepts/models-sold-directly-by-azure"- {"claude-fable-5" 1000000+ {"claude-fable-5-1" 1000000+ "claude-fable-5" 1000000"claude-opus-5-5" 1000000"claude-opus-5" 1000000"claude-opus-4-8" 1000000diff --git a/src/metabase/metabot/self/bedrock.clj b/src/metabase/metabot/self/bedrock.cljindex fd50d788eaf..99841f9b469 100644--- a/src/metabase/metabot/self/bedrock.clj+++ b/src/metabase/metabot/self/bedrock.clj@@ -320,7 +320,8 @@`list-models` returns the intersection of this map with the mantle `/v1/models` catalog.Excludes `openai.gpt-oss*`, which are not invokable through the mantle `/openai/v1` routes.Context windows are from the per-model cards at https://docs.aws.amazon.com/bedrock/latest/userguide/model-cards.html"- {"anthropic.claude-fable-5" {:display-name "Claude Fable 5" :context-window 1000000}+ {"anthropic.claude-fable-5-1" {:display-name "Claude Fable 5.1" :context-window 1000000}+ "anthropic.claude-fable-5" {:display-name "Claude Fable 5" :context-window 1000000}"anthropic.claude-opus-5-5" {:display-name "Claude Opus 5.5" :context-window 1000000}"anthropic.claude-opus-5" {:display-name "Claude Opus 5" :context-window 1000000}"anthropic.claude-opus-4-8" {:display-name "Claude Opus 4.8" :context-window 1000000}diff --git a/src/metabase/metabot/self/claude.clj b/src/metabase/metabot/self/claude.cljindex 82e36c9ecb2..15f232483e8 100644--- a/src/metabase/metabot/self/claude.clj+++ b/src/metabase/metabot/self/claude.clj@@ -347,7 +347,8 @@(def supported-models"Anthropic chat models offered in the Metabot model picker, keyed by model id.`list-models` returns the intersection of this map with the account's `/v1/models` catalog."- {"claude-fable-5" {:display-name "Claude Fable 5" :max-tokens 128000 :context-window 1000000}+ {"claude-fable-5-1" {:display-name "Claude Fable 5.1" :max-tokens 128000 :context-window 1000000}+ "claude-fable-5" {:display-name "Claude Fable 5" :max-tokens 128000 :context-window 1000000}"claude-opus-5-5" {:display-name "Claude Opus 5.5" :max-tokens 128000 :context-window 1000000}"claude-opus-5" {:display-name "Claude Opus 5" :max-tokens 128000 :context-window 1000000}"claude-opus-4-8" {:display-name "Claude Opus 4.8" :max-tokens 128000 :context-window 1000000}@@ -394,25 +395,26 @@(get-in supported-models [(strip-vendor-prefix model) :context-window]))(defn- claude-model-version- "`[family major minor]` for a Claude opus/sonnet model id, or nil.+ "`[family major minor]` for a Claude opus/sonnet/fable/mythos model id, or nil.The minor version is one or two digits, so a date suffix doesn't read as one: `claude-opus-5-20261005` is 5.0."[model];; the minor version accepts both separators: canonical ids are hyphenated (claude-opus-4-8);; but Azure admins name deployments freely, and the dotted display-name spelling;; (claude-opus-4.8) is the norm for the GPT family next to it- (when-let [[_ family major minor] (re-find #"^claude-(opus|sonnet)-(\d+)(?:[-.](\d{1,2})(?!\d))?"+ (when-let [[_ family major minor] (re-find #"^claude-(opus|sonnet|fable|mythos)-(\d+)(?:[-.](\d{1,2})(?!\d))?"(strip-vendor-prefix model))][family (parse-long major) (or (some-> minor parse-long) 0)]))(defn- model-current-gen?- "Current-generation Claude (Fable, Opus >=4.7, Sonnet >=5): no sampling params;+ "Current-generation Claude (Fable, Mythos, Opus >=4.7, Sonnet >=5): no sampling params;thinking streams via `display: summarized`."[model](or (str/starts-with? (strip-vendor-prefix model) "claude-fable")(when-let [[family major minor] (claude-model-version model)](case family- "opus" (or (> major 4) (and (= major 4) (>= minor 7)))- "sonnet" (>= major 5)))))+ ("fable" "mythos") true+ "opus" (or (> major 4) (and (= major 4) (>= minor 7)))+ "sonnet" (>= major 5)))))(defn- model-supports-temperature?"Whether `model` accepts an explicit `temperature` parameter. Sampling params@@ -421,10 +423,12 @@(not (model-current-gen? model)))(defn- model-supports-forced-tool-choice?- "Whether `model` accepts a forced `tool_choice` (`any`, or a named tool). Opus and Sonnet reject one from 5.5 on."+ "Whether `model` accepts a forced `tool_choice` (`any`, or a named tool). Opus and Sonnet reject one from 5.5 on,+ Fable and Mythos from 5.1 on: https://platform.claude.com/docs/en/api/errors#forced-tool-use-not-supported"[model]- (if-let [[_ major minor] (claude-model-version model)]- (or (< major 5) (and (= major 5) (< minor 5)))+ (if-let [[family major minor] (claude-model-version model)]+ (let [first-rejecting-minor (if (#{"fable" "mythos"} family) 1 5)]+ (or (< major 5) (and (= major 5) (< minor first-rejecting-minor))))true))(def ^:private unforced-structured-output-token-floordiff --git a/src/metabase/metabot/self/openrouter.clj b/src/metabase/metabot/self/openrouter.cljindex 2455adb1cb2..2504ade2d72 100644--- a/src/metabase/metabot/self/openrouter.clj+++ b/src/metabase/metabot/self/openrouter.clj@@ -60,7 +60,8 @@and would need an explicit token budget.`:reasoning-mandatory?` marks models where `reasoning {:enabled false}` is rejected with a 400.`:required-tool-choice? false` marks models that don't support `:tool_choice \"required\"`; absent means they do."- {"anthropic/claude-fable-5" {:display-name "Claude Fable 5" :context-window 1000000 :reasoning :renderable :reasoning-mandatory? true}+ {"anthropic/claude-fable-5.1" {:display-name "Claude Fable 5.1" :context-window 1000000 :reasoning :renderable :reasoning-mandatory? true :required-tool-choice? false}+ "anthropic/claude-fable-5" {:display-name "Claude Fable 5" :context-window 1000000 :reasoning :renderable :reasoning-mandatory? true}"anthropic/claude-opus-5" {:display-name "Claude Opus 5" :context-window 1000000 :reasoning :renderable}"anthropic/claude-opus-4.8" {:display-name "Claude Opus 4.8" :context-window 1000000 :reasoning :renderable}"anthropic/claude-opus-4.7" {:display-name "Claude Opus 4.7" :context-window 1000000 :reasoning :renderable}diff --git a/test/metabase/llm/api/provider_test.clj b/test/metabase/llm/api/provider_test.cljindex c0e9fb5d101..87c4ea0beac 100644--- a/test/metabase/llm/api/provider_test.clj+++ b/test/metabase/llm/api/provider_test.clj@@ -149,6 +149,7 @@(is (= [{:id "google/gemini-3.5-flash" :display_name "Gemini 3.5 Flash"}{:id "google/gemini-3.6-flash" :display_name "Gemini 3.6 Flash"}{:id "google/gemini-3.7-flash" :display_name "Gemini 3.7 Flash"}+ {:id "anthropic/claude-fable-5-1" :display_name "Claude Fable 5.1"}{:id "anthropic/claude-fable-5" :display_name "Claude Fable 5"}{:id "anthropic/claude-opus-5-5" :display_name "Claude Opus 5.5"}{:id "anthropic/claude-opus-5" :display_name "Claude Opus 5"}@@ -1315,6 +1316,7 @@:models [{:id "google/gemini-3.5-flash" :display_name "Gemini 3.5 Flash"}{:id "google/gemini-3.6-flash" :display_name "Gemini 3.6 Flash"}{:id "google/gemini-3.7-flash" :display_name "Gemini 3.7 Flash"}+ {:id "anthropic/claude-fable-5-1" :display_name "Claude Fable 5.1"}{:id "anthropic/claude-fable-5" :display_name "Claude Fable 5"}{:id "anthropic/claude-opus-5-5" :display_name "Claude Opus 5.5"}{:id "anthropic/claude-opus-5" :display_name "Claude Opus 5"}@@ -1339,7 +1341,7 @@:project-id "my-project":location "us-east5":probed-model "anthropic/claude-sonnet-4-6"})]]- (is (=? [{:key "claude-only" :models [{:id "google/gemini-3.5-flash"} some? some? some? some? some? some? some? some? some? some?]}]+ (is (=? [{:key "claude-only" :models [{:id "google/gemini-3.5-flash"} some? some? some? some? some? some? some? some? some? some? some?]}](mt/user-http-request :crowberto :get 200 "llm/models")))(is (= "anthropic/claude-sonnet-4-6" @probed)))))))@@ -1383,7 +1385,7 @@:project-id "my-project"})]](mt/with-temporary-raw-setting-values [llm-metabot-provider "wrong-model-google/anthropic/claude-opus-5"](is (=? [{:key "wrong-model-google"- :models [{:id "google/gemini-3.5-flash"} some? some? some? some? some? some? some? some? some? some?]+ :models [{:id "google/gemini-3.5-flash"} some? some? some? some? some? some? some? some? some? some? some?]:error "Google API error: model not found"}](mt/user-http-request :crowberto :get 200 "llm/models"))))))))@@ -1399,7 +1401,7 @@:project-id "my-project"})]](mt/with-temporary-raw-setting-values [llm-metabot-provider "forbidden-model-google/anthropic/claude-opus-5"](is (=? [{:key "forbidden-model-google"- :models [{:id "google/gemini-3.5-flash"} some? some? some? some? some? some? some? some? some? some?]+ :models [{:id "google/gemini-3.5-flash"} some? some? some? some? some? some? some? some? some? some? some?]:error "Google API error: PERMISSION_DENIED"}](mt/user-http-request :crowberto :get 200 "llm/models"))))))))@@ -1416,7 +1418,7 @@(is (=? [{:key "bad-key-google":name "bad-key-google":type "google"- :models [{:id "google/gemini-3.5-flash"} some? some? some? some? some? some? some? some? some? some?]+ :models [{:id "google/gemini-3.5-flash"} some? some? some? some? some? some? some? some? some? some? some?]:error "Google API error: invalid authentication credentials"}](mt/user-http-request :crowberto :get 200 "llm/models")))))))diff --git a/test/metabase/metabot/self/azure_test.clj b/test/metabase/metabot/self/azure_test.cljindex 5941b8ed236..1ff0c21862f 100644--- a/test/metabase/metabot/self/azure_test.clj+++ b/test/metabase/metabot/self/azure_test.clj@@ -249,6 +249,14 @@:input [{:role :user :content "hi"}]})))](is (not (contains? body :speed))))))+(deftest ^:parallel context-window-tokens-test+ (testing "the longest model id that prefixes the deployment name decides"+ (are [model tokens] (= tokens (azure/context-window-tokens model))+ "anthropic/claude-fable-5-1" 1000000+ "openai/gpt-5.4" 922000+ "openai/gpt-5.4-mini-2026-03-17" 272000+ "anthropic/my-deployment" nil)))+(deftest unsupported-family-throws-test(is (thrown-with-msg?clojure.lang.ExceptionInfodiff --git a/test/metabase/metabot/self/claude_test.clj b/test/metabase/metabot/self/claude_test.cljindex a8429f83a67..157f610e412 100644--- a/test/metabase/metabot/self/claude_test.clj+++ b/test/metabase/metabot/self/claude_test.clj@@ -651,15 +651,18 @@tools [(metabot.tu/get-time-tool)]body #(claude/claude-request-body (merge {:input [{:role :user :content "hi"}]} %))](testing "structured output and a required tool choice force the call, including on date-suffixed 5.0 names"- (doseq [model ["claude-opus-5" "claude-sonnet-5" "claude-opus-5-20261005" "claude-sonnet-5-2026-10-05"]]+ (doseq [model ["claude-opus-5" "claude-sonnet-5" "claude-opus-5-20261005" "claude-sonnet-5-2026-10-05"+ "claude-fable-5" "claude-mythos-5"]](testing model(is (=? {:tool_choice {:type "tool" :name "structured_output"} :max_tokens 512}(body {:model model :schema schema :max-tokens 512})))(is (=? {:tool_choice {:type "any"}}(body {:model model :tools tools :tool_choice "required"}))))))- (testing "Opus and Sonnet from 5.5 reject a forced tool choice, so they get auto and keep thinking"+ (testing "Opus/Sonnet >=5.5 and Fable/Mythos >=5.1 get auto tool choice and keep thinking"(doseq [model ["claude-opus-5-5" "claude-sonnet-5-5" "anthropic.claude-sonnet-5-5" "claude-opus-5.5"- "claude-opus-5-5-20261005" "claude-sonnet-5-5-2026-10-05"]]+ "claude-opus-5-5-20261005" "claude-sonnet-5-5-2026-10-05"+ "claude-fable-5-1" "anthropic.claude-fable-5-1" "claude-fable-5-1-prod" "claude-fable-5.1-prod"+ "claude-mythos-5-1"]](testing model(is (=? {:tool_choice {:type "auto"}:tools [{:name "structured_output"}]@@ -684,6 +687,7 @@(merge {:input [{:role :user :content "hi"}]} %)))](are [opts tokens] (= tokens (max-tokens opts)){:model "claude-opus-4-8"} 128000+ {:model "claude-fable-5-1"} 128000{:model "claude-haiku-4-5-20251001"} 64000{:model "claude-opus-4-8" :max-tokens 32000} 32000;; Bedrock ids reach us vendor-prefixed@@ -875,7 +879,9 @@(doseq [model ["claude-opus-4-7" "claude-opus-4-8" "claude-opus-4-8-20260415""claude-opus-5" "claude-opus-5-0" "claude-opus-5-5""claude-sonnet-5" "claude-sonnet-5-0" "claude-sonnet-5-5" "claude-sonnet-6"- "claude-fable-5"]]+ "claude-fable-5" "claude-fable-5-1" "claude-mythos-5-1"+ ;; an Azure deployment name without a version+ "claude-fable-prod"]](is (false? (#'claude/model-supports-temperature? model))model))))diff --git a/test/metabase/metabot/self/openrouter_test.clj b/test/metabase/metabot/self/openrouter_test.cljindex be6f10cac41..bc7329df5d8 100644--- a/test/metabase/metabot/self/openrouter_test.clj+++ b/test/metabase/metabot/self/openrouter_test.clj@@ -124,26 +124,30 @@;;; ──────────────────────────────────────────────────────────────────(deftest ^:parallel request-body-no-required-tool-choice-model-downgrades-schema-tool-choice-test- (testing "the structured-output forced tool call is downgraded to auto for qwen3.8-max"- (let [body (openrouter/openrouter-request-body- {:model "qwen/qwen3.8-max-0902"- :input [{:role :user :content "hi"}]- :schema {:type "object" :properties {:answer {:type "string"}}}})]- (is (=? {:tool_choice "auto"- :tools [{:function {:name "structured_output"}}]}- body)))))+ (testing "the structured-output forced tool call is downgraded to auto"+ (doseq [model ["qwen/qwen3.8-max-0902" "anthropic/claude-fable-5.1"]]+ (testing model+ (let [body (openrouter/openrouter-request-body+ {:model model+ :input [{:role :user :content "hi"}]+ :schema {:type "object" :properties {:answer {:type "string"}}}})]+ (is (=? {:tool_choice "auto"+ :tools [{:function {:name "structured_output"}}]}+ body)))))))(deftest ^:parallel request-body-no-required-tool-choice-model-downgrades-explicit-tool-choice-test(testing "an explicit tool_choice required is downgraded too"- (let [body (openrouter/openrouter-request-body- {:model "qwen/qwen3.8-max-0902"- :input [{:role :user :content "hi"}]- :tools [{:tool-name "get_thing"- :doc "Get a thing."- :schema [:=> [:cat [:map [:id :int]]] :any]- :fn identity}]- :tool_choice "required"})]- (is (= "auto" (:tool_choice body))))))+ (doseq [model ["qwen/qwen3.8-max-0902" "anthropic/claude-fable-5.1"]]+ (testing model+ (let [body (openrouter/openrouter-request-body+ {:model model+ :input [{:role :user :content "hi"}]+ :tools [{:tool-name "get_thing"+ :doc "Get a thing."+ :schema [:=> [:cat [:map [:id :int]]] :any]+ :fn identity}]+ :tool_choice "required"})]+ (is (= "auto" (:tool_choice body))))))))(deftest ^:parallel request-body-no-required-tool-choice-model-leaves-auto-tool-choice-test(testing "a tool_choice that is already auto is left alone for qwen3.8-max"@@ -159,7 +163,7 @@(deftest ^:parallel request-body-other-models-keep-required-tool-choice-test(testing "models that accept a forced tool call keep tool_choice required"- (doseq [model ["anthropic/claude-haiku-4.5" "openai/gpt-5.4" "z-ai/glm-5.2"]]+ (doseq [model ["anthropic/claude-haiku-4.5" "anthropic/claude-fable-5" "openai/gpt-5.4" "z-ai/glm-5.2"]](testing model(let [body (openrouter/openrouter-request-body{:model model@@ -262,8 +266,9 @@(deftest ^:parallel reasoning-class-partition-test(testing "every whitelisted model is deliberately classified, and the class drives the body"- (let [renderable #{"anthropic/claude-fable-5" "anthropic/claude-opus-5" "anthropic/claude-opus-4.8"- "anthropic/claude-opus-4.7" "anthropic/claude-opus-4.6" "anthropic/claude-sonnet-5"+ (let [renderable #{"anthropic/claude-fable-5.1" "anthropic/claude-fable-5" "anthropic/claude-opus-5"+ "anthropic/claude-opus-4.8" "anthropic/claude-opus-4.7" "anthropic/claude-opus-4.6"+ "anthropic/claude-sonnet-5""anthropic/claude-sonnet-4.6" "deepseek/deepseek-v4-pro" "deepseek/deepseek-v4-pro-0813""deepseek/deepseek-v4-flash-0731" "mistralai/mistral-medium-3-5" "moonshotai/kimi-k3""openai/gpt-5.4" "openai/gpt-5.4-mini" "qwen/qwen3.8-max-0902" "z-ai/glm-5.3" "z-ai/glm-5.2"}