From d29cc5459387d5207dfb73deb3321f4d55cdd0a4 Mon Sep 17 00:00:00 2001 From: Dj Walker-Morgan Date: Thu, 30 Jan 2025 09:31:35 +0000 Subject: [PATCH 01/12] Updates for 2.1.1 credentials Signed-off-by: Dj Walker-Morgan --- .../models/openai-api-compatibility.mdx | 2 +- .../ai-accelerator/models/using-models.mdx | 16 ++++++++++++ .../ai-accelerator/reference/models.mdx | 26 ++++++++++++++----- 3 files changed, 37 insertions(+), 7 deletions(-) diff --git a/advocacy_docs/edb-postgres-ai/ai-accelerator/models/openai-api-compatibility.mdx b/advocacy_docs/edb-postgres-ai/ai-accelerator/models/openai-api-compatibility.mdx index 42be732e6d2..10cb744ca66 100644 --- a/advocacy_docs/edb-postgres-ai/ai-accelerator/models/openai-api-compatibility.mdx +++ b/advocacy_docs/edb-postgres-ai/ai-accelerator/models/openai-api-compatibility.mdx @@ -56,7 +56,7 @@ That completes the configuration parameter. ### Credentials -The last parameter is the credentials parameter, which is another JSON string. It’s usually used for carrying the `api_key` for the OpenAI service and any other necessary credential information. It is not part of the configuration and by being separate, it can be securely hidden from users with lesser permissions. For our ollama connection, we don’t need an api\_key, but the model provider currently requires that one is specified. We can specify an empty string for the api\_key to satisfy this requirement. +The last parameter is the credentials parameter, which is another JSON string. It’s usually used for carrying the `api_key` for the OpenAI service and any other necessary credential information. It is not part of the configuration and by being separate, it can be securely hidden from users with lesser permissions. For our ollama connection, we don’t need an `api_key`, but the model provider currently requires that one is specified. We can specify an empty string for the `api_key` to satisfy this requirement. ## Using the model diff --git a/advocacy_docs/edb-postgres-ai/ai-accelerator/models/using-models.mdx b/advocacy_docs/edb-postgres-ai/ai-accelerator/models/using-models.mdx index d172956444c..8bd31872bc0 100644 --- a/advocacy_docs/edb-postgres-ai/ai-accelerator/models/using-models.mdx +++ b/advocacy_docs/edb-postgres-ai/ai-accelerator/models/using-models.mdx @@ -101,6 +101,22 @@ SELECT aidb.create_model( This will create the `text-embedding-3-large` model with the name `my_openai_embeddings`. You can now use this model in your Pipelines functions to generate embeddings for text data. +Where models do use credentials, the credentials set in the first use of create model for the model provider will be used with all subsequent uses of that model. It is not possible to use different credentia;s for different models that use the same provider. + +If you need to change the credentials, you can use the `replace_credentials` option when creating a new model that updates the credentials for the model provider. + +```sql +SELECT aidb.create_model( + 'my_new_openai_model', + 'openai_completions', + '{"model": "gpt-4o"}'::JSONB, + '{"api_key": "sk-ngl234meh789ski1111bid011i"}'::JSONB, + replace_credentials => true + ); +``` + +You can delete the new model with `SELECT aidb.delete_model('my_new_openai_model')` if you only needed to change the credentials. + ## Using models with OpenAI compatible APIs These OpenAI models work with any OpenAI compatible API. This allows you to connect and use an even wider range of models, just by passing the appropriate API endpoint to the `url` option in the `aidb.create_model` function's options. diff --git a/advocacy_docs/edb-postgres-ai/ai-accelerator/reference/models.mdx b/advocacy_docs/edb-postgres-ai/ai-accelerator/reference/models.mdx index c830f065e85..803e34ff0a4 100644 --- a/advocacy_docs/edb-postgres-ai/ai-accelerator/reference/models.mdx +++ b/advocacy_docs/edb-postgres-ai/ai-accelerator/reference/models.mdx @@ -27,12 +27,13 @@ Creates a new model in the system by saving its name, provider and optional conf #### Parameters -| Parameter | Type | Default | Description | -|---------------|-------|-------------|----------------------------------------------------------------------------------------| -| `name` | text | | User defined name for the model. | -| `provider` | text | | Name of the model provider (as found in [aidb.model_providers](#aidbmodel_providers)). | -| `config` | jsonb | '{}'::jsonb | Optional configuration for the model provider. | -| `credentials` | jsonb | '{}'::jsonb | Optional credentials for the model provider. | +| Parameter | Type | Default | Description | +|-----------------------|---------|-------------|-------------------------------------------------------------------------------------------------------------| +| `name` | text | | User defined name for the model. | +| `provider` | text | | Name of the model provider (as found in [aidb.model_providers](#aidbmodel_providers)). | +| `config` | jsonb | '{}'::jsonb | Optional configuration for the model provider. | +| `credentials` | jsonb | '{}'::jsonb | Optional credentials for the model provider. | +| `replace_credentials` | boolean | false | If true, replace the credentials for the model provider. If false, the credentials will not be overwritten. | #### Example @@ -52,6 +53,19 @@ or equivalently, using default values: SELECT aidb.create_model('my_t5', 't5_local'); ``` +or if updating the credentials of a model's provider, which has already been created. + +```sql +SELECT aidb.create_model( + name => 'my_t5'::text, + provider => 't5_local'::character varying, + config => '{"param1": "value1", "param2": "value2"}'::jsonb, + credentials => '{"token": "abcd"}'::jsonb, + replace_credentials => true + ); +``` + + ### `aidb.list_models` Returns a list of all models in the registry and their configured options. From 0847c394de58b10cbb91459ab1991ba6bf6dcfae Mon Sep 17 00:00:00 2001 From: Dj Walker-Morgan Date: Fri, 31 Jan 2025 13:06:27 +0000 Subject: [PATCH 02/12] NIM updates Signed-off-by: Dj Walker-Morgan --- .../ai-accelerator/installing/complete.mdx | 4 +- .../ai-accelerator/installing/index.mdx | 1 - .../ai-accelerator/limitations.mdx | 11 ++ .../models/openai-api-compatibility.mdx | 6 +- .../ai-accelerator/models/primitives.mdx | 14 +++ .../models/supported-models/completions.mdx | 104 ++++++++++++++++++ .../{openai-embeddings.mdx => embeddings.mdx} | 53 +++++---- .../models/supported-models/index.mdx | 13 ++- .../models/supported-models/nim_clip.mdx | 54 +++++++++ .../models/supported-models/nim_reranking.mdx | 48 ++++++++ .../supported-models/openai-completions.mdx | 56 ---------- .../ai-accelerator/models/using-models.mdx | 14 ++- .../ai-accelerator/reference/index.mdx | 6 + .../ai-accelerator/reference/models.mdx | 17 +++ .../rel_notes/src/rel_notes_2.1.1.yml | 17 +++ 15 files changed, 323 insertions(+), 95 deletions(-) create mode 100644 advocacy_docs/edb-postgres-ai/ai-accelerator/models/supported-models/completions.mdx rename advocacy_docs/edb-postgres-ai/ai-accelerator/models/supported-models/{openai-embeddings.mdx => embeddings.mdx} (55%) create mode 100644 advocacy_docs/edb-postgres-ai/ai-accelerator/models/supported-models/nim_clip.mdx create mode 100644 advocacy_docs/edb-postgres-ai/ai-accelerator/models/supported-models/nim_reranking.mdx delete mode 100644 advocacy_docs/edb-postgres-ai/ai-accelerator/models/supported-models/openai-completions.mdx create mode 100644 advocacy_docs/edb-postgres-ai/ai-accelerator/rel_notes/src/rel_notes_2.1.1.yml diff --git a/advocacy_docs/edb-postgres-ai/ai-accelerator/installing/complete.mdx b/advocacy_docs/edb-postgres-ai/ai-accelerator/installing/complete.mdx index 76e8034827e..cb8a5e13e4f 100644 --- a/advocacy_docs/edb-postgres-ai/ai-accelerator/installing/complete.mdx +++ b/advocacy_docs/edb-postgres-ai/ai-accelerator/installing/complete.mdx @@ -34,8 +34,8 @@ __OUTPUT__ List of installed extensions Name | Version | Schema | Description ------------------+---------+------------+------------------------------------------------------------ - aidb | 1.0.7 | aidb | aidb: makes it easy to build AI applications with postgres - pgfs | 1.0.4 | pgfs | pgfs: enables access to filesystem-like storage locations + aidb | 2.1.1 | aidb | aidb: makes it easy to build AI applications with postgres + pgfs | 1.0.6 | pgfs | pgfs: enables access to filesystem-like storage locations vector | 0.8.0 | public | vector data type and ivfflat and hnsw access methods ``` diff --git a/advocacy_docs/edb-postgres-ai/ai-accelerator/installing/index.mdx b/advocacy_docs/edb-postgres-ai/ai-accelerator/installing/index.mdx index 7df0a19b640..a97d6c9a638 100644 --- a/advocacy_docs/edb-postgres-ai/ai-accelerator/installing/index.mdx +++ b/advocacy_docs/edb-postgres-ai/ai-accelerator/installing/index.mdx @@ -12,4 +12,3 @@ Pipelines is delivered as a set of extensions. Depending on how you are deployin - [Manually installing pipelines packages](packages) Once the packages are installed, you can [complete the installation](complete) by activating the extensions within Postgres. - diff --git a/advocacy_docs/edb-postgres-ai/ai-accelerator/limitations.mdx b/advocacy_docs/edb-postgres-ai/ai-accelerator/limitations.mdx index aea7609a886..46c2a560576 100644 --- a/advocacy_docs/edb-postgres-ai/ai-accelerator/limitations.mdx +++ b/advocacy_docs/edb-postgres-ai/ai-accelerator/limitations.mdx @@ -32,3 +32,14 @@ The impact of this depends on what type of embedding is being performed. ### Data Formats * Pipelines currently only supports Text and Image formats. Other formats, including structured data, video, and audio, are not currently supported. + +### Upgrading + +When upgrading the aidb and pgfs extension, there is currently no support for Postgres extension upgrades. You must therefor drop and recreate the extensions when upgrading to a new version of the extensions. + +```sql +DROP EXTENSION aidb CASCADE; +DROP EXTENSION pgfs CASCADE; +CREATE EXTENSION aidb CASCADE; +CREATE EXTENSION pgfs CASCADE; +``` diff --git a/advocacy_docs/edb-postgres-ai/ai-accelerator/models/openai-api-compatibility.mdx b/advocacy_docs/edb-postgres-ai/ai-accelerator/models/openai-api-compatibility.mdx index 10cb744ca66..0e0d5e24569 100644 --- a/advocacy_docs/edb-postgres-ai/ai-accelerator/models/openai-api-compatibility.mdx +++ b/advocacy_docs/edb-postgres-ai/ai-accelerator/models/openai-api-compatibility.mdx @@ -4,7 +4,7 @@ navTitle: "OpenAI Compatible Models" description: "Using an OpenAI compatible API with Pipelines by setting options and credentials." --- -To make use of an OpenAI compliant API, you can use the openai_embeddings or openai_completions model providers. Note that a retriever will need to encode first so you can only use the embeddings model provider with a retriever. +To make use of an OpenAI compliant API, you can use the embeddings or completions model providers. Note that a retriever will need to encode first so you can only use the embeddings model provider with a retriever. ## Why use an OpenAI compatible API? @@ -21,7 +21,7 @@ The starting point for this process is creating a model. When you create a model ```sql select aidb.create_model( 'my_local_ollama', -'openai_embeddings', +'embeddings', '{"model":"llama3.3", "url":"http://llama.local:11434/v1/embeddings", "dimensions":8192}'::JSONB, '{"api_key":""}'::JSONB); ``` @@ -30,7 +30,7 @@ select aidb.create_model( The model name is the first parameter and set to “my_local_ollama” which we will use later. -We specify the model provider as “openai_embeddings” which is the provider that defaults to using OpenAI servers, but can be overridden by the configuration (the next parameter), to talk to any compliant server. +We specify the model provider as “embeddings” which is the provider that defaults to using OpenAI servers, but can be overridden by the configuration (the next parameter), to talk to any compliant server. ### Configuration diff --git a/advocacy_docs/edb-postgres-ai/ai-accelerator/models/primitives.mdx b/advocacy_docs/edb-postgres-ai/ai-accelerator/models/primitives.mdx index 4c90ab98cae..565ba6da4d2 100644 --- a/advocacy_docs/edb-postgres-ai/ai-accelerator/models/primitives.mdx +++ b/advocacy_docs/edb-postgres-ai/ai-accelerator/models/primitives.mdx @@ -65,3 +65,17 @@ select aidb.decode_text_batch('my_bert_model', ARRAY[ 'summarize: The missile knows where it is at all times. It knows this because it knows where it isn''t. By subtracting where it is from where it isn''t, or where it isn''t from where it is (whichever is greater), it obtains a difference, or deviation. The guidance subsystem uses deviations to generate corrective commands to drive the missile from a position where it is to a position where it isn''t, and arriving at a position where it wasn''t, it now is.' ]); ``` + +## Rerank Text + +Call aidb.rerank_text to get text reranking logits. + +```sql +SELECT aidb.rerank_text('my_reranking_model', + 'What is the best open source database?', + ARRAY[ + 'PostgreSQL', + 'The quick brown fox jumps over the lazy dog.', + 'Hercule Poirot' + ]); +``` diff --git a/advocacy_docs/edb-postgres-ai/ai-accelerator/models/supported-models/completions.mdx b/advocacy_docs/edb-postgres-ai/ai-accelerator/models/supported-models/completions.mdx new file mode 100644 index 00000000000..b1fd3c5bbec --- /dev/null +++ b/advocacy_docs/edb-postgres-ai/ai-accelerator/models/supported-models/completions.mdx @@ -0,0 +1,104 @@ +--- +title: "Completions" +navTitle: "Completions" +description: "Completions is a text completion model that enables use of any OpenAI API compatible text generation model." +--- + +Model name: `completions` + +Model aliases: + +* `openai_completions` +* `nim_completions` + +## About Completions + +Completions is a text completion model that enables use of any OpenAI API compatible text generation model. + +It is suitable for chat/text transforms, text completion, and other text generation tasks. + +Depending on the name of the model, the model provider will set defaults accordingly. + +When invoked as `completions` or `openai_completions`, the model provider will default to using the OpenAI API. + +When invoked as `nim_completions`, the model provider will default to using the NVIDIA NIM API. + + +## Supported aidb operations + +* decode_text +* decode_text_batch + +## Supported models + +* Any text generation model that is supported by the provider. + +## Supported OpenAI models + +See a list of supported OpenAI models [here](https://platform.openai.com/docs/models#models-overview). + +## Supported NIM models + +* [ibm/granite-guardian-3.0-8b](https://build.nvidia.com/ibm/granite-guardian-3_0-8b) +* [ibm/granite-3.0-8b-instruct](https://build.nvidia.com/ibm/granite-3_0-8b-instruct) +* [ibm/granite-3.0-3b-a800m-instruct](https://build.nvidia.com/ibm/granite-3_0-3b-a800m-instruct) +* [meta/llama-3.3-70b-instruct](https://build.nvidia.com/meta/llama-3_3-70b-instruct) +* [meta/llama-3.2-3b-instruct](https://build.nvidia.com/meta/llama-3.2-3b-instruct) +* [meta/llama-3.2-1b-instruct](https://build.nvidia.com/meta/llama-3.2-1b-instruct) +* [meta/llama-3.1-405b-instruct](https://build.nvidia.com/meta/llama-3_1-405b-instruct) +* [meta/llama-3.1-70b-instruct](https://build.nvidia.com/meta/llama-3_1-70b-instruct) +* [meta/llama-3.1-8b-instruct](https://build.nvidia.com/meta/llama-3_1-8b-instruct) +* [meta/llama3-70b-instruct](https://build.nvidia.com/meta/llama3-70b) +* [meta/llama3-8b-instruct](https://build.nvidia.com/meta/llama3-8b) +* [nvidia/llama-3.1-nemotron-70b-instruct](https://build.nvidia.com/nvidia/llama-3_1-nemotron-70b-instruct) +* [nvidia/llama-3.1-nemotron-51b-instruct](https://build.nvidia.com/nvidia/llama-3_1-nemotron-51b-instruct) +* [nvidia/nemotron-mini-4b-instruct](https://build.nvidia.com/nvidia/nemotron-mini-4b-instruct) +* [nvidia/nemotron-4-340b-instruct](https://build.nvidia.com/nvidia/nemotron-4-340b-instruct) +* [google/shieldgemma-9b](https://build.nvidia.com/google/shieldgemma-9b) +* [google/gemma-7b](https://build.nvidia.com/google/gemma-7b) +* [google/codegemma-7b](https://build.nvidia.com/google/codegemma-7b) + +## Creating the default model + +There is no default model for Completions. You can create any supported model using the `aidb.create_model` function. + +## Creating an OpenAI model + +You can create any supported OpenAI model using the `aidb.create_model` function. + +In this example, we are creating a GPT-4o model with the name `my_openai_model`: + +```sql +SELECT aidb.create_model( + 'my_openai_model', + 'openai_completions', + '{"model": "gpt-4o"}'::JSONB, + '{"api_key": "sk-abc123xyz456def789ghi012jkl345mn"}'::JSONB +); +``` + +## Creating a NIM model + +```sql +SELECT aidb.create_model( + 'my_nim_completions', + 'nim_completions', + '{"model": "meta/llama-3.2-1b-instruct"}'::JSONB, + credentials=>'{"api_key": "sk-abc123xyz456def789ghi012jkl345mn"'::JSONB); +``` + +## Model configuration settings + +The following configuration settings are available for OpenAI models: + +* `model` - The model to use. +* `url` - The URL of the model to use. This is optional and can be used to specify a custom model URL. + * If `openai_completions` (or `completions`) is the `model`, `url` defaults to `https://api.openai.com/v1/chat/completions`. + * If `nim_completions` is the `model`, `url` defaults to `https://integrate.api.nvidia.com/v1/chat/completions`. +* `max_concurrent_requests` - The maximum number of concurrent requests to make to the OpenAI model. Defaults to `25`. + +## Model credentials + +The following credentials are required for these models: + +* `api_key` - The API key to use for authentication. diff --git a/advocacy_docs/edb-postgres-ai/ai-accelerator/models/supported-models/openai-embeddings.mdx b/advocacy_docs/edb-postgres-ai/ai-accelerator/models/supported-models/embeddings.mdx similarity index 55% rename from advocacy_docs/edb-postgres-ai/ai-accelerator/models/supported-models/openai-embeddings.mdx rename to advocacy_docs/edb-postgres-ai/ai-accelerator/models/supported-models/embeddings.mdx index 4a18cdd522d..28d0cbacfa6 100644 --- a/advocacy_docs/edb-postgres-ai/ai-accelerator/models/supported-models/openai-embeddings.mdx +++ b/advocacy_docs/edb-postgres-ai/ai-accelerator/models/supported-models/embeddings.mdx @@ -1,16 +1,25 @@ --- -title: "OpenAI Embeddings" -navTitle: "OpenAI Embeddings" -description: "OpenAI Embeddings is a text embedding model that enables use of any OpenAI text embedding model." +title: "Embeddings" +navTitle: "Embeddings" +description: "Embeddings is a text embedding model that enables use of any OpenAI API compatible text embedding model." --- -Model name: `openai_embeddings` +Model name: `embeddings` -## About OpenAI Embeddings +Model aliases: -OpenAI Embeddings is a text embedding model that enables use of any supported OpenAI text embedding model. It is suitable for text classification, clustering, and other text embedding tasks. +* `openai_embeddings` +* `nim_embeddings` -See a list of supported OpenAI models [here](https://platform.openai.com/docs/guides/embeddings#embedding-models). +## About Embeddings + +OpenAI Embeddings is a text embedding model that enables use of any OpenAI API complatible text embedding model. It is suitable for text classification, clustering, and other text embedding tasks. + +Depending on the name of the model, the model provider will set defaults accordingly. + +When invoked as `embeddings` or `openai_embeddings`, the model provider will default to using the OpenAI API. + +When invoked as `nim_embeddings`, the model provider will default to using the NVIDIA NIM API. ## Supported aidb operations @@ -19,10 +28,18 @@ See a list of supported OpenAI models [here](https://platform.openai.com/docs/gu ## Supported models -* Any text embedding model that is supported by OpenAI. This includes `text-embedding-3-small`, `text-embedding-3-large`, and `text-embedding-ada-002`. +* Any text embedding model that is supported by the provider. + +### Supported OpenAI models + +* Any text embedding model that is supported by OpenAI. This includes `text-embedding-3-small`, `text-embedding-3-large`, and `text-embedding-ada-002`. See a list of supported OpenAI models [here](https://platform.openai.com/docs/guides/embeddings#embedding-models). * Defaults to `text-embedding-3-small`. -## Creating the default model +### Supported NIM models + +* [nvidia/nv-embedqa-e5-v5](https://build.nvidia.com/nvidia/nv-embedqa-e5-v5) (default) + +## Creating the default with OpenAI model ```sql SELECT aidb.create_model('my_openai_embeddings', @@ -52,23 +69,11 @@ Because we are passing the configuration options and the credentials, unlike the The following configuration settings are available for OpenAI models: * `model` - The OpenAI model to use. -* `url` - The URL of the OpenAI model to use. This is optional and can be used to specify a custom model URL. Defaults to `https://api.openai.com/v1/chat/completions`. +* `url` - The URL of the model to use. This is optional and can be used to specify a custom model URL. + * If `openai_completions` (or `completions`) is the `model`, `url` defaults to `https://api.openai.com/v1/chat/completions`. + * If `nim_completions` is the `model`, `url` defaults to `https://integrate.api.nvidia.com/v1/chat/completions`. * `max_concurrent_requests` - The maximum number of concurrent requests to make to the OpenAI model. Defaults to `25`. -## Available OpenAI Embeddings models - -* sentence-transformers/all-MiniLM-L6-v2 (default) -* sentence-transformers/all-MiniLM-L6-v1 -* sentence-transformers/all-MiniLM-L12-v1 -* sentence-transformers/msmarco-bert-base-dot-v5 -* sentence-transformers/multi-qa-MiniLM-L6-dot-v1 -* sentence-transformers/paraphrase-TinyBERT-L6-v2 -* sentence-transformers/all-distilroberta-v1 -* sentence-transformers/all-MiniLM-L6-v2 -* sentence-transformers/multi-qa-MiniLM-L6-cos-v1 -* sentence-transformers/paraphrase-multilingual-mpnet-base-v2 -* sentence-transformers/paraphrase-multilingual-MiniLM-L12-v2 - ## Model credentials The following credentials are required for OpenAI models: diff --git a/advocacy_docs/edb-postgres-ai/ai-accelerator/models/supported-models/index.mdx b/advocacy_docs/edb-postgres-ai/ai-accelerator/models/supported-models/index.mdx index 59b628aaf42..5b3aa6eb68c 100644 --- a/advocacy_docs/edb-postgres-ai/ai-accelerator/models/supported-models/index.mdx +++ b/advocacy_docs/edb-postgres-ai/ai-accelerator/models/supported-models/index.mdx @@ -12,8 +12,11 @@ navigation: This section provides details of the supported models in EDB Postgres AI - AI Accelerator - Pipelines and their capabilities. -* [T5](t5) -* [OpenAI Embeddings](openai-embeddings) -* [OpenAI Completions](openai-completions) -* [BERT](bert) -* [CLIP](clip) +* [T5](t5). +* [Embeddings](embeddings), including openai-embeddings and nim-embeddings. +* [Completions](completions), including openai-completions and nim-completions. +* [BERT](bert). +* [CLIP](clip). +* [NIM_CLIP](nim_clip). +* [NIM_RERANKING](nim_reranking). + diff --git a/advocacy_docs/edb-postgres-ai/ai-accelerator/models/supported-models/nim_clip.mdx b/advocacy_docs/edb-postgres-ai/ai-accelerator/models/supported-models/nim_clip.mdx new file mode 100644 index 00000000000..c872e1211c8 --- /dev/null +++ b/advocacy_docs/edb-postgres-ai/ai-accelerator/models/supported-models/nim_clip.mdx @@ -0,0 +1,54 @@ +--- +title: "CLIP" +navTitle: "CLIP" +description: "CLIP (Contrastive Language-Image Pre-training) is a model that learns visual concepts from natural language supervision." +--- + +Model name: `nim_clip` + +## About CLIP + +CLIP (Contrastive Language-Image Pre-training) is a model that learns visual concepts from natural language supervision. It is a zero-shot learning model that can be used for a wide range of vision and language tasks. + +This specific model runs on NVIDIA NIM. More information about CLIP on NIM can be found [here](https://build.nvidia.com/nvidia/nvclip). + + +## Supported aidb operations + +* encode_text +* encode_text_batch +* encode_image +* encode_image_batch + +## Supported models + +### NVIDIA NGC + +* nvidia/nvclip (default) + + +## Creating the default model + +```sql +SELECT aidb.create_model( + 'my_nim_clip_model', + 'nim_clip', + credentials=>'{"api_key": ""'::JSONB +); +``` + +There is only one model, the default `nvidia/nvclip`, so we do not need to specify the model in the configuration. + +## Model configuration settings + +The following configuration settings are available for CLIP models: + +* `model` - The NIM model to use. The default is `nvidia/nvclip` and is the only model available. +* `url` - The URL of the model to use. This is optional and can be used to specify a custom model URL. Defaults to `https://integrate.api.nvidia.com/v1/embeddings`. +* `dimensions` - Model output vector size, defaults to 1024 + +## Model credentials + +The following credentials are required if executing inside NVIDIA NGC: + +* `api_key` - The NVIDIA Cloud API key to use for authentication. diff --git a/advocacy_docs/edb-postgres-ai/ai-accelerator/models/supported-models/nim_reranking.mdx b/advocacy_docs/edb-postgres-ai/ai-accelerator/models/supported-models/nim_reranking.mdx new file mode 100644 index 00000000000..3380a453c82 --- /dev/null +++ b/advocacy_docs/edb-postgres-ai/ai-accelerator/models/supported-models/nim_reranking.mdx @@ -0,0 +1,48 @@ +--- +title: "Reranking (NIM)" +navTitle: "reranking" +description: "Reranking is a method in text search that sorts results by relevance to make them more accurate." +--- + +Model name: `nim_reranking` + +## About Reranking + +Reranking is a method in text search that sorts results by relevance to make them more accurate. It gives scores to documents using cross-attention mechanisms, improving the initial search results. + +## Supported aidb operations + +* rerank_text + +## Supported models + +### NVIDIA NGC + +* nvidia/llama-3.2-nv-rerankqa-1b-v2 (default) + + + +## Creating the default model + +```sql +SELECT aidb.create_model( + 'my_nim_reranker', + 'nim_reranking', + credentials=>'{"api_key": ""'::JSONB +); +``` + +There is only one model, the default `nvidia/nvclip`, so we do not need to specify the model in the configuration. + +## Model configuration settings + +The following configuration settings are available for CLIP models: + +* `model` - The NIM model to use. The default is `nvidia/llama-3.2-nv-rerankqa-1b-v2` and is the only model available. +* `url` - The URL of the model to use. This is optional and can be used to specify a custom model URL. Defaults to `https://ai.api.nvidia.com/v1/retrieval`. + +## Model credentials + +The following credentials are required if executing inside NVIDIA NGC: + +* `api_key` - The NVIDIA Cloud API key to use for authentication. diff --git a/advocacy_docs/edb-postgres-ai/ai-accelerator/models/supported-models/openai-completions.mdx b/advocacy_docs/edb-postgres-ai/ai-accelerator/models/supported-models/openai-completions.mdx deleted file mode 100644 index fbf672d710b..00000000000 --- a/advocacy_docs/edb-postgres-ai/ai-accelerator/models/supported-models/openai-completions.mdx +++ /dev/null @@ -1,56 +0,0 @@ ---- -title: "OpenAI Completions" -navTitle: "OpenAI Completions" -description: "OpenAI Completions is a text completion model that enables use of any OpenAI text generation model." ---- - -Model name: `openai_completions` - -## About OpenAI Completions - -OpenAI Completions is a text completion model that enables use of any supported OpenAI text generation model. It is suitable for chat/text transforms, text completion, and other text generation tasks. - -See a list of supported OpenAI models [here](https://platform.openai.com/docs/models#models-overview). - -## Supported aidb operations - -* decode_text -* decode_text_batch - -## Supported models - -* Any text generation model that is supported by OpenAI. This includes models such as GPT-4o, GPT-4o mini, GPT-4 and GPT-3.5. - -## Creating the default model - -There is no default model for OpenAI Completions. You can create any supported OpenAI model using the `aidb.create_model` function. See [Creating a model](#creating-a-specific-model). - -## Creating a specific model - -You can create any supported OpenAI model using the `aidb.create_model` function. - -In this example, we are creating a GPT-4o model with the name `my_openai_model`: - -```sql -SELECT aidb.create_model( - 'my_openai_model', - 'openai_completions', - '{"model": "gpt-4o"}'::JSONB, - '{"api_key": "sk-abc123xyz456def789ghi012jkl345mn"}'::JSONB -); -``` - -## Model configuration settings - -The following configuration settings are available for OpenAI models: - -* `model` - The OpenAI model to use. -* `url` - The URL of the OpenAI model to use. This is optional and can be used to specify a custom model URL. Defaults to `https://api.openai.com/v1/chat/completions`. -* `max_concurrent_requests` - The maximum number of concurrent requests to make to the OpenAI model. Defaults to `25`. - -## Model credentials - -The following credentials are required for OpenAI models: - -* `api_key` - The OpenAI API key to use for authentication. - diff --git a/advocacy_docs/edb-postgres-ai/ai-accelerator/models/using-models.mdx b/advocacy_docs/edb-postgres-ai/ai-accelerator/models/using-models.mdx index 8bd31872bc0..b27ec20db49 100644 --- a/advocacy_docs/edb-postgres-ai/ai-accelerator/models/using-models.mdx +++ b/advocacy_docs/edb-postgres-ai/ai-accelerator/models/using-models.mdx @@ -49,11 +49,18 @@ __OUTPUT__ server_name | server_options --------------------+---------------- t5_local | + embeddings | + completions | openai_embeddings | openai_completions | + nim_completions | + nim_embeddings | + nim_clip | + nim_reranking | bert_local | clip_local | dummy | +(12 rows) ``` This will return a list of all the model providers that are currently available in the system. You can find out more about these providers and their capabilities in the [Supported Models](./supported-models) section. @@ -73,7 +80,7 @@ This will create a model named `my_model` that uses the `bert_local` model provi ## Creating a Model with Configuration and Credentials -This is where the other [supported models](./supported-models) come in. You can create a different model by specifying the model name in the configuration. The `OpenAI Completions` and `OpenAI Embeddings` models are both models which you can create to make use of OpenAI's completions and embeddings APIs. +This is where the other [supported models](./supported-models) come in. You can create a different model by specifying the model name in the configuration. The `openai-completions` and `openai-embeddings` models are both models which you can create to make use of OpenAI's completions and embeddings APIs. Similarly the `nim-completions` and `nim-embeddings` models are models which you can create to make use of NVIDIA's completions and embeddings APIs. You need to provide more information to the `aidb.create_model` function when creating a model like this. Completions has a number of options, including selecting which model it will use on OpenAI. Both Completions and Embeddings require API credentials. Here is an example of how to create the OpenAI Completions model: @@ -119,7 +126,6 @@ You can delete the new model with `SELECT aidb.delete_model('my_new_openai_model ## Using models with OpenAI compatible APIs -These OpenAI models work with any OpenAI compatible API. This allows you to connect and use an even wider range of models, just by passing the appropriate API endpoint to the `url` option in the `aidb.create_model` function's options. - -For more information about the OpenAI models, see the [OpenAI Completions](./supported-models/openai-completions) and [OpenAI Embeddings](./supported-models/openai-embeddings) pages. +The `completions` and `embeddings` models work with any OpenAI compatible API. This allows you to connect and use an even wider range of models, just by passing the appropriate API endpoint to the `url` option in the `aidb.create_model` function's options. +For more information about the models, see the [Completions](./supported-models/completions) and [Embeddings](./supported-models/embeddings) pages. diff --git a/advocacy_docs/edb-postgres-ai/ai-accelerator/reference/index.mdx b/advocacy_docs/edb-postgres-ai/ai-accelerator/reference/index.mdx index 36b66ab7bd4..0a13ddfcbdf 100644 --- a/advocacy_docs/edb-postgres-ai/ai-accelerator/reference/index.mdx +++ b/advocacy_docs/edb-postgres-ai/ai-accelerator/reference/index.mdx @@ -20,6 +20,12 @@ navigation: * [aidb.list_models](models#aidblist_models) * [aidb.get_model](models#aidbget_model) * [aidb.delete_model](models#aidbdelete_model) +* [aidb.encode_text](models#aidbencode_text) +* [aidb.encode_text_batch](models#aidbencode_text_batch) +* [aidb.decode_text](models#aidbdecode_text) +* [aidb.decode_text_batch](models#aidbdecode_text_batch) +* [aidb.encode_image](models#aidbencode_image) +* [aidb.rerank_text](models#aidbrerank_text) ## Retrievers diff --git a/advocacy_docs/edb-postgres-ai/ai-accelerator/reference/models.mdx b/advocacy_docs/edb-postgres-ai/ai-accelerator/reference/models.mdx index 803e34ff0a4..b605bb7030d 100644 --- a/advocacy_docs/edb-postgres-ai/ai-accelerator/reference/models.mdx +++ b/advocacy_docs/edb-postgres-ai/ai-accelerator/reference/models.mdx @@ -224,3 +224,20 @@ Encodes an image using a model, generating a vector representation of a given im |--------------|------|-------------------| | `encode_image` | bytea | The encoded image. | +### `aidb.rerank_text` + +Reranks text using a model, generating a vector representation of a given text input. + +#### Parameters + +| Parameter | Type | Default | Description | +|--------------|------------------|---------|-----------------------------------| +| `model_name` | text | | Name of the model to rerank with. | `text` | text | | Text to rerank. | +| `inputs` | strings\[\] | \[\] | Inputs for the model provider. | + +#### Returns + +| Column | Type | Description | +|---------------|----------------------|----------------------------| +| `rerank_text` | double precision\[\] | Array of reranking logits. | + diff --git a/advocacy_docs/edb-postgres-ai/ai-accelerator/rel_notes/src/rel_notes_2.1.1.yml b/advocacy_docs/edb-postgres-ai/ai-accelerator/rel_notes/src/rel_notes_2.1.1.yml new file mode 100644 index 00000000000..524637c3543 --- /dev/null +++ b/advocacy_docs/edb-postgres-ai/ai-accelerator/rel_notes/src/rel_notes_2.1.1.yml @@ -0,0 +1,17 @@ +product: AI Accelerator - Pipelines +version: 2.1.1 +date: 3 February 2025 +intro: | + +highlights: | + - Support for Nvidia NIM. + - `embeddings` and `completions` are new model names. + - Reranking using NIM available. +relnotes: +- relnote: Renaming of openai_embedding and openai_completion + details: | + The model names `openai_embedding` and `openai_completion` have been renamed to `embeddings` and `completions` respectively. The old names are still supported for backward compatibility. + jira: "" + addresses: "" + type: Enhancement + impact: High From a2af13df66edaa82eaf56a1618523720921469ee Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Fri, 31 Jan 2025 13:07:23 +0000 Subject: [PATCH 03/12] update generated release notes --- .../ai-accelerator_2.1.1_rel_notes.mdx | 22 +++++++++++++++++++ .../ai-accelerator/rel_notes/index.mdx | 2 ++ 2 files changed, 24 insertions(+) create mode 100644 advocacy_docs/edb-postgres-ai/ai-accelerator/rel_notes/ai-accelerator_2.1.1_rel_notes.mdx diff --git a/advocacy_docs/edb-postgres-ai/ai-accelerator/rel_notes/ai-accelerator_2.1.1_rel_notes.mdx b/advocacy_docs/edb-postgres-ai/ai-accelerator/rel_notes/ai-accelerator_2.1.1_rel_notes.mdx new file mode 100644 index 00000000000..c303c05819f --- /dev/null +++ b/advocacy_docs/edb-postgres-ai/ai-accelerator/rel_notes/ai-accelerator_2.1.1_rel_notes.mdx @@ -0,0 +1,22 @@ +--- +title: AI Accelerator - Pipelines 2.1.1 release notes +navTitle: Version 2.1.1 +--- + +Released: 3 February 2025 + + +## Highlights + +- Support for Nvidia NIM. +- `embeddings` and `completions` are new model names. +- Reranking using NIM available. + +## Enhancements + + + +
DescriptionAddresses
Renaming of openai_embedding and openai_completion

