Skip to content

The easy-to-use open source Business Intelligence and Embedded Analytics tool that lets everyone work with data :bar_chart:

Offer Google's undated Claude Haiku 4.5 model ID (#83876)

Paolo Rascunà1affba74d629
diff --git a/docs/ai/providers.md b/docs/ai/providers.md
index 7f1545e7a52..71864cf3334 100644
--- a/docs/ai/providers.md
+++ b/docs/ai/providers.md
@@ -210,20 +210,20 @@ Credentials:
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` |
-| Claude Opus 5.5 | `anthropic/claude-opus-5-5` |
-| Claude Sonnet 4.6 | `anthropic/claude-sonnet-4-6` |
-| Claude Sonnet 5 | `anthropic/claude-sonnet-5` |
-| Claude Sonnet 5.5 | `anthropic/claude-sonnet-5-5` |
-| Gemini 3.5 Flash | `google/gemini-3.5-flash` |
-| Gemini 3.6 Flash | `google/gemini-3.6-flash` |
-| Gemini 3.7 Flash | `google/gemini-3.7-flash` |
+| 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` |
+| Claude Opus 4.6 | `anthropic/claude-opus-4-6` |
+| Claude Opus 5 | `anthropic/claude-opus-5` |
+| Claude Opus 5.5 | `anthropic/claude-opus-5-5` |
+| Claude Sonnet 4.6 | `anthropic/claude-sonnet-4-6` |
+| Claude Sonnet 5 | `anthropic/claude-sonnet-5` |
+| Claude Sonnet 5.5 | `anthropic/claude-sonnet-5-5` |
+| Gemini 3.5 Flash | `google/gemini-3.5-flash` |
+| Gemini 3.6 Flash | `google/gemini-3.6-flash` |
+| Gemini 3.7 Flash | `google/gemini-3.7-flash` |
Credentials:
diff --git a/src/metabase/llm/api/provider.clj b/src/metabase/llm/api/provider.clj
index 098b3e85e59..386ec072161 100644
--- a/src/metabase/llm/api/provider.clj
+++ b/src/metabase/llm/api/provider.clj
@@ -16,6 +16,7 @@
[metabase.permissions.core :as perms]
[metabase.premium-features.core :refer [defenterprise]]
[metabase.settings.core :as setting]
+ [metabase.util :as u]
[metabase.util.i18n :refer [tru]]
[metabase.util.log :as log]
[metabase.util.malli.schema :as ms]))
@@ -124,6 +125,9 @@
:fields (mapv field-response fields)})
(defn- connection-response
+ "The API view of `conn`: its secret fields masked, and a retired `:probed-model` read as the model now serving it.
+
+ The edit form preselects `probed-model` only when that id is on the type's catalog, and a retired id is not."
[{conn-key :key conn-name :name :keys [type source config env-vars env-fields] :as conn}]
{:key conn-key
:type type
@@ -132,7 +136,8 @@
:usable (llm.provider/config-complete? type config)
:env_vars (vec env-vars)
:env_fields (mapv name (sort env-fields))
- :config (or (:config (llm.provider/redact conn)) {})})
+ :config (u/update-if-exists (or (:config (llm.provider/redact conn)) {})
+ :probed-model #(llm.provider/current-model type %))})
;;; ------------------------------------------------ Model listing -------------------------------------------------
@@ -167,8 +172,8 @@
comes from the registry, and the call is made against the model this connection is known to serve.
`:model` is a request the type must honour or fail. `:proposed-model` is only our guess at what this connection
- serves — the `:probed-model` an earlier probe recorded, or the catalog's first entry — which a type is free to
- ignore.
+ serves. It is the model now serving the `:probed-model` an earlier probe recorded, or else the catalog's first
+ entry. A type is free to ignore it.
A connection that names its model in `:config` (an Azure deployment or a Google Model Garden endpoint, which no
listing returns) makes the call for the same reason. That model is the one verified, whichever model the caller or
@@ -185,7 +190,8 @@
(let [config (llm.provider/with-field-defaults type (or config-override config))
configured-model (llm.provider/connection-model type config)
;; Our best guess at the model to try if caller did not specify a model.
- proposed-model (or (:probed-model config) (:id (first fixed)))
+ proposed-model (or (some->> (:probed-model config) (llm.provider/current-model type))
+ (:id (first fixed)))
model (or configured-model model (selected-model conn-key))
config-models (cond
configured-model [{:id configured-model
diff --git a/src/metabase/llm/provider.clj b/src/metabase/llm/provider.clj
index 61146dbffc7..07bd389a384 100644
--- a/src/metabase/llm/provider.clj
+++ b/src/metabase/llm/provider.clj
@@ -223,7 +223,13 @@
{:id "anthropic/claude-sonnet-5-5" :display_name "Claude Sonnet 5.5"}
{:id "anthropic/claude-sonnet-5" :display_name "Claude Sonnet 5"}
{:id "anthropic/claude-sonnet-4-6" :display_name "Claude Sonnet 4.6"}
- {:id "anthropic/claude-haiku-4-5@20251001" :display_name "Claude Haiku 4.5"}]
+ {:id "anthropic/claude-haiku-4-5" :display_name "Claude Haiku 4.5"}]
+ ;; Google lists Claude Haiku 4.5 without the `@20251001` date it once carried:
+ ;; https://docs.cloud.google.com/gemini-enterprise-agent-platform/models/partner-models/claude/haiku-4-5
+ ;; Treat an entry as permanent: nothing rewrites a value pinned by an environment variable, and a stored value
+ ;; converges only when the setting is next written.
+ ;; A connection's stored `:probed-model` converges only when a probe next verifies the connection.
+ :retired-models {"anthropic/claude-haiku-4-5@20251001" "anthropic/claude-haiku-4-5"}
;; A connection with an endpoint ID serves that Model Garden endpoint instead of the catalog.
:model-fields ["endpoints" :endpoint-id]
;; A service account key authenticates on its own (it can carry the project); an OAuth token needs the project
@@ -1146,7 +1152,7 @@
"Every model id some provider type has retired, so a reference naming none of them needs no connection lookup."
(into #{} (mapcat (comp keys :retired-models)) provider-type-registry))
-(defn- current-model
+(defn current-model
"The model now serving `model` on provider type `type-name`.
Its successor when the type retired it, otherwise `model` itself. Read from the raw registry, like
diff --git a/src/metabase/metabot/self/claude.clj b/src/metabase/metabot/self/claude.clj
index aafe9e84f5a..1fd9ff7193d 100644
--- a/src/metabase/metabot/self/claude.clj
+++ b/src/metabase/metabot/self/claude.clj
@@ -380,10 +380,31 @@
[model]
(str/replace-first (u/lower-case-en (str model)) #"^anthropic\." ""))
+(def ^:private undated-aliases
+ "Undated alias → dated id, for every dated row of [[supported-models]].
+
+ \"claude-haiku-4-5\" => \"claude-haiku-4-5-20251001\"
+
+ Before the 4.6 generation, \"the alias is a convenience pointer that resolves to the dated ID\":
+ https://platform.claude.com/docs/en/about-claude/models/overview"
+ (into {}
+ (keep (fn [id]
+ (when-let [[_ alias] (re-matches #"(.+)-\d{8}" id)]
+ [alias id])))
+ (keys supported-models)))
+
+(defn- supported-model-id
+ "The [[supported-models]] key that describes `model`, which may be vendor-prefixed or an undated alias."
+ [model]
+ (let [id (strip-vendor-prefix model)]
+ (if (contains? supported-models id)
+ id
+ (get undated-aliases id id))))
+
(mu/defn context-window-tokens :- [:maybe :int]
"The input context window for `model`, or nil when it isn't one we know."
[model :- [:maybe :string]]
- (get-in supported-models [(strip-vendor-prefix model) :context-window]))
+ (get-in supported-models [(supported-model-id model) :context-window]))
(defn- claude-model-version
"`[family major minor]` for a Claude opus/sonnet/fable/mythos model id, or nil.
diff --git a/test/metabase/llm/api/provider_test.clj b/test/metabase/llm/api/provider_test.clj
index 7ef947ba363..eb18b091bdf 100644
--- a/test/metabase/llm/api/provider_test.clj
+++ b/test/metabase/llm/api/provider_test.clj
@@ -159,7 +159,7 @@
{:id "anthropic/claude-sonnet-5-5" :display_name "Claude Sonnet 5.5"}
{:id "anthropic/claude-sonnet-5" :display_name "Claude Sonnet 5"}
{:id "anthropic/claude-sonnet-4-6" :display_name "Claude Sonnet 4.6"}
- {:id "anthropic/claude-haiku-4-5@20251001" :display_name "Claude Haiku 4.5"}]
+ {:id "anthropic/claude-haiku-4-5" :display_name "Claude Haiku 4.5"}]
(:models google))))
(testing "and the endpoint ID is the field that names a model in place of the catalog"
(is (= ["endpoint-id"] (:model_fields google)))))
@@ -1483,7 +1483,7 @@
{:id "anthropic/claude-sonnet-5-5" :display_name "Claude Sonnet 5.5"}
{:id "anthropic/claude-sonnet-5" :display_name "Claude Sonnet 5"}
{:id "anthropic/claude-sonnet-4-6" :display_name "Claude Sonnet 4.6"}
- {:id "anthropic/claude-haiku-4-5@20251001" :display_name "Claude Haiku 4.5"}]}]
+ {:id "anthropic/claude-haiku-4-5" :display_name "Claude Haiku 4.5"}]}]
(mt/user-http-request :crowberto :get 200 "llm/models")))
(is (= "google/gemini-3.5-flash" @probed))))))))
@@ -1504,6 +1504,30 @@
(mt/user-http-request :crowberto :get 200 "llm/models")))
(is (= "anthropic/claude-sonnet-4-6" @probed)))))))
+(deftest models-propose-a-retired-probed-model-as-its-successor-test
+ (testing "a connection last probed with a model its provider has since retired proposes the model now serving it"
+ (let [config {:oauth-access-token "ya29.token"
+ :project-id "my-project"
+ :probed-model "anthropic/claude-haiku-4-5@20251001"}
+ listed-with (atom nil)]
+ (mt/with-temporary-setting-values [llm-providers [(connection "google" "google" config)]]
+ (mt/with-temporary-raw-setting-values [llm-metabot-provider "anthropic/claude-sonnet-4-6"]
+ (mt/with-dynamic-fn-redefs [metabot.self/list-models (fn [_provider opts]
+ (reset! listed-with opts)
+ {:models []})]
+ (mt/user-http-request :crowberto :get 200 "llm/models")
+ (is (= "anthropic/claude-haiku-4-5" (:proposed-model @listed-with)))))))))
+
+(deftest list-providers-shows-a-retired-probed-model-as-its-successor-test
+ (testing "the edit form gets the model now serving a retired probed model, so it can find it on the catalog"
+ (mt/with-temporary-setting-values [llm-providers [(connection "google" "google"
+ {:oauth-access-token "ya29.token"
+ :project-id "my-project"
+ :probed-model
+ "anthropic/claude-haiku-4-5@20251001"})]]
+ (is (= "anthropic/claude-haiku-4-5"
+ (-> (mt/user-http-request :crowberto :get 200 "llm/providers") first :config :probed-model))))))
+
(deftest models-listing-probes-the-model-metabot-is-pointed-at-test
(testing (str "an environment-configured connection is never written back to, so it carries no probed model — the "
"selection Metabot runs on names it instead")
diff --git a/test/metabase/llm/provider_test.clj b/test/metabase/llm/provider_test.clj
index a1240defdc0..3e4e54daf3a 100644
--- a/test/metabase/llm/provider_test.clj
+++ b/test/metabase/llm/provider_test.clj
@@ -706,7 +706,12 @@
(testing "a retired model id resolves to the model that now serves it"
(is (= "qwen/qwen3.8-max-0902" (:model (llm.provider/resolve-model-ref "openrouter/qwen/qwen3.8-max")))))
(testing "the same id under another provider type is not retired there"
- (is (= "qwen/qwen3.8-max" (:model (llm.provider/resolve-model-ref "anthropic/qwen/qwen3.8-max")))))))
+ (is (= "qwen/qwen3.8-max" (:model (llm.provider/resolve-model-ref "anthropic/qwen/qwen3.8-max"))))))
+ (mt/with-temporary-setting-values [llm-providers [(connection "my-google" "google"
+ {:service-account-key "{\"type\":\"db\"}"})]]
+ (testing "Google's dated Claude Haiku 4.5 resolves to the undated id Google documents"
+ (is (= "anthropic/claude-haiku-4-5"
+ (:model (llm.provider/resolve-model-ref "my-google/anthropic/claude-haiku-4-5@20251001")))))))
(deftest canonical-model-ref-test
(mt/with-temporary-setting-values [llm-providers [(connection "openrouter" "openrouter" {:api-key "sk-or-v1-db"})
@@ -717,7 +722,12 @@
(is (= "openrouter/qwen/qwen3.8-max-0902" (llm.provider/canonical-model-ref "openrouter/qwen/qwen3.8-max-0902")))
(is (= "anthropic/qwen/qwen3.8-max" (llm.provider/canonical-model-ref "anthropic/qwen/qwen3.8-max")))
(is (= "nope/qwen/qwen3.8-max" (llm.provider/canonical-model-ref "nope/qwen/qwen3.8-max")))
- (is (nil? (llm.provider/canonical-model-ref nil))))))
+ (is (nil? (llm.provider/canonical-model-ref nil)))))
+ (mt/with-temporary-setting-values [llm-providers [(connection "my-google" "google"
+ {:service-account-key "{\"type\":\"db\"}"})]]
+ (testing "a saved Google selection of the dated Claude Haiku 4.5 reads as the undated id"
+ (is (= "my-google/anthropic/claude-haiku-4-5"
+ (llm.provider/canonical-model-ref "my-google/anthropic/claude-haiku-4-5@20251001"))))))
(deftest ^:parallel retired-models-map-straight-to-a-current-model-test
(testing (str "a retired model's successor is never itself retired: a model ref resolves through a single "
@@ -727,6 +737,16 @@
(testing type
(is (not (contains? retired-models successor)))))))
+(deftest ^:parallel retired-models-map-to-an-offered-model-test
+ (testing "a retired model's successor is in its type's fixed catalog, so the connection form can show it"
+ ;; a type that fetches its models has no catalog to check offline
+ (let [checked (filter #(and (:models %) (seq (:retired-models %))) (llm.provider/provider-types))]
+ (is (seq checked) "a type with a fixed catalog retires a model, so the check below runs")
+ (doseq [{:keys [type models retired-models]} checked
+ successor (vals retired-models)]
+ (testing type
+ (is (contains? (set (map :id models)) successor)))))))
+
(deftest with-field-defaults-normalizes-base-urls-test
(testing "a base URL keeps no trailing slash, whichever source it comes from, so joining a path cannot double the /"
(is (= "https://api.mistral.ai/v1"
diff --git a/test/metabase/metabot/self/chat_max_tokens_test.clj b/test/metabase/metabot/self/chat_max_tokens_test.clj
index e3b86ea918c..aa152c3a5c4 100644
--- a/test/metabase/metabot/self/chat_max_tokens_test.clj
+++ b/test/metabase/metabot/self/chat_max_tokens_test.clj
@@ -159,7 +159,7 @@
"gpt-5.4-nano" omitted
"gpt-5.4" omitted
"GPT-5.5" omitted}
- ;; Vertex: partner ids, dated with `@`
+ ;; Vertex: partner ids; Haiku 4.5 also in the retired `@`-dated spelling a saved selection may still hold
:vertex-claude {"claude-fable-5-1" 32000
"claude-fable-5" 32000
"claude-opus-5-5" 32000
@@ -168,6 +168,7 @@
"claude-sonnet-5-5" 32000
"claude-sonnet-5" 32000
"claude-sonnet-4-6" 32000
+ "claude-haiku-4-5" 32000
"claude-haiku-4-5@20251001" 32000}
:gemini {"google/gemini-3.5-flash" 32000
"google/gemini-3.6-flash" 32000
diff --git a/test/metabase/metabot/self/claude_test.clj b/test/metabase/metabot/self/claude_test.clj
index 565e3ec1aab..0b2a94f805f 100644
--- a/test/metabase/metabot/self/claude_test.clj
+++ b/test/metabase/metabot/self/claude_test.clj
@@ -717,6 +717,21 @@
{:model "anthropic.claude-opus-4-8"} 32000
{:model "my-deployment-3"} 32000)))))
+(deftest ^:parallel context-window-tokens-undated-alias-test
+ (testing "an undated alias reads its dated row"
+ (is (= 200000 (claude/context-window-tokens "claude-haiku-4-5")))
+ (is (= 200000 (claude/context-window-tokens "anthropic.claude-haiku-4-5")))
+ (is (= 200000 (claude/context-window-tokens "claude-haiku-4-5-20251001"))))
+ (testing "only a whole alias matches"
+ (is (nil? (claude/context-window-tokens "claude-haiku-4")))
+ (is (nil? (claude/context-window-tokens "claude-haiku-4-5-x")))
+ (is (nil? (claude/context-window-tokens "claude-haiku-9-9")))))
+
+(deftest ^:parallel undated-aliases-are-unambiguous-test
+ (testing "each undated alias names one dated row, so an alias never picks a row at random"
+ (let [stems (keep #(second (re-matches #"(.+)-\d{8}" %)) (keys claude/supported-models))]
+ (is (= (count stems) (count (set stems)))))))
+
(deftest claude-auto-cache-breakpoint-test
(mt/with-temporary-setting-values [llm.settings/llm-anthropic-api-key "sk-ant-test"]
(let [input [{:role :user :content "hi"}]]
@@ -892,6 +907,14 @@
{:id "claude-sonnet-5" :display_name "Claude Sonnet 5"}]
(:models (claude/list-models {:credentials byok-credentials})))))))
+(deftest list-models-does-not-offer-undated-aliases-test
+ (testing "an undated alias in the account's catalog is not offered: only the dated row is supported"
+ (let [catalog {:data [{:id "claude-haiku-4-5" :display_name "Claude Haiku 4.5"}
+ {:id "claude-haiku-4-5-20251001" :display_name "Claude Haiku 4.5"}]}]
+ (mt/with-dynamic-fn-redefs [http/request (fn [_] {:status 200 :body catalog})]
+ (is (= [{:id "claude-haiku-4-5-20251001" :display_name "Claude Haiku 4.5"}]
+ (:models (claude/list-models {:credentials byok-credentials}))))))))
+
(deftest ^:parallel model-supports-temperature?-test
(testing "models that accept an explicit temperature"
(doseq [model ["claude-haiku-4-5" "claude-sonnet-4-6" "claude-sonnet-4-5"
diff --git a/test/metabase/metabot/self/google_test.clj b/test/metabase/metabot/self/google_test.clj
index c9f45739d45..875b8b9a743 100644
--- a/test/metabase/metabot/self/google_test.clj
+++ b/test/metabase/metabot/self/google_test.clj
@@ -86,6 +86,7 @@
"anthropic/claude-sonnet-5-5" 1000000
"anthropic/claude-sonnet-5" 1000000
"anthropic/claude-sonnet-4-6" 1000000
+ "anthropic/claude-haiku-4-5" 200000
"anthropic/claude-haiku-4-5@20251001" 200000
"anthropic/claude-unknown" nil)))
@@ -413,6 +414,7 @@
http/request (fn [req] {:body req})]
(doseq [model ["anthropic/claude-sonnet-4-6"
"anthropic/claude-fable-5"
+ "anthropic/claude-haiku-4-5"
"anthropic/claude-haiku-4-5@20251001"]]
(testing model
(is (= 32000
diff --git a/test/metabase/metabot/self_test.clj b/test/metabase/metabot/self_test.clj
index a9819657235..be0a9bfdc6c 100644
--- a/test/metabase/metabot/self_test.clj
+++ b/test/metabase/metabot/self_test.clj
@@ -221,7 +221,9 @@
(doseq [[model-ref url-part] [["azure/openai/gpt-4.1-mini" "/v1/responses"]
["azure/anthropic/claude-deployment" "/v1/messages"]
["google/google/gemini-3.5-flash" "projects/my-project/locations/global"]
- ["google/anthropic/claude-haiku-4-5@20251001" "/publishers/anthropic/models/claude-haiku-4-5@20251001"]]]
+ ["google/anthropic/claude-haiku-4-5" "/publishers/anthropic/models/claude-haiku-4-5:"]
+ ;; a selection saved before Google dropped the date requests the undated model
+ ["google/anthropic/claude-haiku-4-5@20251001" "/publishers/anthropic/models/claude-haiku-4-5:"]]]
(testing model-ref
(let [captured (atom nil)]
(mt/with-dynamic-fn-redefs [self.core/sse-reducible identity
diff --git a/test/metabase/metabot/settings_test.clj b/test/metabase/metabot/settings_test.clj
index 7f8e81ba3e9..97c956529c1 100644
--- a/test/metabase/metabot/settings_test.clj
+++ b/test/metabase/metabot/settings_test.clj
@@ -467,8 +467,8 @@
(testing "accepts a publisher-qualified model, or a Model Garden endpoint"
(mt/with-temporary-setting-values [llm-metabot-provider "google/google/gemini-3.5-flash"]
(is (= "google/google/gemini-3.5-flash" (metabot.settings/llm-metabot-provider))))
- (mt/with-temporary-setting-values [llm-metabot-provider "google/anthropic/claude-haiku-4-5@20251001"]
- (is (= "google/anthropic/claude-haiku-4-5@20251001" (metabot.settings/llm-metabot-provider))))
+ (mt/with-temporary-setting-values [llm-metabot-provider "google/anthropic/claude-haiku-4-5"]
+ (is (= "google/anthropic/claude-haiku-4-5" (metabot.settings/llm-metabot-provider))))
(mt/with-temporary-setting-values [llm-metabot-provider "google/endpoints/1234567890123456789"]
(is (= "google/endpoints/1234567890123456789" (metabot.settings/llm-metabot-provider)))))))
@@ -584,6 +584,21 @@
(is (= "openrouter/qwen/qwen3.8-max-0902" (get values "llm-metabot-provider")))
(is (= "openrouter/qwen/qwen3.8-max-0902" (get values "llm-mini-model")))))))))))
+(deftest google-dated-claude-haiku-reads-as-undated-test
+ (testing "a saved Google selection of the dated Claude Haiku 4.5 reads as the undated id the picker offers"
+ (with-connections [configured-google]
+ (with-selected-model "google/anthropic/claude-haiku-4-5@20251001"
+ (mt/with-temp-env-var-value! [mb-llm-mini-model nil]
+ (mt/with-temporary-raw-setting-values [llm-mini-model "google/anthropic/claude-haiku-4-5@20251001"]
+ (is (= "google/anthropic/claude-haiku-4-5" (metabot.settings/llm-metabot-provider)))
+ (is (= "google/anthropic/claude-haiku-4-5" (metabot.settings/llm-mini-model)))
+ (testing "including through the settings API the picker loads"
+ (let [values (into {}
+ (map (juxt :key :value))
+ (mt/user-http-request :crowberto :get 200 "setting"))]
+ (is (= "google/anthropic/claude-haiku-4-5" (get values "llm-metabot-provider")))
+ (is (= "google/anthropic/claude-haiku-4-5" (get values "llm-mini-model")))))))))))
+
(deftest retired-model-is-stored-as-its-successor-test
(testing "writing a retired OpenRouter id stores the model now serving it, so saved values converge"
(with-connections [(connection "openrouter" "openrouter" {:api-key "sk-or-v1-test"})]