匠人学院 JR Academy
  • Position

    Where am I now, and where should I go?

    How your job is changing, where your experience can take you and what you still need for a target role, worked out from what you have actually done. Free, and the full result needs no sign-up.

    Analyse my career and skills

    Look up a career

    Will AI replace my job?AI impact and transition paths for common careersNew jobs in the AI eraWhat they do, what they need, how to move in

    Focused tools

    AI Engineer interview readiness30 timed questions on what you still need before interviewsCareer personality testDirections that suit how you workReturning to China checkJob prospects in China by school, major and graduation date

    AI coach

    Talk to your AI coachStill unsure after your result? Talk through what is holding you back
  • Core courses

    AI Engineer BootcampEngineering bootcamp from LLM apps to agentsAI Engineer Full-Stack Project Class16 weeks · RAG and full-stack AI projectsVibe Coding Masterclass8 weeks · direct agents to build and ship a productAI Essentials10 hours · use AI for email, reports, data and copyAI Office Automation Course8 weeks · help a whole company adopt AIOne-Person Company (OPC) Bootcamp15 weeks in person · build a one-person company with AIAll courses →

    AI engineering

    Machine Learning & Data Engineering Full-Stack ClassAI Agent & MCP Project BootcampAI Engineer Core TechniquesAI Engineer FoundationsAI Engineer Advanced: RAG to Agents and TuningClaude Code TasterAll AI engineering courses →

    AI at work

    AI Coding for everyoneClaude Code One-Day Masterclass (Non-Technical)Enterprise AI Automation BootcampAI Marketing BootcampAI Risk, Governance and Audit CourseOpenClaw 4-Week Personal AI Assistant BootcampAll AI-at-work courses →

    Career development

    AI Product Manager (BA) Bootcamp + InternshipAustralia IT Interview BootcampAustralia IT Technical Interview BootcampAustralia IT Resume BootcampAustralia Big Tech Job Search BootcampAustralia IT Career Planning BootcampAll career courses →

    Learn free first

    Vibe CodingAI for office workPrompt MasterAI EngineerAI data analysisResource centerInstructorsAll learning paths →
  • Evidence

    What will convince an employer?

    Certifications, projects, team work and competition entries, collected into one portfolio.

    See the portfolio

    Certifications

    Cert Master · all certificationsPrep and mock exams for AWS, Azure, GCP, Claude and moreAWS CLF-C02Entry-level AWS cloud certificationAWS SAA-C03Entry certification for cloud architectsClaude certificationsAnthropic Claude certification seriesAll certifications →

    Projects and team work

    P3 team projectsBuild a project with real teammates in a simulated team workflowP3 project experienceThe parts of a P3 project that go on your resumeDemo DayProject showcaseP3 certificatesProof once a project is completeAll of P3 →

    Competitions and work

    HackathonsBuild something against the clockSubmit your workAdd your project to the showcaseCareerOS portfolioDo tasks in the desktop app; your results become portfolio pieces
    Cert MasterBrowser extension, app and mini programScreenshot a question for analysis and practise anywhereAbout Cert Master
  • Connect

    How do I get myself in front of employers?

    Resume, interviews, referrals and mentors. See how far you are from the target role first, then decide what to fix.

    Start with Jobpin

    Resume and openings

    Graduate careersGraduate preparation across Australia, China, Malaysia, Singapore, the US and UKJobpinAI job search workspace: resume, roles, applicationsAI resumeRewrite your resume against a job descriptionReferralsRoles shared by students and mentorsOpportunitiesInternships, projects and collaborationsOffer boardOffers students have received

    Interviews

    AI Engineer interview guideSeven areas, with worked examplesFDE interview guideFive rounds, from scoping to the customer roundAI mock interviewPractise by text or voice and see the gapsInterview storiesReal interview experiencesSystem Design handbookPrepare for system design interviewsAll interview prep →

    Mentors

    1:1 mentorsBook AI, career and technical mentors by the hourGroup tutoringShare a tutor with a few others and pay less eachCareer coachingResume, interview and direction packages
    Jobpin desktopOne workspace for the whole job searchOrganise real experience and refine resume versions for target roles on macOS or Windows.About Jobpin
BusinessMembershipDownload CareerOS
0
匠人学院 JR Academy

Follow Us

linkedinfacebooktwitterinstagramyoutube

We Accept

/image/layout/pay-paypal.png/image/layout/pay-visa.png/image/layout/pay-master-card.png/image/layout/pay-airwallex.png/image/layout/pay-alipay.png
Airbotix · AI learning & creation for kids Another Life · AI story game
Products46

CareerOS and tools

  • CareerOS
  • Cert Master
  • Jobpin
  • Jobpin web
  • Jobpin report
  • Jobpin desktop download
  • My job search reports
  • Buy report credits
  • Jobpin billing
  • AI Toolbox
  • AI Skill Marketplace

