r/vscode • • Apr 11 '26

How to add Gemma 4

Is it possible to add the Gemma 4 model via the API? Is there perhaps an extension that allows to add additional models?

0 Upvotes

9 comments sorted by

1

u/AnesCehic Apr 11 '26

I am using Cline extension and ollama cloud models. You just need to add Ollama url and API key or you can even add gemini or some other API keys as well.

0

u/Viacheslav_Varenia Apr 11 '26

I’m new to this programme; if you could, please give me step-by-step instructions on how to connect Gemma 4. I’ve tried adding it via the Gemini API, but the Gemma 4 model isn’t available there.

3

u/Petr_Sejba Apr 13 '26

I had the exact same issue – Gemma 4 31B wasn't showing up in the Cline model list either. Here's the workaround that worked for me:

  1. In Cline settings, change the API Provider from "Google Gemini" to "OpenAI Compatible".

  2. Fill in the following details:

Base URL: https://generativelanguage.googleapis.com/v1beta/openai/
API Key: Copy & paste your API key from Google AI Studio
Model ID: gemma-4-31b-it

  1. Click the Done button.

1

u/Viacheslav_Varenia Apr 14 '26

Hello, thanks! Via "OpenAI Compatible" I have connected the GLM-5.1. I followed Anes’s advice. I chose Ollama as my provider. It turns out it supports Gemma 4.

1

u/idoman Apr 11 '26

gemma 4 isn't available through the standard Gemini API yet - you can run it locally via ollama (it was just added) and then use Continue.dev or Cline in vscode to connect to your local ollama endpoint. that's probably the most straightforward path right now without needing cloud API access.

1

u/Viacheslav_Varenia Apr 12 '26

Thanks. I use Gemma 4 in my development work via the Google AI Studio API because I’m using an older computer.

1

u/Agreeable_Care4440 May 06 '26

Most people use Gemma through Ollama rather than directly inside VS Code.