@alwaysai/model-configuration-schemas
v0.11.2
Published
alwaysAI schemas for model configurations
Downloads
637
Maintainers
Keywords
Readme
Overview
The interfaces for each model configuration can be found in src/model_params/
. The schemas are located in src/schemas/
and are written in json-schema format using draft 2019-09. The schemas are imported into model.ts
where the overall JSONSchemaType as well as the validation methods & sub-types are created. Validation methods are used to type-guard each of the model configurations, while the interfaces are used to type-guard at development time. This repository is configured as an npm
package -- while under local development you can use npm install --save
along with the path to this repo to use it with the device agent. Additionally, the schemas are also used in model.py
to create validation function for use in python.
To Create New Schemas and Validation Methods
- Add a new model config's subschema to
src/schemas/modelParameters.json
or create a new.json
subschema file. - Add a new model config's interface to
src/model_params/modelParameters.ts
or create a new.ts
interface file. ** Note: If you create new files instead of appendingmodelParameters.*
, make sure to reference the new files in bothmodelParameters.*
** - Import and add the new subschemas to
jschon
inmodel.py
, and subschemas and interfaces toajv
inmodel.ts
. - Add new tests to
tests/model.test.ts
that reflect changes you've made. - Generate python package to be included in edgeIQ by running
npm run build:python
. Copy these files to<edgeiq_root>/edgeiq/model_config
and<edgeiq_root/tools/build-trt-model/model_config
. - After release, update the CLI with the latest model schema version.
More notes on the development of this repo can be found here: https://alwaysai.atlassian.net/l/c/RdjVyG1d
To Run Tests
Run npm run test:unit
to run the types.test.ts
file. You can add valid and invalid data structures to new instances of the test cases. They're divided in correct and incorrect structures and validated against the schemas.
Release Process
NOTE: Ensure unit tests are passing and new functionality is verified prior to release!
Release procedure
To release the package to npmjs.org follow the steps:
- publish new version: npm run publish:<major|minor|patch>
- watch the bitbucket pipeline running, if successful a new version will be created and published to npmjs.org
- to get the auto-generated commit and tags, simply pull: git pull
Pipeline is linting, unit testing and building package on:
- [x] Node.js: 16.x, 18.x, 20.x