Membership

  • Membership
  • AI membership

Courses

  • Bootcamps
  • Training Camp
  • Kanban learning
  • AI Builder course
  • MCP course
  • NotebookLM workshop
  • Business Analyst course
  • Web Full-Stack Bootcamp
  • DevOps Bootcamp
  • Data Engineering Bootcamp
  • Data Analysis Bootcamp
  • Coding for Beginners
  • Algorithm Bootcamp

Career services

  • Graduate careers
  • Graduate careers in Australia
  • Graduate careers in China
  • Graduate careers in Malaysia
  • Graduate careers in Singapore
  • Graduate careers in the US
  • Graduate careers in the UK
  • 1:1 coaching
  • Career coaching
  • AI Engineer VIP
  • BA & PM Internship
  • Data Science Internship
  • Data Analysis Internship
  • Marketing Internship
  • Resume Review
  • Interview Coaching
  • Job Application Service
  • Job Monitoring
  • LinkedIn Management
  • LinkedIn Networking
Library57

Learning paths

  • All Learning Paths
  • AI Engineer
  • Context Engineering
  • Vibe Coding
  • Prompt Master
  • AI Builder
  • AI Product Manager
  • Python Basics
  • AI Productivity
  • AI Data Analysis
  • AI Finance
  • AI Content Creation
  • AI Image Creation
  • Frontend Development
  • Hermes Agent
  • OpenClaw Local Agent

Interactive labs

  • Prompt Lab
  • Frontend Lab
  • JavaScript Lab
  • Python Lab
  • AWS Lab
  • Azure Lab
  • LLM Lab
  • Git Lab

Reference and guides

  • Resources
  • Wiki
  • Cheat sheets
  • Roadmaps
  • AI roadmaps
  • Videos
  • Ebooks
  • Blog
  • Interview handbook
  • Mock exams
  • Free resources

Cities

  • Sydney
  • Melbourne
  • Brisbane
  • Adelaide
  • Singapore
  • Kuala Lumpur
  • London
  • New York
  • San Francisco
  • Los Angeles
  • Seattle
  • Toronto
  • Vancouver

Immigration

  • Australia Immigration
  • Skilled Visa 189/190/491
  • Employer Sponsored 482/186/494
  • Business Visa 188/888
  • UK Immigration
  • US Immigration
  • Canada Immigration
  • Singapore immigration
  • Malaysia immigration
Business20

For business

  • AI for Business
  • Business portal sign-in
  • Corporate Training
  • Internship Partnership
  • Recruitment Partnership
  • Enterprise (EN)

Metatree AI Lab

  • Metatree AI Lab (Chinese)
  • AI solutions (Chinese)
  • Digital employees (Chinese)
  • Case studies (Chinese)
  • Metatree AI Lab
  • AI services
  • Digital employees
  • Case studies

AI education for kids

  • Airbotix — AI Learning & Creation for Kids
  • AU Family Resource Hub
  • NAPLAN Report Guide
  • My School Data Guide
  • Sydney Private School Fees 2026
  • Kids Coding Programs
About15

Company

  • About Us
  • Our Mentors
  • Become a Mentor
  • Metaverse Classroom
  • JR Careers
  • Another Life — AI Story Game
  • Contact Us

Help and policies

  • FAQs
  • Terms & Conditions
  • Privacy Policy
  • Cancellation & Refund Policy
  • Site map

Friend links

  • CS Browser

Contact

  • hello@jiangren.com.au
  • 0421-672-555

Offices

Level 10b, 144 Edward Street, Brisbane CBD (Headquarter)
Level 2, 171 La Trobe St, Melbourne VIC 3000
45A13, Block B, Oriental Hope Tianxiang Plaza, 500 Tianfu Avenue Middle Section, Wuhou District, Chengdu, Sichuan, China
Business Hub, 155 Waymouth St, Adelaide SA 5000
Disclaimer
footer-disclaimerfooter-disclaimer

JR Academy acknowledges Traditional Owners of Country throughout Australia and recognises the continuing connection to lands, waters and communities. We pay our respect to Aboriginal and Torres Strait Islander cultures; and to Elders past and present. Aboriginal and Torres Strait Islander peoples should be aware that this website may contain images or names of people who have since passed away.

All content on the JR Academy website, including course materials, logos, and information provided, is protected under Australian intellectual property laws. Unauthorized use, sale, distribution, reproduction, or modification is strictly prohibited. Violations may result in legal action. By accessing our website, you agree to respect our intellectual property. JR Academy Pty Ltd reserves all rights, including patents, trademarks, and copyrights. Any infringement will be subject to legal prosecution. View Terms of Service

