Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature]: Google Gemini support #376

Open
donbowman opened this issue Jan 19, 2025 · 2 comments
Open

[Feature]: Google Gemini support #376

donbowman opened this issue Jan 19, 2025 · 2 comments

Comments

@donbowman
Copy link

What problem does the new feature solve?

How may I use this with Google Gemini? I believe it supports both its own APi and also a compatibility API.
https://developers.googleblog.com/en/gemini-is-now-accessible-from-the-openai-library/

I tried

select ai.ollama_generate( 'gemini-1.5-flash', 'what is the weather in waterloo in june', host=>'https://generativelanguage.googleapis.com/v1beta/');

I looked at some proxies, but don't believe that is a good approach.

What does the feature do?

Make Gemini a peer to Ollama and OpenAI

Implementation challenges

No response

Are you going to work on this feature?

None

@alejandrodnm
Copy link
Contributor

@donbowman we've just merged support for liteLLM. We released a new version of the vectorizer worker with support for it, but we haven't made a new extension release there are some pending things like docs:

https://github.com/timescale/pgai/pull/397/files

You could try building the extension from source. Then specify the model with gemini/text-embedding-004, something like:

    SELECT ai.create_vectorizer(
        'my_table'::regclass,
        embedding => ai.embedding_litellm(
          'gemini/text-embedding-004',
          768,
          api_key_name => 'GEMINI_API_KEY'
        ));

@donbowman
Copy link
Author

excellent!
I am still working on the PR, but got bogged down in both it and other things. its working but one of the tests fails still.

I was also adding the e.g. query lookup.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants