Open ChuckHend opened 6 days ago
not only embedding but also other things beside OLLAMA like calling api can help a lot, for example I can not use it with persian embedding and some other models.
We do have support for Ollama (thanks to @destrex271) - but we are pretty light on documentation on using it is.
https://github.com/tembo-io/pg_vectorize/blob/main/core/src/transformers/providers/ollama.rs
can we change this
We do have support for Ollama (thanks to @destrex271) - but we are pretty light on documentation on using it is.
https://github.com/tembo-io/pg_vectorize/blob/main/core/src/transformers/providers/ollama.rs
can you change this pub const OLLAMA_BASE_URL: &str = "http://localhost:3001";
to env variables and optional apikey ? so we can support other online ollama like compatible webservices
Yes it can be changed. It is a configuration is Postgres:
When you run this with docker-compose it gets set to the docker service name by default.
postgres=# show vectorize.ollama_service_url ;
vectorize.ollama_service_url
----------------------------------
http://ollama-serve:3001/v1/chat
(1 row)
but it can be set to whatever value you want, e.g. ALTER SYSTEM SET vectorize.ollama_service_url to 'https://www.myservice.ai/embeddings'
. The assumption here is that whatever service running at vectorize.ollama_service_url
has an API (request and response) schema exactly like Ollama's.
Similarly, you can change the OpenAI url so long as the server running has the same API schema as OpenAI
postgres=# show vectorize.openai_service_url ;
vectorize.openai_service_url
------------------------------
https://api.openai.com/v1
(1 row)
All the Postgres settings that can be changed are defined here: https://github.com/tembo-io/pg_vectorize/blob/main/extension/src/guc.rs
Let me try it
Let me know if you run into any issues. Can ping me here, or in the Tembo community slack.
/attempt #152
with your implementation plan/claim #152
in the PR body to claim the bountyThank you for contributing to tembo-io/pg_vectorize!
add support for embeddings from:
Embedding providers are added by implementing the required traits. For example see the implementation for Cohere