© 2017-2026 JR Academy Pty Ltd. All rights reserved.

ABN 26621887572

HomeLearnCoursesCerts
  1. Home
  2. Learn
  3. Blog
  4. Google Gemma 4 开源模型实操指南:从选型到部署
JR Academy · BlogCareer insights

Google Gemma 4 开源模型实操指南:从选型到部署

Google Gemma 4 以 Apache 2.0 许可开源,四种规格覆盖手机到服务器全场景。本文详解 Gemma 4 的技术架构、模型选型策略、本地部署方法和实际应用场景,帮助开发者快速上手。

Published2026-04-07
Reading time2 min
Author

Contents

  • Gemma 4 技术架构:为什么这次不一样
  • 为什么你应该关注 Gemma 4
  • 实操指南:模型选型与部署
  • 选型决策树
  • 快速上手:用 Ollama 本地运行
  • 用 Hugging Face Transformers 加载
  • 用 vLLM 部署推理服务
  • 常见问题
  • Gemma 4 能在 Mac M 系列芯片上跑吗?
  • Gemma 4 和 Gemini API 有什么关系?用 Gemma 4 能达到 Gemini 的效果吗?
  • Apache 2.0 意味着我可以用 Gemma 4 的输出来训练自己的模型吗?
  • JR Academy 相关资源

Google Gemma 4 开源大模型实操指南

4 月 2 日 Google 发布 Gemma 4 时,开源社区的反应不是"又一个模型",而是"终于等到了"。不是因为它多强——虽然 31B 排全球开源第三确实强——而是因为 Apache 2.0 许可证。这意味着你可以把它塞进任何商业产品里,不用担心 Meta Llama 那种"月活过 7 亿要另谈"的限制。

这篇文章不讲论文、不念参数,直接告诉你:四个型号怎么选、怎么跑起来、适合干什么。

Gemma 4 技术架构:为什么这次不一样

Gemma 4 基于 Gemini 3 同源技术构建,但不是简单的缩小版。Google 在这代做了几件关键的事:

多模态原生支持:所有四个型号都原生支持视频和图像输入,支持可变分辨率。E2B 和 E4B 还支持音频输入——这意味着在手机上做语音识别不需要额外的 ASR 模型。

超长上下文窗口:边缘模型 128K,大模型 256K。256K 上下文足够你把一整个中型代码仓库塞进去做分析。

140+ 语言原生训练:不是后期微调的多语言,而是预训练阶段就覆盖了 140 多种语言。对做多语言产品的团队来说,这省掉了大量微调工作。

Apache 2.0 许可:这一条值得单独说。之前的 Gemma 用的是 Google 自定义许可,商用时需要小心条款。现在完全放开——fork、修改、商用、再分发,随便你。

为什么你应该关注 Gemma 4

如果你正在评估开源模型方案,Gemma 4 改变了选型的格局:

对比 Llama 4:Meta 的 Llama 4 Maverick 同样是 400B+ 级别的大模型,但 Llama 的许可证对月活超过 7 亿的产品有限制。Gemma 4 的 Apache 2.0 没有任何此类门槛。而且 Gemma 4 的 26B MoE 版本在推理效率上极具优势——更少的参数激活量,更低的延迟和成本。

对比 Qwen 3.5:阿里的千问 3.5 在中文场景确实很强,但 Gemma 4 原生支持 140+ 语言意味着在多语言场景下你不需要为每种语言单独适配。

对比自有 Gemini API:如果你现在在用 Gemini API,但被调用成本和数据隐私困扰,Gemma 4 让你用近似的技术栈自建推理服务,数据完全不出域。

实操指南:模型选型与部署

选型决策树

你的场景是什么?
├── 移动端/IoT → E2B(2B参数)
│   └── 需要语音输入?→ E2B 原生支持
├── 移动端主力模型 → E4B(4B参数)
│   └── 手机上的完整 AI 助手
├── 服务端,追求性价比 → 26B MoE
│   └── 单张 RTX 4090 可跑,Arena 全球第六
└── 服务端,追求最高性能 → 31B Dense
    └── Arena 全球第三,需要 A100 级 GPU

快速上手:用 Ollama 本地运行

最快的体验方式是用 Ollama:

# 安装 Ollama(如果还没有)
curl -fsSL https://ollama.com/install.sh | sh

# 拉取 Gemma 4 26B MoE(推荐首选)
ollama pull gemma4:26b

# 开始对话
ollama run gemma4:26b

如果你的显存有限(8GB 以下),用 E4B:

ollama pull gemma4:e4b
ollama run gemma4:e4b

用 Hugging Face Transformers 加载

from transformers import AutoModelForCausalLM, AutoTokenizer

