Thank you for contributing to our project!
To get an overview of the project, read the README.
If you find a problem with the code, search if an issue already exists.
If you open a pull request to fix the problem, an issue will ba automatically created.
If a related issue doesn't exist, you can open a new issue using a relevant issue form.
To contribute code to the project:
- Fork the project and work on your forked repository
- Before submitting a new pull request, make sure you have pre-commit package and installed
pre-commit install
- When submitting a pull request, make sure to fill all the required, relevant fields for your PR.
Make sure the title is descriptive and short.
- Add typing to new code; typing is enforced using mypy
- Rules are defined in our pyproject.toml file
If you use Visual Studio Code as your IDE, we recommend using the Mypy Type Checker extension.
After installing it, make sure to update the Mypy-type-checkers: Args
setting
to "mypy-type-checker.args" = ["--config-file=pyproject.toml"]
.
Checks tools are used to check the code are defined in .pre-commit-config.yaml file To install pre-commit:
pip install pre-commit --user
pre-commit install
pre-commit install --hook-type commit-msg
Run pre-commit:
pre-commit run --all-files
To add a new runtime, you need to:
- Add a new file under manifests directory.
- Add
<runtime>_INFERENCE_CONFIG
dict with:
"support_multi_default_queries": True|False, # Optioanl, if set to True, `default_query_model` should contains a dict with corresponding inference_type
"default_query_model": {
"query_input": <default query to be sent to the model>,
"query_output": <expected output>,
"use_regex": True|False, # Optional, if set to True, `query_output` should be a regex
},
"<query type, for example: all-tokens>": {
"<protocol, for example HTTP>": {
"endpoint": "<model endpoint>",
"header": "<model required headers>",
"body": '{<model expected body}',
"response_fields_map": {
"response_output": <output field in response>,
"response": <response field in response - optional>,
},
},
- Add a new entry to ModelInferenceRuntime
- Add the new entry to Mapping
- See caikit_standalone for an example