Pipelines models reference#
EDB Postgres AI-AIアクセラレーターパイプラインモデルのこのリファレンスドキュメントには、 Pipelines models reference で作業するためのaidb拡張機能で使用可能なファンクションとビューに関する情報が含まれています。
テーブル#
helpb.model_providers#
aidb.model_providers
テーブルには、使用可能なモデルプロバイダーに関する情報が保存されます。
Column |
Type |
Description |
|---|---|---|
server_name |
name |
モデルサーバーの名前 |
server_description |
text |
モデルサーバーの説明 |
server_options |
text[] |
モデルサーバーのオプション |
helpb.models#
レジストリ内のすべてのモデルとその構成済みオプションのリストを返します。事前定義されたモデルやユーザー作成モデルを含みます。
Column |
Type |
Description |
|---|---|---|
name |
text |
モデルのユーザー定義の名前 |
provider |
text |
モデルプロバイダーの名前 |
options |
jsonb |
モデルプロバイダーのオプションの構成 |
例#
SELECT * FROM aidb.models;
__OUTPUT__
name | provider | options
- ------+------------+---------------
bert | bert_local | {"config={}"}
clip | clip_local | {"config={}"}
t5 | t5_local | {"config={}"}
ファンクション#
promoteb.create_model#
名前、プロバイダー、およびオプションの構成を保存することにより、システムに新しいモデルを作成します。
パラメーター#
Parameter |
Type |
Default |
Description |
|---|---|---|---|
name |
text |
モデルのユーザー定義の名前。 |
|
provider |
text |
モデルプロバイダーの名前 helpb.model_providers にあります。 |
|
config |
jsonb |
'{}'::jsonb |
モデルプロバイダーのオプションの構成。 model、url、TLSオプション`tls_config`などのモデル固有のパラメーターが含まれる場合があります。 |
credentials |
jsonb |
'{}'::jsonb |
モデルプロバイダーのオプションの資格情報。 |
replace_credentials |
boolean |
false |
trueの場合、モデルプロバイダーの資格情報を置き換えます。 falseの場合、資格情報は上書きされません。 |
例#
SELECT aidb.create_model(
name => my_t5::text,
provider => t5_local::character varying,
config => {"param1": "value1", "param2": "value2"}::jsonb,
credentials => {"token": "abcd"}::jsonb
);
または同等のデフォルト値を使用して
SELECT aidb.create_model(my_t5, t5_local);
または、既に作成されたモデルのプロバイダーの資格情報を更新する場合。
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
);
TLS構成オプショナル#
HTTPSベースのモデルエンドポイントに安全に接続するために、config
オブジェクトにtls_config フィールドを含めることができます。
"tls_config": {
"insecure_skip_verify": true, // (optional) disables certificate validation
"ca_path": "/etc/aidb/myCA.pem" // (optional) path to a trusted CA certificate
}
promoteb.get_model#
レジストリ内のモデルの構成を結果ます。
パラメーター#
Parameter |
Type |
Default |
Description |
|---|---|---|---|
model_name |
text |
モデルの名前 |
返品#
Column |
Type |
Description |
|---|---|---|
name |
text |
モデルのユーザー定義の名前 |
provider |
text |
モデルプロバイダーの名前 |
options |
jsonb |
モデルプロバイダーのオプションの構成 |
例#
SELECT * FROM aidb.get_model(t5);
__OUTPUT__
name | provider | options
- -----+----------+---------------
t5 | t5_local | {"config={}"}
(1 row)
promoteb.delete_model#
レジストリからモデルを削除します。
パラメーター#
Parameter |
Type |
Default |
Description |
|---|---|---|---|
model_name |
text |
モデルの名前 |
例#
SELECT aidb.delete_model(t5);
__OUTPUT__
delete_model
- --------------------------------
(t5,t5_local,"{""config={}""}")
(1 row)
返品#
Column |
Type |
Description |
|---|---|---|
delete_model |
jsonb |
削除されたモデルの名前、プロバイダー、およびオプション |
promoteb.list_hcp_models#
ハイブリッドマネージャーで実行されているモデルを取得します。
返品#
Column |
Type |
Description |
|---|---|---|
name |
text |
HCPで実行されているモデルインスタンスの名前 |
url |
text |
HCPで実行されているモデルのAPI URL |
model |
text |
HCPで実行されているモデルの名前 |
例#
SELECT * FROM aidb.get_hcp_models();
name | url | model
- --------------------------------------+----------------------------------------------------------------------------------+------------------------------------
llama-3-1-8b-instruct-1xgpu-g6 | http://llama-3-1-8b-instruct-1xgpu-g6-predictor.default.svc.cluster.local | meta/llama-3.1-8b-instruct
llama-3-2-nv-embedqa-1b-v2 | http://llama-3-2-nv-embedqa-1b-v2-predictor.default.svc.cluster.local | nvidia/llama-3.2-nv-embedqa-1b-v2
meta-nim-llama3-70b-instruct-8xgpu-g5 | http://meta-nim-llama3-70b-instruct-8xgpu-g5-predictor.default.svc.cluster.local | meta/llama3-70b-instruct
(3 rows)
promoteb.create_hcp_model#
HCPで実行中のインスタンスを参照することにより、システムに新しいモデルを作成します
パラメーター#
Parameter |
Type |
Default |
Description |
|---|---|---|---|
name |
text |
モデルのユーザー定義名 |
|
hcp_model_name |
text |
HCPで実行されているモデルインスタンスの名前 |
promoteb.sync_hcp_models#
HCPでモデルを作成し、is_hcp_model=true を設定します。
HCPで見つからない場合、その設定を持つモデルを削除します。
返品#
Column |
Type |
Description |
|---|---|---|
status |
text |
同期ステータス。 deleted、unchanged、created、または`skipped`のいずれか。 |
model |
text |
同期HCPモデルの名前。 |
helpb.encode_text#
モデルを使用してテキストをエンコードし、指定されたテキスト入力のベクトル表現を生成します。
パラメーター#
Parameter |
Type |
Default |
Description |
|---|---|---|---|
model_name |
text |
エンコードするモデルの名前 |
|
text |
text |
エンコードするテキスト |
helpb.encode_text_batch#
モデルを使用してテキストのバッチをエンコードし、指定されたテキスト入力のベクトル表現を生成します。
パラメーター#
Parameter |
Type |
Default |
Description |
|---|---|---|---|
model_name |
text |
エンコードするモデルの名前 |
|
text |
text[] |
エンコードするテキストの配列 |
promoteb.decode_text#
モデルを使用してテキストをデコードし、指定されたテキスト入力のベクトル表現を生成します。
パラメーター#
Parameter |
Type |
Default |
Description |
|---|---|---|---|
model_name |
text |
デコードするモデルの名前 |
|
text |
text |
デコードするテキスト |
返品#
Column |
Type |
Description |
|---|---|---|
decode_text |
text |
デコードされたテキスト |
promoteb.decode_text_batch#
モデルを使用してテキストのバッチをデコードし、指定されたテキスト入力の表現を生成します。
パラメーター#
Parameter |
Type |
Default |
Description |
|---|---|---|---|
model_name |
text |
デコードするモデルの名前 |
|
text |
text[] |
デコードするテキストの配列 |
返品#
Column |
Type |
Description |
|---|---|---|
decode_text |
text |
デコードされたテキスト |
promoteb.encode_image#
モデルを使用して画像をエンコードし、指定された画像入力のベクトル表現を生成します。
パラメーター#
Parameter |
Type |
Default |
Description |
|---|---|---|---|
model_name |
text |
エンコードするモデルの名前 |
|
image |
bytea |
エンコードする画像 |
返品#
Column |
Type |
Description |
|---|---|---|
encode_image |
bytea |
エンコードされた画像 |
helpb.rerank_text#
モデルを使用してテキストを再ランク付けし、指定されたテキスト入力のベクトル表現を生成します。
パラメーター#
Parameter |
Type |
Default |
Description |
|---|---|---|---|
model_name |
text |
リランキングするモデルの名前 |
|
query |
text |
入力がランク付けされるクエリ |
|
input |
text[] |
[] |
ランク付けの入力 |
返品#
Column |
Type |
Description |
|---|---|---|
text |
text |
"input"からのテキスト |
logit_score |
double precision |
このテキストのスコア/ランク |
id |
int |
テキストが入力配列に持っていたインデックス |