Issue is WIP and will be further refined.
LLM and embedding model sources are currently defined in GUC, e.g. vectorize.openai_service_url = https://api.openai.com/v1 contains the base url for OpenAI. This implementation introduces at least two limitatations:
- two vectorize projects cannot use two different urls for the same source. for example, project_a wants
vectorize.openai_service_url = https://api.openai.com/v1 and project_b wants vectorize.openai_service_url = https://myapi.mydomain.com/v1. The pg vectorize background worker reads the model source from the job's values in the vectorize.job table in order to know which guc to use.
- adding a new embedding source is cumbersome. adding GUCs requires a code change, and a new project relase.
Proposal: move GUCs into a table such as vectorize.model_sources to contain information such as the base url, schema, etc.
Considerations:
- How to handle API keys for each record in model source. Can this be a superuser only table, or does API key need to be a GUC?
- API request/response schemas. These are currently defined in code, but we could also define these in json mapping using a framework like jolt . There is an experiment of this implementation here. Using this framework would allow for adding arbitrary embedding and LLM sources via inserts to this model sources table.
Issue is WIP and will be further refined.
LLM and embedding model sources are currently defined in GUC, e.g.
vectorize.openai_service_url = https://api.openai.com/v1contains the base url for OpenAI. This implementation introduces at least two limitatations:vectorize.openai_service_url = https://api.openai.com/v1and project_b wantsvectorize.openai_service_url = https://myapi.mydomain.com/v1. The pg vectorize background worker reads the model source from the job's values in the vectorize.job table in order to know which guc to use.Proposal: move GUCs into a table such as
vectorize.model_sourcesto contain information such as the base url, schema, etc.Considerations: