smartcat icon indicating copy to clipboard operation
smartcat copied to clipboard

Google Gemini support

Open aurelg opened this issue 10 months ago • 6 comments

Thanks for this awesome tool!

Gemini models are pretty good, and Google offers a generous free tier. Would it be possible to add support for their API?

aurelg avatar Feb 03 '25 09:02 aurelg

@aurelg for what it's worth, I got Google's gemini's models to work in this fork a while back: https://github.com/a1v0lut10n/smartcat-gemini in this PR: https://github.com/a1v0lut10n/smartcat-gemini/pull/1. Was in a rush to try gemini's larger context windows with smartcat, and I did not get around to try and turn this into a contribution. But perhaps it is useful towards having Gemini support.

a1v0lut10n avatar Feb 03 '25 11:02 a1v0lut10n

Hey @a1v0lut10n I already had noticed your work, and I cease this opportunity to say I would love for you to open a PR on this repo 😁

efugier avatar Feb 24 '25 00:02 efugier

@aurelg I'd love smartcat to become gemini-compatible, I'm just a bit short on time atm, super open to contribs!

efugier avatar Feb 24 '25 00:02 efugier

@efugier I'd be happy to create a PR adding gemini support.

a1v0lut10n avatar Feb 25 '25 08:02 a1v0lut10n

For others reading this, the gemini api is compatible with the openai api, so this just works:

[openai]
url = "https://generativelanguage.googleapis.com/v1beta/chat/completions"
default_model = "gemini-2.0-flash"
api_key = ""

gnur avatar Feb 25 '25 10:02 gnur

For others reading this, the gemini api is compatible with the openai api, so this just works:

Thanks, though I needed to get an API key now. From https://ai.google.dev/gemini-api/ - Maybe it stopped working for free.

I still had to put the key into the file directly, since it doesn't support something like $GEMINI_API_KEY - but I have no paid account, so I hope this is fine for now.

NoidoDev avatar Jun 11 '25 05:06 NoidoDev