model_name = "google/gemma-4-31b"
tokenizer = AutoTokenizer.from_pretrained(model_name)
model = AutoModelForCausalLM.from_pretrained(
    model_name,
    device_map="auto",
    torch_dtype="auto",
)

prompt = "Explain the difference between MoE and dense models"
inputs = tokenizer(prompt, return_tensors="pt").to(model.device)
outputs = model.generate(**inputs, max_new_tokens=512)
print(tokenizer.decode(outputs[0], skip_special_tokens=True))

用 vLLM 部署推理服务

# 安装 vLLM
pip install vllm

# 启动 OpenAI 兼容的 API 服务
python -m vllm.entrypoints.openai.api_server \
    --model google/gemma-4-26b-moe \
    --tensor-parallel-size 2 \
    --max-model-len 131072

这会在 http://localhost:8000 启动一个与 OpenAI API 完全兼容的推理服务,你的现有代码几乎不需要改动。

常见问题

Gemma 4 能在 Mac M 系列芯片上跑吗?

可以。E2B 和 E4B 都可以在 M2/M3/M4 的统一内存上流畅运行。26B MoE 需要至少 32GB 内存的 Mac。31B Dense 建议 64GB 以上。用 Ollama 或 MLX 框架都可以。

Gemma 4 和 Gemini API 有什么关系?用 Gemma 4 能达到 Gemini 的效果吗?

Gemma 4 和 Gemini 3 共享底层技术和训练方法,但 Gemini 的参数规模大得多。Gemma 4 31B 大约能达到 Gemini Pro 70-80% 的水平,但推理成本低一个数量级。对大多数应用来说这个差距完全可以接受。

Apache 2.0 意味着我可以用 Gemma 4 的输出来训练自己的模型吗?

可以。Apache 2.0 对模型输出没有任何限制。你可以用 Gemma 4 生成合成数据来训练你自己的模型,完全合法合规。这也是 Apache 2.0 比 Llama 许可证更友好的一个关键点。

JR Academy 相关资源

如果你想系统学习 AI 开发和大模型部署,这些资源可以帮到你:

  • AI 全栈开发课程 — 从 API 调用到本地模型部署,完整覆盖 AI 应用开发全流程
  • DevOps & Cloud 学习路线 — 掌握 GPU 服务器部署、容器化推理服务等基础设施技能,为本地大模型部署做好准备
Author
Share or copy the link
← Previous article世界模型 vs LLM:LeCun 的 $10 亿赌注能否颠覆 AI 格局Next article →🇦🇺 发现一个神操作,零基础1周拿下谷歌云证书!

Related articles

🇦🇺测一下:袋鼠国码农能当FDE吗?

2026-12-01

Monash 研究:肠道酸度是膳食纤维降血压的关键;AI 搬运新闻冲击维州选举信息;MPAC 公布 2027 演出季

2026-12-01

Adelaide 物理学家获 $250,000 总理科学奖;全球葡萄酒消费六十年降四分之一;残障师范生实习障碍研究

2026-12-01

DVA-C03今日上线首发 · Google Cloud AI Agent认证完整解析 · AZ-401本月GA替代AZ-400

2026-12-01

Anthropic推迟下一代模型并调百人做安全,AWS推出AI办公三件套,Google让用户单独关掉AI训练

2026-12-01

GitHub Copilot 实战指南 — Copilot AI Code Review:30 秒让 AI 帮你审 PR,三档深度随需切换

2026-11-30
View all articles →

Done reading? Next steps

Not sure what to learn next? Tell us where you are

Tell us what you do now and where you want to go. See your gaps in skills, evidence, experience, expression and positioning, and what to work on first. No sign-in needed.

Compare with my situation
  • SkillLearn AI for free by pathVibe Coding, AI at work, prompting, AI engineering and more, chapter by chapter from the basics.All learning paths →
  • PositioningLearning roadmaps by roleFrontend, backend, data, AI and more, laid out stage by stage in the order to learn them.All roadmaps →
  • ExpressionTry an AI mock interviewPick a role and run a mock interview to practise explaining your experience and projects.Practise now →

Not sure what to do next?

Take this page's topic with you and see where your gaps are.

Compare with my situation
JR Academy
AI learning for the global Chinese community
BootcampsFree resourcesLearn AICareer coaching
精选推荐
AI Career Impact Map
Assess career exposure and explore transition paths and learning options
Popular tool
AI & Data Bootcamps
Build your skills through structured courses and hands-on projects
Popular courses
1:1 Career Coaching
Work with an experienced mentor on your resume and interview preparation
Career coaching
Custom Corporate Training
AI training tailored to your team
Business services
Popular tags
Vibe CodingAI codingCursorClaudeJob searchPromptFrontend developmentBackend development
Subscribe to updates

Receive AI learning resources, technical tutorials and career advice by email.

We respect your privacy and do not send spam.