How to use Gemma 4 with the Gemini API and Google AI Studio
Summary
Google has released the Gemma 4 family of open models, now accessible via the Gemini API and Google AI Studio. These models, built on the same research as Gemini 3, offer advanced reasoning, native function calling, multimodal understanding, and a 256K context window under an Apache 2.0 license. Currently, two models are available: `gemma-4-26b-a4b-it` and `gemma-4-31b-it`. The 31B dense model ranks #3 on the Arena AI text leaderboard, with the 26B MoE model at #6, demonstrating competitive performance against significantly larger models. Key features include native handling of structured JSON output and system instructions, multimodal capabilities for text, images, and video, and training across over 140 languages.
Key takeaway
For AI Engineers and Machine Learning Engineers developing applications requiring advanced, open-source models, Gemma 4 offers a compelling option. Its native function calling, 256K context window, and multimodal capabilities simplify complex integrations and expand application possibilities. You should explore its use for projects demanding high-performance, commercially viable models, especially when structured output or real-time web grounding is critical.
Key insights
Gemma 4 models offer advanced AI capabilities, including multimodal understanding and native function calling, under an open Apache 2.0 license.
Principles
- Native function calling simplifies integration.
- Large context windows enhance complex task handling.
- Open licensing promotes broad adoption.
Method
Access Gemma 4 via Google AI Studio for browser-based interaction or integrate using the Python SDK for text generation, multi-turn chats, image understanding, function calling, and Google Search grounding.
In practice
- Use `gemma-4-31b-it` for top text generation.
- Employ system instructions for model behavior.
- Integrate Google Search for real-time data.
Topics
- Gemma 4 Models
- Gemini API
- Google AI Studio
- Function Calling
- Multimodal AI
Code references
Best for: AI Engineer, Machine Learning Engineer, Software Engineer
Related on AIssential
Editorial summary, takeaway, and curation by AIssential. Original article published by philschmid.de - RSS feed.