{"id":237,"date":"2026-08-25T17:09:51","date_gmt":"2026-08-25T09:09:51","guid":{"rendered":"https:\/\/xiaotiao.store\/index.php\/2026\/08\/25\/openclaw-%e9%85%8d%e7%bd%ae-gemma-4-31b-it-%e5%ae%8c%e5%85%a8%e6%8c%87%e5%8d%97%ef%bc%882026%e5%b9%b44%e6%9c%88%e7%89%88%ef%bc%89\/"},"modified":"2026-08-25T17:09:52","modified_gmt":"2026-08-25T09:09:52","slug":"openclaw-%e9%85%8d%e7%bd%ae-gemma-4-31b-it-%e5%ae%8c%e5%85%a8%e6%8c%87%e5%8d%97%ef%bc%882026%e5%b9%b44%e6%9c%88%e7%89%88%ef%bc%89","status":"publish","type":"post","link":"https:\/\/xiaotiao.store\/index.php\/2026\/08\/25\/openclaw-%e9%85%8d%e7%bd%ae-gemma-4-31b-it-%e5%ae%8c%e5%85%a8%e6%8c%87%e5%8d%97%ef%bc%882026%e5%b9%b44%e6%9c%88%e7%89%88%ef%bc%89\/","title":{"rendered":"OpenClaw \u914d\u7f6e Gemma 4 31B IT \u5b8c\u5168\u6307\u5357\uff082026\u5e744\u6708\u7248\uff09"},"content":{"rendered":"<h2>\u80cc\u666f<\/h2>\n<p>\u672c\u6587\u8be6\u7ec6\u8bb2\u89e3\u4e86\u5982\u4f55\u5728 OpenClaw \u5e73\u53f0\u4e2d\u6b63\u786e\u914d\u7f6e\u8c37\u6b4c\u6700\u65b0\u5f00\u6e90\u5927\u6a21\u578b Gemma 4 31B IT\uff0c\u89e3\u51b3\u4e86\u4e09\u5c42\u517c\u5bb9\u6027\u95ee\u9898\uff0c\u5b9e\u73b0\u8be5\u6a21\u578b\u5728 OpenClaw \u4e2d\u7684\u7a33\u5b9a\u8fd0\u884c\u3002\u8be5\u6a21\u578b\u62e5\u6709 256K \u4e0a\u4e0b\u6587\u7a97\u53e3\u548c\u591a\u6a21\u6001\u8f93\u5165\u80fd\u529b\uff0c\u53c2\u6570\u89c4\u6a21 31B\uff0c\u662f\u76ee\u524d\u5f00\u6e90\u5927\u6a21\u578b\u4e2d\u7684\u6027\u80fd\u6807\u6746\u3002<\/p>\n<h2>\u6838\u5fc3\u95ee\u9898\uff1a\u4e09\u5c42\u517c\u5bb9\u6027\u969c\u788d<\/h2>\n<p>Gemma 4 \u65e0\u6cd5\u76f4\u63a5\u5728 OpenClaw \u4e2d\u8fd0\u884c\uff0c\u4e3b\u8981\u6d89\u53ca\u4e09\u5c42\u4e0d\u517c\u5bb9\u95ee\u9898\uff1a<\/p>\n<ol>\n<li><strong>\u8def\u7531\u5c42\u4e0d\u517c\u5bb9<\/strong>\uff1aOpenRouter\/HuggingFace Router \u4e0d\u652f\u6301 Gemma 4 \u7684\u5de5\u5177\u8c03\u7528\uff08tool\/function calling\uff09\u80fd\u529b\uff0c\u800c OpenClaw \u7684 Agent \u67b6\u6784\u9ad8\u5ea6\u4f9d\u8d56\u5de5\u5177\u8c03\u7528\u529f\u80fd\uff0c\u56e0\u6b64\u8fd9\u4e24\u79cd\u63a5\u5165\u65b9\u5f0f\u4e0d\u53ef\u7528\u3002<\/li>\n<li><strong>\u5185\u7f6e Provider \u4e0d\u517c\u5bb9<\/strong>\uff1aOpenClaw \u5185\u7f6e\u7684 <code>google\/*<\/code> provider \u5c1a\u672a\u5305\u542b Gemma \u6a21\u578b\u7cfb\u5217\uff0c\u76f4\u63a5\u4f7f\u7528\u65f6\u4f1a\u88ab\u8bc6\u522b\u4e3a\u672a\u77e5\u6a21\u578b\u3002<\/li>\n<li><strong>\u54cd\u5e94\u89e3\u6790\u4e0d\u517c\u5bb9<\/strong>\uff1aGemma 4 \u7684\u6d41\u5f0f\u54cd\u5e94\u4e2d\u5305\u542b <code>\"thought\": true<\/code> \u7684\u601d\u7ef4\/\u63a8\u7406 token\uff0cOpenClaw \u7684\u54cd\u5e94\u89e3\u6790\u5668\u4f1a\u5c1d\u8bd5\u5c06\u5176\u6309\u7ed3\u6784\u5316 reasoning \u8f93\u51fa\u5904\u7406\uff0c\u8fdb\u800c\u89e6\u53d1 <code>MALFORMED_RESPONSE<\/code> \u9519\u8bef\u3002<\/li>\n<\/ol>\n<h2>\u5b8c\u6574\u89e3\u51b3\u65b9\u6848<\/h2>\n<h3>\u603b\u4f53\u601d\u8def<\/h3>\n<ul>\n<li>\u4f7f\u7528\u81ea\u5b9a\u4e49 <code>google-ai<\/code> provider \u76f4\u8fde Google AI Studio \u539f\u751f API\u3002<\/li>\n<li>\u91c7\u7528 Google Generative AI \u539f\u751f API \u683c\u5f0f\u800c\u975e\u901a\u7528\u8def\u7531\u5c42\u683c\u5f0f\u3002<\/li>\n<li>\u5728\u6a21\u578b\u5b9a\u4e49\u4e2d\u663e\u5f0f\u8bbe\u7f6e <code>\"reasoning\": false<\/code>\uff0c\u8ba9 OpenClaw \u8df3\u8fc7\u5bf9 reasoning\/thinking token \u7684\u89e3\u6790\uff0c\u907f\u514d\u89e3\u6790\u5931\u8d25\u3002<\/li>\n<\/ul>\n<h3>\u5206\u6b65\u914d\u7f6e<\/h3>\n<h4>1. \u6dfb\u52a0\u81ea\u5b9a\u4e49 provider\uff08\u4fee\u6539 <code>~\/.openclaw\/openclaw.json<\/code>\uff09<\/h4>\n<p>\u5728 <code>models.providers<\/code> \u6570\u7ec4\u4e2d\u52a0\u5165\u4ee5\u4e0b\u914d\u7f6e\uff1a<\/p>\n<pre><code class=\"language-json\">\"google-ai\": {\n  \"baseUrl\": \"https:\/\/generativelanguage.googleapis.com\/v1beta\",\n  \"api\": \"google-generative-ai\",\n  \"authHeader\": true,\n  \"models\": [\n    {\n      \"id\": \"gemma-4-31b-it\",\n      \"name\": \"Gemma 4 31B IT\",\n      \"reasoning\": false,\n      \"input\": [\"text\", \"image\"],\n      \"cost\": {\n        \"input\": 0,\n        \"output\": 0\n      },\n      \"contextWindow\": 262144,\n      \"maxTokens\": 32768\n    }\n  ]\n}\n<\/code><\/pre>\n<h4>2. \u8bbe\u7f6e\u9ed8\u8ba4\u6a21\u578b\uff08\u4fee\u6539 <code>~\/.openclaw\/openclaw.json<\/code>\uff09<\/h4>\n<ul>\n<li>\n<p>\u5728 <code>agents.defaults.model<\/code> \u4e2d\u8bbe\u7f6e\uff1a<\/p>\n<pre><code class=\"language-json\">\"primary\": \"google-ai\/gemma-4-31b-it\",\n\"fallbacks\": [\"minimax\/MiniMax-M2.7\", \"minimax-portal\/MiniMax-M2.1\"]\n<\/code><\/pre>\n<\/li>\n<li>\n<p>\u5728 <code>agents.list[0]<\/code>\uff08\u4e3b Agent \u914d\u7f6e\uff09\u4e2d\u8bbe\u7f6e\uff1a<\/p>\n<pre><code class=\"language-json\">\"primary\": \"google-ai\/gemma-4-31b-it\"\n<\/code><\/pre>\n<\/li>\n<li>\n<p>\u5728 <code>agents.defaults.models<\/code> \u4e2d\u6dfb\u52a0\u6a21\u578b\u522b\u540d\uff1a<\/p>\n<pre><code class=\"language-json\">\"google-ai\/gemma-4-31b-it\": {\n  \"alias\": \"gemma4\"\n}\n<\/code><\/pre>\n<\/li>\n<\/ul>\n<h4>3. \u914d\u7f6e\u8ba4\u8bc1\u4fe1\u606f\uff08\u4fee\u6539 <code>~\/.openclaw\/agents\/main\/agent\/auth-profiles.json<\/code>\uff09<\/h4>\n<p>\u6dfb\u52a0 Google AI Studio \u8ba4\u8bc1\u914d\u7f6e\uff1a<\/p>\n<pre><code class=\"language-json\">\"google-ai:default\": {\n  \"type\": \"api_key\",\n  \"provider\": \"google-ai\",\n  \"key\": \"<GOOGLE_AI_STUDIO_API_KEY>\"\n}\n<\/code><\/pre>\n<h4>4. \u914d\u7f6e\u73af\u5883\u53d8\u91cf\uff08\u4fee\u6539 <code>~\/.openclaw\/.env<\/code>\uff09<\/h4>\n<p>\u6dfb\u52a0 API Key\uff1a<\/p>\n<pre><code class=\"language-env\">GOOGLE_AI_API_KEY=AIza...\n<\/code><\/pre>\n<h2>\u5173\u952e\u8981\u70b9<\/h2>\n<p>\u8981\u8ba9 OpenClaw \u6b63\u5e38\u4f7f\u7528 Gemma 4 31B IT\uff0c\u9700\u4e25\u683c\u9075\u5faa\u4e09\u70b9\u6838\u5fc3\u914d\u7f6e\uff1a<\/p>\n<ol>\n<li>\u2705 <strong>\u4e0d\u4f7f\u7528<\/strong> OpenRouter\/HuggingFace Router \u4f5c\u4e3a\u5de5\u5177\u8c03\u7528\u63a5\u5165\u65b9\u5f0f\u3002<\/li>\n<li>\u2705 <strong>\u901a\u8fc7\u81ea\u5b9a\u4e49 <code>google-ai<\/code> provider<\/strong> \u76f4\u8fde Google AI Studio \u539f\u751f API\u3002<\/li>\n<li>\u2705 <strong>\u5728\u6a21\u578b\u5b9a\u4e49\u4e2d\u663e\u5f0f\u8bbe\u7f6e <code>\"reasoning\": false<\/code><\/strong>\uff0c\u907f\u514d\u89e3\u6790 thinking token \u65f6\u51fa\u9519\u3002<\/li>\n<\/ol>\n<hr>\n<p><strong>\u5f15\u7528\u6765\u6e90\uff1a<\/strong><a href=\"https:\/\/www.aivi.fyi\/llms\/Gemm4-in-OpenClaw#%E6%A0%B9%E6%9C%AC%E5%8E%9F%E5%9B%A0\">\u5728OpenClaw\u5b9e\u6d4b\u8c37\u6b4c\u5f00\u6e90\u5927\u6a21\u578bGemma 4 &#8211; AI\u8d85\u5143\u57df\u7684\u535a\u5ba2<\/a><\/p>\n<p><strong>\u914d\u5957\u89c6\u9891\uff1a<\/strong><a href=\"https:\/\/www.bilibili.com\/video\/BV1Ff9gBwESC\/\">\u54d4\u54e9\u54d4\u54e9<\/a> | <a href=\"https:\/\/youtu.be\/GJYQ9Aw7wL8\">YouTube<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u80cc\u666f \u672c\u6587\u8be6\u7ec6\u8bb2\u89e3\u4e86\u5982\u4f55\u5728 OpenClaw \u5e73\u53f0\u4e2d\u6b63\u786e\u914d\u7f6e\u8c37\u6b4c\u6700\u65b0\u5f00\u6e90\u5927\u6a21\u578b Gemma 4 31B IT\uff0c&#8230;<\/p>\n","protected":false},"author":1,"featured_media":236,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-237","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/xiaotiao.store\/index.php\/wp-json\/wp\/v2\/posts\/237","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/xiaotiao.store\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/xiaotiao.store\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/xiaotiao.store\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/xiaotiao.store\/index.php\/wp-json\/wp\/v2\/comments?post=237"}],"version-history":[{"count":1,"href":"https:\/\/xiaotiao.store\/index.php\/wp-json\/wp\/v2\/posts\/237\/revisions"}],"predecessor-version":[{"id":238,"href":"https:\/\/xiaotiao.store\/index.php\/wp-json\/wp\/v2\/posts\/237\/revisions\/238"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/xiaotiao.store\/index.php\/wp-json\/wp\/v2\/media\/236"}],"wp:attachment":[{"href":"https:\/\/xiaotiao.store\/index.php\/wp-json\/wp\/v2\/media?parent=237"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/xiaotiao.store\/index.php\/wp-json\/wp\/v2\/categories?post=237"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/xiaotiao.store\/index.php\/wp-json\/wp\/v2\/tags?post=237"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}