genkit icon indicating copy to clipboard operation
genkit copied to clipboard

Thinking budget

Open rouapps opened this issue 1 year ago • 7 comments

I am trying to upgrade from Gemini-2.0-Flash to 2.5 flash but would like to disable thinking, however thinking budget doesn't seem to be available yet on Genkit. I have tried from the Google AI documentation but it doesn't seem to work on Genkit: config: { thinkingConfig: { thinkingBudget: 0, }, }

Thanks!

rouapps avatar Apr 19 '25 06:04 rouapps

facing the same issue right now

alexklimin89 avatar Apr 22 '25 08:04 alexklimin89

So the past PR wasnt merged because of issues. Meaning this is still an open issue. I did see that thinking budget for Go was merged in https://github.com/firebase/genkit/pull/2846

@EduardWayland any clue what was wrong with your previous code?

rvh70 avatar May 26 '25 19:05 rvh70

So the past PR wasnt merged because of issues. Meaning this is still an open issue. I did see that thinking budget for Go was merged in #2846

@EduardWayland any clue what was wrong with your previous code?

Hi @rvh70, actually nothing was wrong with the PR itself. The issue was the behavior of the dashboard UI with those two new configuration options as shown in #2880. They would need to improve that first.

Anyway, you can still use those options by yourself, see #2848 (released with 1.8.0).

EduardWayland avatar May 26 '25 19:05 EduardWayland

Thanks for that link to the 1.8.0 release! Still neet to get the hang of this package (and Genkit in general)

rvh70 avatar May 26 '25 20:05 rvh70

Trying to understand. SO, how to enable thinking budget for JS version of Genkit? Docs have no info.

dosstx avatar Jul 08 '25 11:07 dosstx

Hey, this worked for me

    const ai = new GoogleGenAI({ apiKey: "YOUR_KEY" });


    const response = await ai.models.generateContent({
      model,
      contents,
      config: {
        ...
        thinkingConfig: { thinkingBudget: 8000 }
      }
    });

Rytis-J avatar Jul 08 '25 11:07 Rytis-J

Thinking budget support landed shortly after this was filed. Config passthrough shipped in #2848 (released in 1.8.0), so the exact snippet from the original post, config: { thinkingConfig: { thinkingBudget: 0 } }, works to disable thinking on the 2.5 models. The current @genkit-ai/google-genai plugin also types thinkingConfig.thinkingBudget directly (0 disables thinking), and Go got the same in #2846. Closing as fixed.

hilariie avatar Jul 23 '26 11:07 hilariie