The model names openai_embedding and openai_completion have been renamed to embeddings and completions respectively. The old names are still supported for backward compatibility.

+
+ + diff --git a/advocacy_docs/edb-postgres-ai/ai-accelerator/rel_notes/index.mdx b/advocacy_docs/edb-postgres-ai/ai-accelerator/rel_notes/index.mdx index e3daad74bea..a906a73002b 100644 --- a/advocacy_docs/edb-postgres-ai/ai-accelerator/rel_notes/index.mdx +++ b/advocacy_docs/edb-postgres-ai/ai-accelerator/rel_notes/index.mdx @@ -4,6 +4,7 @@ navTitle: Release notes description: Release notes for EDB Postgres AI - AI Accelerator indexCards: none navigation: + - ai-accelerator_2.1.1_rel_notes - ai-accelerator_2.0.0_rel_notes - ai-accelerator_1.0.7_rel_notes --- @@ -14,5 +15,6 @@ The EDB Postgres AI - AI Accelerator describes the latest version of AI Accelera | AI Accelerator version | Release Date | |---|---| +| [2.1.1](./ai-accelerator_2.1.1_rel_notes) | 03 Feb 2025 | | [2.0.0](./ai-accelerator_2.0.0_rel_notes) | 13 Jan 2025 | | [1.0.7](./ai-accelerator_1.0.7_rel_notes) | 10 Dec 2024 | From 236f43fd643422ccd8ab0dff8d985cce66174b79 Mon Sep 17 00:00:00 2001 From: Tim Waizenegger Date: Mon, 3 Feb 2025 11:34:11 +0100 Subject: [PATCH 04/12] Update rel_notes_2.1.1.yml --- .../rel_notes/src/rel_notes_2.1.1.yml | 25 +++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/advocacy_docs/edb-postgres-ai/ai-accelerator/rel_notes/src/rel_notes_2.1.1.yml b/advocacy_docs/edb-postgres-ai/ai-accelerator/rel_notes/src/rel_notes_2.1.1.yml index 524637c3543..089142297c9 100644 --- a/advocacy_docs/edb-postgres-ai/ai-accelerator/rel_notes/src/rel_notes_2.1.1.yml +++ b/advocacy_docs/edb-postgres-ai/ai-accelerator/rel_notes/src/rel_notes_2.1.1.yml @@ -7,6 +7,7 @@ highlights: | - Support for Nvidia NIM. - `embeddings` and `completions` are new model names. - Reranking using NIM available. + - Schema support for source tables in retriever pipelines. relnotes: - relnote: Renaming of openai_embedding and openai_completion details: | @@ -15,3 +16,27 @@ relnotes: addresses: "" type: Enhancement impact: High +- relnote: Improve model provider credential management + details: | + Improve model provider credential management in the create_model() call. New credentials no longer get silently ignored if credentials already exist. + jira: "AID-275" + addresses: "" + type: Enhancement + impact: High +- relnote: Adds handler for the FDW (foreign data wrappers) used for the model registry + details: | + The handler has no functionality but it satisfied the FDW handler interface. This avoids certain issues with PG system calls that happen when FDWs don't have any handlers. + jira: "AID-166" + addresses: "" + type: Enhancement + impact: High +- relnote: Adds schema support / fully qualified identifiers to the retriever pipeline. + details: | + For retrievers with table sources, the source table and vector table can now be in any schema in the PG database. The schema can either be passed during retriever creation (fully qualified identifier) or can be omitted. If the schema is omitted, we resolve and store the applicable schema. + jira: "AID-217" + addresses: "" + type: Enhancement + impact: High + + + From 8240944ab7f7dee7f1106e5607e4a6a23f5fae7e Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Mon, 3 Feb 2025 10:34:36 +0000 Subject: [PATCH 05/12] update generated release notes --- .../rel_notes/ai-accelerator_2.1.1_rel_notes.mdx | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/advocacy_docs/edb-postgres-ai/ai-accelerator/rel_notes/ai-accelerator_2.1.1_rel_notes.mdx b/advocacy_docs/edb-postgres-ai/ai-accelerator/rel_notes/ai-accelerator_2.1.1_rel_notes.mdx index c303c05819f..d49565b7cc6 100644 --- a/advocacy_docs/edb-postgres-ai/ai-accelerator/rel_notes/ai-accelerator_2.1.1_rel_notes.mdx +++ b/advocacy_docs/edb-postgres-ai/ai-accelerator/rel_notes/ai-accelerator_2.1.1_rel_notes.mdx @@ -11,12 +11,19 @@ Released: 3 February 2025 - Support for Nvidia NIM. - `embeddings` and `completions` are new model names. - Reranking using NIM available. +- Schema support for source tables in retriever pipelines. ## Enhancements + + +
DescriptionAddresses
Renaming of openai_embedding and openai_completion

