Name
pgx_aimodel_tool --Import model files into the database
Synopsis
pgx_aimodel_tool import { import-option | connection-option }Description
The import mode imports the model file into the database.
Options (import-option)
Receives input from the specified file. If this option is omitted, the standard input is used.
Specifies the name of the model to import. Cannot be omitted.
Specifies the capabilities of the model.
Specify embedding to represent a vector transformation. Cannot be omitted.
Specifies the metadata of the model to import in JSON format.
If a model with the same name is already imported, it will be overwritten.
If this option is not specified, the import fails.
If a model with the specified model name is already loaded, it will be requested to load again on overwrite, replacing the model on the inference server with the new model.
Options (connection-option)
Specifies the name of the database to connect to.
dbname can specify a connection string. In that case, the content specified as the connection string takes precedence over options specified on the command line.
Specifies the host name of the machine on which the database server is running.
If the value begins with a slash, it is used as the directory for the Unix domain socket. If this option is omitted, the value of the environment variable PGHOST is used. If the environment variable PGHOST is not set, it uses a Unix domain socket connection.
Specifies the TCP port or local Unix domain socket file extension on which the server is listening for connections. If this option is omitted, the value of the environment variable PGPORT is used. If the environment variable PGPORT is not set, it uses 27500.
Specifies the user name to connect as.
Never issue a password prompt. If the server requires password authentication and a password is not available by other means such as a .pgpass file, the connection attempt will fail. This option is useful when there is no user to enter the password for batch jobs or scripts.
Force this command to prompt for a password before connecting to a database.
This option is never essential, since the command will automatically prompt for a password if the server demands password authentication. However, it will waste a connection attempt finding out that the server wants a password. In some cases it is worth typing -W to avoid the extra connection attempt.
Diagnostics
0: Normal exit
Other than 0: Abnormal exit
Example
The following is an example of importing a model file on the client:
$ pgx_aimodel_tool import -f ./model.onnx -n sample-model-v1 -F embedding -m '{"version":"v1"}' -d rag_db -h localhost -p 27500 -U model_owner