Skip to content

Function: useMastraDefaultModel()

useMastraDefaultModel(agentId?, enabled?): object

Fetch the humanized name of the static default model the given agent (or the server’s default agent) falls back to when no model is pinned, via client.defaultModel(agentId). defaultModel is null while loading, when the agent’s model is dynamic, or on error - the picker then shows a plain “Default”. Pass enabled: false to skip the fetch (e.g. picker hidden), which also clears any prior value. Returns an object to match the shape of the sibling data hooks (useMastraModels, useMastraSuggestions).

string

boolean = true

object

defaultModel: string | null

loading: boolean