AI config file

AI parameters are set in a JSON config file

Within OSAIS, each AI has its own configuration file. The syntax is shared all accross OSAIS to simplify AI onboarding and also for allowing AI chains.

1/ General section

The top section of the JSON config is about the AI itself, with general information such as its name, description, version (of the JSON file), where the AI is running (local port), where it was found, and the expected cost for running it on a generic hardware (we need to initiate the cost with a value anyway).

For example, see the top section of the JSON configuration file for PING AI.


    "engine": "ping",
    "version": "2.0.3",
    "docker_image": "yeepeekoo/public:ai_ping",
    "name": "Ping",
    "location": "",
    "ip": "0.0.0.0",
    "port": 5001,
    "description": "For Test and Integration purposes",
    "github": "https://github.com/incubiq/osais_ai_ping",
    "requiresGPU": false,
    "isFree": true,
    "expected_warmup_in_sec": 10,
    "expected_tx_in_ms": 20,

2/ Params section

Then, a section defines ALL parameters for this AI. It is an unordered list of parameters. Some are specific to the AI, and some are specific to OSAIS.

The format for describing a parameter is generally made of the following general parameters:


    "in": <param>,          // an input parameter that OSAIS understands
    "out": <param>,         // an input parameter that the specific AI understands. This generally is a translation of the <in> parameter into the format of the AI. 
    "isMandatory": <param>, // is this param optional or mandatory?
    "type": <type>,         // the expected type (string, int, float, boolean)
    

Then, more specific parameters regarding the possible values, the UI, and the restriction of usage to apply when the AI runs in "demo" mode.

    
    "value": {
        "default": null            // the parameter is first set with this default value 
    },
    "ui": {
        "title": <a title>,        // a title that will appear in the UI 
        "placeholder": <text>,     // a place holder text (since we have an edit entry here)
        "widget": "uiEdit",        // how the UI will be displayed (here with an edit entry)
        "column": 1                // when the control will appear in a multi-col UI (here col 1)
    }    

There are various widgets for displaying all sorts of parameters. Here is the list of UI available by y OSAIS:

  • uiEdit: an edit field entry, which can take parameters such as strings or int.

  • uiSelectPicture: an image selection widget which can be set to filter image extensions and file size (in width, height, and/or kb)

  • uiRangeSlider: a slider which generally works for selecting int or float values in a range. The slider can display real values or percentage of target values.

  • uiMultiToggle: a set of buttons, each displaying a text representing a particular value, which is defined in the set.

  • uiSwitch: used to represent a boolean (toggle yes/no)

Last updated