How can I set 0 "thinkingBudget" with Vertex AI Gemini 2.5Flash? I wanna disable it

What I want

I want to use Vertex AI Gemini 2.5Flash but wanna disable the thinking function.

Currently it seems the thinkingBudget is active in default.

situation

My code is below. I thought the thinkingBudget will be 0 with this.

But in a current Gemini response, I found this↓↓

"usageMetadata": { "thoughtsTokenCount": 8192 }

I think this means the thinking mode is active, I need to disable it, It will be huge difference in cost.

How Can I do that??


import { VertexAI } from "@google-cloud/vertexai";

return this.vertexAI.getGenerativeModel({
model: "gemini-2.5-flash-preview-04-17",
generationConfig: {
responseMimeType: "application/json",
temperature: 0,
maxOutputTokens: 8192,
},
});

What I did

I read these official document and the code of “vertexAI.getGenerativeModel”.

And there was no writing part about how to disable thinkingBudget.

Thank you for your help

@Mizo :

You will need to use the Google GenAI SDK

const {GoogleGenAI} = require('@google/genai');

See examples in https://github.com/GoogleCloudPlatform/nodejs-docs-samples/tree/main/genai

Then set the thinkingBudget to 0 as below:

const response = await ai.models.generateContent({
    model: 'gemini-2.5-flash-preview-04-17',
    contents: prompt,
    config: {
      thinkingConfig : {
        thinkingBudget: 0,
      },
    },
  });

Hi @ericdong We have GSU purchased for 2.5 Flash and therefore need this feature in Vertex AI nodejs SDK. Thoughts and Help on this?

@Bhuwan_S : The Gemini 2.0 and 2.5 new features are only supported by the Google Gen AI SDK. The Gen AI SDK for JavaScript is now generally available. See details in https://cloud.google.com/vertex-ai/generative-ai/docs/sdks/overview.