This guide describes how to use code to structure an engine and build artifacts. Use Docker to test the engine locally, deploy it into the aiWARE OS, and test the deployed engine live in aiWARE.
We recommend writing or using a custom engine when:
-
You have a custom model (either written from scratch or pre-trained on your data)
-
You want to work with a new version of a foundation model
-
You want to execute custom code as a task in an aiWARE job (In most cases, Automate is the best option, but if you have an existing code/container, or a complex workflow, using it as an engine may be best)
Before you begin
- Get familiar with the engine build flow in Writing engines.
- Decide which cognitive capability the engine will support and the expected output of the engine, which is usually a preexisting capability.
- Determine which MIME type(s) the engine needs to support in terms of data input.
- Understand whether the engine will be stateless (segment; "chunk"), or stateful ("stream") when processing chunks of data. If the engine can process data chunks in any order, without knowing a chunk's sequence number, it's likely stateless.
- Determine whether the engine will be network-isolated or requires external access.
- Install Docker on a (Mac, Linux, or virtualized Linux) development machine.
Next steps
Build a simple text-processing engine that extracts vocabulary words from a file.
- Set up the project
- Create the engine as a resource in Resource Center and Create an engine build with a customized Dockerfile
- Test the build locally
- Test the engine in aiWARE