The model names openai_embedding and openai_completion have been renamed to embeddings and completions respectively. The old names are still supported for backward compatibility.

Improve model provider credential management

Improve model provider credential management in the create_model() call. New credentials no longer get silently ignored if credentials already exist.

+
Adds handler for the FDW (foreign data wrappers) used for the model registry

The handler has no functionality but it satisfied the FDW handler interface. This avoids certain issues with PG system calls that happen when FDWs don't have any handlers.

+
Adds schema support / fully qualified identifiers to the retriever pipeline.

For retrievers with table sources, the source table and vector table can now be in any schema in the PG database. The schema can either be passed during retriever creation (fully qualified identifier) or can be omitted. If the schema is omitted, we resolve and store the applicable schema.

+
From d4b19796c1f01f4afb47b27849e34de4b13432b1 Mon Sep 17 00:00:00 2001 From: Dj Walker-Morgan Date: Mon, 3 Feb 2025 11:11:04 +0000 Subject: [PATCH 06/12] Fix compatible example, fix completions text Signed-off-by: Dj Walker-Morgan --- .../ai-accelerator/models/openai-api-compatibility.mdx | 10 +++++----- .../models/supported-models/completions.mdx | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/advocacy_docs/edb-postgres-ai/ai-accelerator/models/openai-api-compatibility.mdx b/advocacy_docs/edb-postgres-ai/ai-accelerator/models/openai-api-compatibility.mdx index 0e0d5e24569..d1d30b8d234 100644 --- a/advocacy_docs/edb-postgres-ai/ai-accelerator/models/openai-api-compatibility.mdx +++ b/advocacy_docs/edb-postgres-ai/ai-accelerator/models/openai-api-compatibility.mdx @@ -1,6 +1,6 @@ --- title: "Using an OpenAI compatible API with Pipelines" -navTitle: "OpenAI Compatible Models" +navTitle: "OpenAI compatible Models" description: "Using an OpenAI compatible API with Pipelines by setting options and credentials." --- @@ -22,7 +22,7 @@ The starting point for this process is creating a model. When you create a model select aidb.create_model( 'my_local_ollama', 'embeddings', -'{"model":"llama3.3", "url":"http://llama.local:11434/v1/embeddings", "dimensions":8192}'::JSONB, +'{"model":"llama3.1", "url":"http://llama.local:11434/v1/embeddings", "dimensions":2000}'::JSONB, '{"api_key":""}'::JSONB); ``` @@ -37,7 +37,7 @@ We specify the model provider as “embeddings” which is the provider that def The next parameter is the configuration. This is a JSON string, which when expanded has three parameters, the model, the url and the dimensions. ```json -'{"model":"llama3.3", "url":"http://llama.local:11434/v1/embeddings", "dimensions":8192}'::JSONB +'{"model":"llama3.1", "url":"http://llama.local:11434/v1/embeddings", "dimensions":2000}'::JSONB ``` In this case, we are setting the model to [“llama3.3”](https://ollama.com/library/llama3.3), a relatively new and powerful model. Remember to run `ollama run llama3.3` to pull and start the model on the server. @@ -48,9 +48,9 @@ The next json setting is the important one, overriding the endpoint that the aid * It has port 11434 (the default port for Ollama) open to service requests over HTTP (not HTTPS in this case). * The path to the endpoint on the server `/v1/embeddings`; the same as OpenAI. -Putting those components together we get `[`http://llama.local:11434/v1/embeddings`](http://art.local:11434/v1/embeddings","api_key":"","dimensions":8192}'::JSONB)` as our end point. +Putting those components together we get `[`http://llama.local:11434/v1/embeddings`](http://art.local:11434/v1/embeddings","api_key":"","dimensions":2000}'::JSONB)` as our end point. -The last JSON parameter in this example is “dimensions” which is a hint to the system about how many vector values to expect from the model. If we [look up llama3.3’s properties](https://ollama.com/library/llama3.3/blobs/4824460d29f2) we can see the `llama.embedding_length` value is 8192\. The provider defaults to 1536 (with some hard-wired exceptions depending on model) but it doesn’t know about llama3.3, so we have to pass the dimension value of 8192 in the configuration. +The last JSON parameter in this example is “dimensions” which is a hint to the system about how many vector values to expect from the model. If we [look up llama3.3’s properties](https://ollama.com/library/llama3.3/blobs/4824460d29f2) we can see the `llama.embedding_length` value is 8192. The provider defaults to 1536 (with some hard-wired exceptions depending on model) but it doesn’t know about llama3.3's max. Another factor is [pgvector is limited to 2000 dimensions](https://github.com/pgvector/pgvector?tab=readme-ov-file#what-if-i-want-to-index-vectors-with-more-than-2000-dimensions). So we pass a dimension value of 2000 in the configuration, to get the maximum dimensions available with pgvector. That completes the configuration parameter. diff --git a/advocacy_docs/edb-postgres-ai/ai-accelerator/models/supported-models/completions.mdx b/advocacy_docs/edb-postgres-ai/ai-accelerator/models/supported-models/completions.mdx index b1fd3c5bbec..448a6923216 100644 --- a/advocacy_docs/edb-postgres-ai/ai-accelerator/models/supported-models/completions.mdx +++ b/advocacy_docs/edb-postgres-ai/ai-accelerator/models/supported-models/completions.mdx @@ -13,7 +13,7 @@ Model aliases: ## About Completions -Completions is a text completion model that enables use of any OpenAI API compatible text generation model. +Completions enables the use of any OpenAI API compatible text generation model. It is suitable for chat/text transforms, text completion, and other text generation tasks. From 0ab9326d8090b6d1baeaea08a1fb734254b97b91 Mon Sep 17 00:00:00 2001 From: Tim Waizenegger Date: Mon, 3 Feb 2025 13:25:59 +0100 Subject: [PATCH 07/12] Update rel_notes_2.1.1.yml --- .../rel_notes/src/rel_notes_2.1.1.yml | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/advocacy_docs/edb-postgres-ai/ai-accelerator/rel_notes/src/rel_notes_2.1.1.yml b/advocacy_docs/edb-postgres-ai/ai-accelerator/rel_notes/src/rel_notes_2.1.1.yml index 089142297c9..3e678e3400e 100644 --- a/advocacy_docs/edb-postgres-ai/ai-accelerator/rel_notes/src/rel_notes_2.1.1.yml +++ b/advocacy_docs/edb-postgres-ai/ai-accelerator/rel_notes/src/rel_notes_2.1.1.yml @@ -4,33 +4,33 @@ date: 3 February 2025 intro: | highlights: | - - Support for Nvidia NIM. + - Support for Nvidia NIM added. - `embeddings` and `completions` are new model names. - - Reranking using NIM available. - - Schema support for source tables in retriever pipelines. + - Reranking using NIM is now available. + - Source tables in retriever pipelines now support schemas. relnotes: -- relnote: Renaming of openai_embedding and openai_completion +- relnote: Renamed openai_embedding and openai_completion details: | The model names `openai_embedding` and `openai_completion` have been renamed to `embeddings` and `completions` respectively. The old names are still supported for backward compatibility. jira: "" addresses: "" type: Enhancement impact: High -- relnote: Improve model provider credential management +- relnote: Improved model provider credential management details: | Improve model provider credential management in the create_model() call. New credentials no longer get silently ignored if credentials already exist. jira: "AID-275" addresses: "" type: Enhancement impact: High -- relnote: Adds handler for the FDW (foreign data wrappers) used for the model registry +- relnote: Added handler for the FDW (foreign data wrappers) used for the model registry details: | - The handler has no functionality but it satisfied the FDW handler interface. This avoids certain issues with PG system calls that happen when FDWs don't have any handlers. + The handler has no functionality but it satisfies the FDW handler interface. This avoids certain issues with PG system calls that happen when FDWs don't have any handlers. jira: "AID-166" addresses: "" type: Enhancement impact: High -- relnote: Adds schema support / fully qualified identifiers to the retriever pipeline. +- relnote: Added schema support / fully qualified identifiers to the retriever pipeline. details: | For retrievers with table sources, the source table and vector table can now be in any schema in the PG database. The schema can either be passed during retriever creation (fully qualified identifier) or can be omitted. If the schema is omitted, we resolve and store the applicable schema. jira: "AID-217" From 78bc180e75c3b8c8d979219b53642f079eecd493 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Mon, 3 Feb 2025 12:26:27 +0000 Subject: [PATCH 08/12] update generated release notes --- .../rel_notes/ai-accelerator_2.1.1_rel_notes.mdx | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/advocacy_docs/edb-postgres-ai/ai-accelerator/rel_notes/ai-accelerator_2.1.1_rel_notes.mdx b/advocacy_docs/edb-postgres-ai/ai-accelerator/rel_notes/ai-accelerator_2.1.1_rel_notes.mdx index d49565b7cc6..c45297eb6e0 100644 --- a/advocacy_docs/edb-postgres-ai/ai-accelerator/rel_notes/ai-accelerator_2.1.1_rel_notes.mdx +++ b/advocacy_docs/edb-postgres-ai/ai-accelerator/rel_notes/ai-accelerator_2.1.1_rel_notes.mdx @@ -8,21 +8,21 @@ Released: 3 February 2025 ## Highlights -- Support for Nvidia NIM. +- Support for Nvidia NIM added. - `embeddings` and `completions` are new model names. -- Reranking using NIM available. -- Schema support for source tables in retriever pipelines. +- Reranking using NIM is now available. +- Source tables in retriever pipelines now support schemas. ## Enhancements - - - -
DescriptionAddresses
Renaming of openai_embedding and openai_completion

The model names openai_embedding and openai_completion have been renamed to embeddings and completions respectively. The old names are still supported for backward compatibility.

+
Renamed openai_embedding and openai_completion

The model names openai_embedding and openai_completion have been renamed to embeddings and completions respectively. The old names are still supported for backward compatibility.

Improve model provider credential management

Improve model provider credential management in the create_model() call. New credentials no longer get silently ignored if credentials already exist.

+
Improved model provider credential management

Improve model provider credential management in the create_model() call. New credentials no longer get silently ignored if credentials already exist.

Adds handler for the FDW (foreign data wrappers) used for the model registry

The handler has no functionality but it satisfied the FDW handler interface. This avoids certain issues with PG system calls that happen when FDWs don't have any handlers.

+
Added handler for the FDW (foreign data wrappers) used for the model registry

The handler has no functionality but it satisfies the FDW handler interface. This avoids certain issues with PG system calls that happen when FDWs don't have any handlers.

Adds schema support / fully qualified identifiers to the retriever pipeline.

For retrievers with table sources, the source table and vector table can now be in any schema in the PG database. The schema can either be passed during retriever creation (fully qualified identifier) or can be omitted. If the schema is omitted, we resolve and store the applicable schema.

+
Added schema support / fully qualified identifiers to the retriever pipeline.

For retrievers with table sources, the source table and vector table can now be in any schema in the PG database. The schema can either be passed during retriever creation (fully qualified identifier) or can be omitted. If the schema is omitted, we resolve and store the applicable schema.

From d2586ddbae130108765e48eccf2f6ad5716b971e Mon Sep 17 00:00:00 2001 From: Dj Walker-Morgan Date: Mon, 3 Feb 2025 12:26:39 +0000 Subject: [PATCH 09/12] Fix type in 2.0.0 release note Signed-off-by: Dj Walker-Morgan --- .../ai-accelerator/rel_notes/src/rel_notes_2.0.0.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/advocacy_docs/edb-postgres-ai/ai-accelerator/rel_notes/src/rel_notes_2.0.0.yml b/advocacy_docs/edb-postgres-ai/ai-accelerator/rel_notes/src/rel_notes_2.0.0.yml index 964bec128ba..5ed614f953d 100644 --- a/advocacy_docs/edb-postgres-ai/ai-accelerator/rel_notes/src/rel_notes_2.0.0.yml +++ b/advocacy_docs/edb-postgres-ai/ai-accelerator/rel_notes/src/rel_notes_2.0.0.yml @@ -9,7 +9,7 @@ relnotes: - relnote: Renaming of functions/arguments details: | Management functions move to use `create` rather than `register` and `delete` rather than `drop`. - Function argument names lose the preceding `p_`` to be consistent. + Function argument names lose the preceding `p_` to be consistent. jira: AID-213 addresses: "" type: Enhancement From 4f26b6e2e1a985afaa1e3b935c43e5dcec336114 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Mon, 3 Feb 2025 12:27:22 +0000 Subject: [PATCH 10/12] update generated release notes --- .../ai-accelerator/rel_notes/ai-accelerator_2.0.0_rel_notes.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/advocacy_docs/edb-postgres-ai/ai-accelerator/rel_notes/ai-accelerator_2.0.0_rel_notes.mdx b/advocacy_docs/edb-postgres-ai/ai-accelerator/rel_notes/ai-accelerator_2.0.0_rel_notes.mdx index 5e960ef91de..85d2b620bc4 100644 --- a/advocacy_docs/edb-postgres-ai/ai-accelerator/rel_notes/ai-accelerator_2.0.0_rel_notes.mdx +++ b/advocacy_docs/edb-postgres-ai/ai-accelerator/rel_notes/ai-accelerator_2.0.0_rel_notes.mdx @@ -15,7 +15,7 @@ Updating the GA release of EDB Postgres AI - AI Accelerator - Pipelines, in resp
DescriptionAddresses
Renaming of functions/arguments

Management functions move to use create rather than register and delete rather than drop. -Function argument names lose the preceding `p_`` to be consistent.

+Function argument names lose the preceding p_ to be consistent.

From 1cc9cfe5d5ef69d1d259fa634eff7dcdd06761f4 Mon Sep 17 00:00:00 2001 From: Dj Walker-Morgan Date: Mon, 3 Feb 2025 14:57:34 +0000 Subject: [PATCH 11/12] Added intro Signed-off-by: Dj Walker-Morgan --- .../ai-accelerator/rel_notes/src/rel_notes_2.1.1.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/advocacy_docs/edb-postgres-ai/ai-accelerator/rel_notes/src/rel_notes_2.1.1.yml b/advocacy_docs/edb-postgres-ai/ai-accelerator/rel_notes/src/rel_notes_2.1.1.yml index 3e678e3400e..fed567fd319 100644 --- a/advocacy_docs/edb-postgres-ai/ai-accelerator/rel_notes/src/rel_notes_2.1.1.yml +++ b/advocacy_docs/edb-postgres-ai/ai-accelerator/rel_notes/src/rel_notes_2.1.1.yml @@ -2,7 +2,7 @@ product: AI Accelerator - Pipelines version: 2.1.1 date: 3 February 2025 intro: | - + In this release, we add support for Nvida NIM, introduce new model names, and improve the retriever pipeline. highlights: | - Support for Nvidia NIM added. - `embeddings` and `completions` are new model names. From 4b9a5b9fcb07a4776fe78b5469ec7df1fd83dc31 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Mon, 3 Feb 2025 14:58:12 +0000 Subject: [PATCH 12/12] update generated release notes --- .../ai-accelerator/rel_notes/ai-accelerator_2.1.1_rel_notes.mdx | 1 + 1 file changed, 1 insertion(+) diff --git a/advocacy_docs/edb-postgres-ai/ai-accelerator/rel_notes/ai-accelerator_2.1.1_rel_notes.mdx b/advocacy_docs/edb-postgres-ai/ai-accelerator/rel_notes/ai-accelerator_2.1.1_rel_notes.mdx index c45297eb6e0..76d5e023f4e 100644 --- a/advocacy_docs/edb-postgres-ai/ai-accelerator/rel_notes/ai-accelerator_2.1.1_rel_notes.mdx +++ b/advocacy_docs/edb-postgres-ai/ai-accelerator/rel_notes/ai-accelerator_2.1.1_rel_notes.mdx @@ -5,6 +5,7 @@ navTitle: Version 2.1.1 Released: 3 February 2025 +In this release, we add support for Nvida NIM, introduce new model names, and improve the retriever pipeline. ## Highlights