#Set a fallback model to gemma 4, from gemini 3 flash lite currently.
1 messages · Page 1 of 1 (latest)
Let me verify the actual config shape first so I don’t make this up.
If you mean “keep your current Gemini model as primary, and only fall back to Gemma when that fails”, it would look like this:
{
agents: {
defaults: {
model: {
primary: "<your current model ref>",
fallbacks: ["<your exact gemma model ref>"],
},
},
},
}
Or with the CLI:
pnpm openclaw models set <your current model ref>
pnpm openclaw models fallbacks add <your exact gemma model ref>
pnpm openclaw models status
How it behaves:
- tries the primary first
- only switches to the fallback on failover-worthy errors, like rate limits, auth issues, timeouts, or provider busy states
- does not bounce between them when the primary is working normally
I’d get the exact model refs from:
pnpm openclaw models list --provider google
(or whatever provider your Gemma model is actually under, if it’s local/OpenRouter/etc.), because I don’t want to guess the model ID.
Docs:
https://docs.openclaw.ai/cli/models
https://docs.openclaw.ai/concepts/model-failover
If you paste pnpm openclaw --version and pnpm openclaw models status, I can give you the exact config snippet.
pnpm command not recognized
Yep, then just use openclaw directly, not pnpm openclaw.
So the same commands become:
openclaw --version
openclaw models set <your current model ref>
openclaw models fallbacks add <your exact gemma model ref>
openclaw models status
I reached for the source-checkout form too fast there, sorry 🦐
Rule of thumb:
- installed via the normal installer / global CLI → use
openclaw ... - running from a git checkout → use
pnpm openclaw ...
If you want, paste the output of:
openclaw --version
openclaw models status
and I’ll help you with the exact fallback line.
uhh, can you pull the name for me? tryna be exact here. right now, im using
bash-3.2$ openclaw models status
🦞 OpenClaw 2026.4.15 (041266a) — Ah, the fruit tree company! 🍎
Config : ~/.openclaw/openclaw.json
Agent dir : ~/.openclaw/agents/main/agent
Default : google/gemini-3.1-flash-lite-preview
Fallbacks (0) : -
Image model : -
Image fallbacks (0): -
Aliases (3) : gemini-flash -> google/gemini-3-flash-preview, gemini-flash-lite -> google/gemini-3.1-flash-lite-preview, gemini -> google/gemini-3.1-pro-preview
Configured models (7): google/gemini-3-flash-preview, google/models/gemini-3.1-flash, google/models/gemini-3.1-flash-lite-preview, google/gemini-3.1-flash-lite-preview, google/gemini-3.1-pro-preview, openai/gemini-flash-lite, openai/gemini-3.1-flash-lite-preview
Auth overview
Auth store : ~/.openclaw/agents/main/agent/auth-profiles.json
Shell env : off
Providers w/ OAuth/tokens (0): -
- google effective=profiles:~/.openclaw/agents/main/agent/auth-profiles.json | profiles=1 (oauth=0, token=0, api_key=1) | google:default=AIzaSyDQ...dAittfRc
- ollama effective=profiles:~/.openclaw/agents/main/agent/auth-profiles.json | profiles=1 (oauth=0, token=0, api_key=1) | ollama:default=marker(ollama-local) | models.json=marker(ollama-local) | source=models.json: ~/.openclaw/agents/main/agent/models.json
OAuth/token status
I’m checking the exact ref format for local Gemma so I don’t hand you a bogus model name.
Yep, you’re on a new enough version for this.
From the models status output, I can’t pull a Gemma ref yet, because there isn’t one in your configured model list. Right now I only see Gemini refs, plus an Ollama provider marker.
Try these:
openclaw models list --provider ollama --plain | grep -i gemma
openclaw models list --provider google --plain | grep -i gemma
Whichever one returns something, that full provider/model string is the exact name you want.
Then add it like this:
openclaw models fallbacks add <exact-ref-from-above>
openclaw models status
If both commands return nothing, then Gemma is not exposed to OpenClaw yet, so we’d need to add/install it first.
Paste the output of those two lines and I’ll give you the exact final command.
Both returned nothing. What should i search online to get the exact name?
Search the provider’s official catalog, not “OpenClaw gemma”.
Most likely for your setup, use:
site:ollama.com/library gemma
If you find the model there, the OpenClaw ref is:
ollama/<exact-ollama-tag>
So if Ollama’s library shows some exact tag, you use that exact suffix after ollama/.
If you’re trying Google-hosted Gemma instead, search:
site:ai.google.dev gemma models
and the OpenClaw ref would be:
google/<exact-google-model-id>
One important bit: since both of your local openclaw models list ... | grep -i gemma commands returned nothing, that usually means Gemma is not available to OpenClaw yet in your current setup. So the official provider page is the right place to find the exact id first.
Docs:
https://docs.openclaw.ai/providers/ollama
https://docs.openclaw.ai/providers/google
If you paste the exact Ollama or Google model page you found, I’ll translate it into the exact openclaw models fallbacks add ... command.
Yep. Assuming that’s the Ollama model tag, use this:
ollama pull gemma-4-31b-it
openclaw models list --provider ollama --plain | grep -i gemma
openclaw models fallbacks add ollama/gemma-4-31b-it
openclaw models status
That would keep your current primary model and add this as the fallback:
- primary:
google/gemini-3.1-flash-lite-preview - fallback:
ollama/gemma-4-31b-it
If you want to be extra explicit, your config would end up like:
{
agents: {
defaults: {
model: {
primary: "google/gemini-3.1-flash-lite-preview",
fallbacks: ["ollama/gemma-4-31b-it"],
},
},
},
}
If ollama pull gemma-4-31b-it says “not found”, then that tag isn’t the exact Ollama tag, and we should use the exact one from the Ollama library page instead.
https://docs.openclaw.ai/concepts/model-failover
If you run those and paste the output, I’ll sanity-check it.
I’m here 🦐
Did ollama pull gemma-4-31b-it work, or did it throw an error? Paste whatever you got and I’ll help from there.
Uhh, i would want to use an API key. I cannot run it locally at the moment. I have an api key. Just give me the place where i can drop it. Although, can it run on a mac mini m1?
I’m checking the exact key placement so I don’t send you to the wrong config field.
Yep. The simplest place is:
~/.openclaw/.env
If it’s a Google/Gemini key, put one of these in that file:
GEMINI_API_KEY=your_key_here
# or
GOOGLE_API_KEY=your_key_here
Then restart the gateway:
openclaw gateway restart
Important though, your earlier models status already showed a Google API key is loaded. So for google/*, the blocker is probably not “where do I put the key”, it’s whether that provider actually exposes the Gemma model you want.
So the flow is:
- Put the provider key in
~/.openclaw/.env openclaw gateway restart- Check what that provider exposes:
openclaw models list --provider google | grep -i gemma
If you’re using some other API provider for Gemma, same place, ~/.openclaw/.env, but the env var name depends on the provider.
About the Mac mini M1:
- OpenClaw itself: yes, that’s fine
- Running a 31B Gemma locally on it: I would not count on that being a good experience. For a model that size, API-hosted is the much saner path.
Docs:
https://docs.openclaw.ai/help/environment
https://docs.openclaw.ai/providers/google
https://docs.openclaw.ai/gateway/local-models
If you tell me which provider the API key is for, I can give you the exact env var name and fallback command.
How then do i set it as the fallbackmodel? Froim the Gemma APi
Let me verify whether OpenClaw has a direct “Gemma API” provider, or whether this needs to go through another provider.
Short version: in OpenClaw you do not set a fallback as gemma/... unless there is actually a gemma provider.
From the docs, there is no standalone gemma provider. You need to use the provider that serves that Gemma model, for example:
google/<exact-model-id>if Google exposes itopenrouter/<publisher>/<model>if you’re using OpenRouterollama/<tag>if it’s local Ollama
So the flow is:
- Put the provider key in
~/.openclaw/.env - Restart the gateway
- Confirm that provider actually exposes the Gemma model
- Add that exact
provider/modelas the fallback
Example, if it’s Google:
# ~/.openclaw/.env
GEMINI_API_KEY=your_key_here
openclaw gateway restart
openclaw models list --provider google | grep -i gemma
openclaw models fallbacks add google/<exact-model-id-from-the-list>
openclaw models status
Example, if it’s OpenRouter:
# ~/.openclaw/.env
OPENROUTER_API_KEY=your_key_here
openclaw gateway restart
openclaw models list --provider openrouter | grep -i gemma
openclaw models fallbacks add openrouter/<exact-model-id-from-the-list>
openclaw models status
The important bit is this:
you can only add the fallback after openclaw models list --provider ... shows the exact model ref.
If you want, tell me which API key/provider you actually have and I’ll give you the exact commands with no placeholders.
"openclaw models list --provider openrouter | grep -i gemma" returns nothing. Also, the env doesnt seem to work properly. From my knowledge my provider is google
One last check, I want to see whether the bundled Google provider actually advertises Gemma models at all in the current docs/source.
Ah, I think I see the issue.
openclaw models list --provider google shows configured models by default, not the full Google catalog.
Try this instead:
openclaw models list --all --provider google | grep -i gemma
If that prints the model you want, then the fallback command is:
openclaw models fallbacks add google/gemma-4-31b-it
openclaw models status
Also, your env is probably not the blocker here, because your earlier openclaw models status already showed a Google API key loaded.
So the likely flow is:
- Google key is already working
- You were listing only configured models
--allshould reveal the Google Gemma refs
Docs do mention Gemma 4 models under the Google provider:
https://docs.openclaw.ai/providers/google
If openclaw models list --all --provider google | grep -i gemma still returns nothing, paste that output and I’ll help figure out what’s off.
No it didnt work until i ran some commands in the console and it asked me for my api key THERE.
Yep, that explains it.
What happened is:
- your interactive CLI command could prompt for the key
- your normal Gateway/session environment was not seeing it yet
That’s pretty common on macOS. Terminal env and daemon/service env are often not the same.
The clean fix is to persist the key in:
~/.openclaw/.env
like this:
GEMINI_API_KEY=your_key_here
then restart:
openclaw gateway restart
After that, do the actual fallback steps:
openclaw models list --all --provider google | grep -i gemma
openclaw models fallbacks add google/gemma-4-31b-it
openclaw models status
If the interactive command already stored auth and openclaw models list --all --provider google | grep -i gemma now works, you can skip re-entering the key and just run:
openclaw models fallbacks add google/gemma-4-31b-it
openclaw models status
Docs:
https://docs.openclaw.ai/help/environment
https://docs.openclaw.ai/providers/google
If that works, glad that helped! 🎉
If this fixed it, please right-click the solution message → Apps → ✅ Mark Solution.
This helps Answer Overflow index the solution for future users.
(base) vince@Intelicons-Mac-mini ~ % openclaw models list --all --provider google | grep -i gemma
google/gemma-3-27b-it text+image 128k no yes
google/gemma-4-26b-it text+image 250k no yes
google/gemma-4-31b-it text+image 250k no yes
Perfect, that’s the exact ref you need:
google/gemma-4-31b-it
So now just run:
openclaw models fallbacks add google/gemma-4-31b-it
openclaw models status
If you want to be extra explicit and make sure the primary stays what you had before:
openclaw models set google/gemini-3.1-flash-lite-preview
openclaw models fallbacks add google/gemma-4-31b-it
openclaw models status
You should end up with something like:
- Default:
google/gemini-3.1-flash-lite-preview - Fallbacks:
google/gemma-4-31b-it
If that works, glad we got it sorted 🦐
If this fixed it, please right-click the solution message → Apps → ✅ Mark Solution so Answer Overflow can index it.
🦞 OpenClaw 2026.4.15 (041266a) — It's not "failing," it's "discovering new ways to configure the same thing wrong."
Config overwrite: /Users/vince/.openclaw/openclaw.json (sha256 c5589a911260cc644f158adf8b4a928c5fb651cf323e2d032d9bbb27b05e4bb2 -> 953c055bd2da7ebc6a433b5e280a60d8dd09ad0dff277d4282009a4db6d25acb, backup=/Users/vince/.openclaw/openclaw.json.bak)
Updated ~/.openclaw/openclaw.json
Fallbacks: google/gemma-4-31b-it
- google/gemma-4-31b-it: text+image, 250k, no, yes
🦞 OpenClaw 2026.4.15 (041266a) — Runs on a Raspberry Pi. Dreams of a rack in Iceland.
Config : ~/.openclaw/openclaw.json
Agent dir : ~/.openclaw/agents/main/agent
Default : google/gemini-3.1-flash-lite-preview
Fallbacks (1) : google/gemma-4-31b-it
Image model : -
Image fallbacks (0): -
Aliases (3) : gemini-flash -> google/gemini-3-flash-preview, gemini-flash-lite -> google/gemini-3.1-flash-lite-preview, gemini -> google/gemini-3.1-pro-preview
Configured models (8): google/gemini-3-flash-preview, google/models/gemini-3.1-flash, google/models/gemini-3.1-flash-lite-preview, google/gemini-3.1-flash-lite-preview, google/gemini-3.1-pro-preview, openai/gemini-flash-lite, openai/gemini-3.1-flash-lite-preview, google/gemma-4-31b-it
Auth overview
Auth store : ~/.openclaw/agents/main/agent/auth-profiles.json
Shell env : off
Providers w/ OAuth/tokens (0): -
- google effective=profiles:~/.openclaw/agents/main/agent/auth-profiles.json | profiles=1 (oauth=0, token=0, api_key=1) | google:default=AIzaSyDQ...dAittfRc
- ollama effective=profiles:~/.openclaw/agents/main/agent/auth-profiles.json | profiles=1 (oauth=0, token=0, api_key=1) | ollama:default=marker(ollama-local) | models.json=marker(ollama-local) | source=models.json: ~/.openclaw/agents/main/agent/models.json
OAuth/token status
- none