Mizo
May 14, 2025, 10:30pm
1
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 .
Hello @ericdong , can you please tell me if the thinking_budget parameter is by any chance available in python VertexAI SKD? Or should i move to the new GenAI SDK as well.
Thank you
@macato97 The Gemini 2.0 and above functionalities including thinking are only available in the new GenAI SDK. The Vertex AI SDK can be used to access Gemini 2.0 and above models but it doesn’t have those new model features. The generative AI part of the Vertex AI SDK is being deprecated.
1 Like