Configure an ML Engine
MindsDB integrates with numerous AI and ML frameworks that are made available via the AI/ML engines. The AI/ML engines are used to create models based on the particular AI/ML framework.
Description
The CREATE ML_ENGINE
command creates an ML engine that uses one of the available AI/ML handlers.
Syntax
Before creating an AI/ML engine, make sure that the AI/ML handler of your interest is available by querying for the ML handlers.
If you can’t find the AI/ML handler of your interest, you can contribute by building a new AI/ML handler.
Please note that in the process of contributing new AI.ML engines, ML engines and/or their tests will only run correctly if all dependencies listed in the requirements.txt
file are installed beforehand.
If you find the AI/ML handler of your interest, then you can create an AI/ML engine using this command:
Please replace ml_engine_name
, handler_name
, and optionally, argument_key
and argument_value
with the real values.
Please do not use the same ml_engine_name
as the handler_name
to avoid issue while dropping the ML engine.
To verify that your AI/ML engine was successfully created, run the command below:
If you want to drop an ML engine, run the command below:
Example
Let’s check what AI/ML handlers are currently available:
On execution, we get:
Here we create an AI/ML engine using the OpenAI handler and providing an OpenAI API key in the USING
clause.
On execution, we get:
Now let’s verify that our ML engine exists.
On execution, we get:
Please note that the USING
clause is optional, as it depends on the AI/ML handler whether it requires some arguments or not. Here, we created an OpenAI engine and provided own API key.
After creating your ML engine, you can create a model like this:
The USING
clause specifies the ML engine to be used for creating a new model.