Contributing a python algorithm package to Algorithm Nexus¶
This guide walks you through the process of contributing a algorithm python package, containing, for example, AI models, to Algorithm Nexus.
There are four steps to contribute your algorithm package
- Setup a local copy of the Algorithm Nexus repository
- Add your algorithm package to the Algorithm Nexus dependencies
- Create a Nexus package for your algorithm
- Commit your changes, push them, and then open a PR with Algorithm Nexus
Prerequisites¶
Before you begin, ensure
- Your algorithm package is publicly available GitHub at
<Python-Package-URL>. uvis installed on your system.- You have a fork of the Algorithm Nexus repository checked out locally
Step 1: Setup the Algorithm Nexus repository¶
Run the commands below from the folder where you have checked out your Algorithm Nexus fork.
Then, create a new branch to host your changes.
Step 2: Add your algorithm package to the Algorithm Nexus dependencies¶
- Determine which variants your package should be added to, by reading
Identify The Algorithm Nexus variant for your Package. - Add it to each of these variants using
uv. - Export requirements
For example, if your package should be added to the ecosystem variant run,
uv add <Python-Package-URL> --optional ecosystem --no-sync
uv export --frozen --no-emit-project --no-default-groups \
--no-header --extra=ecosystem \
--output-file=requirements-ecosystem.txt
If the uv add step fails, and you are unable to troubleshoot the error, record
the error you get and continue on to step 3 and 4.
Then export the requirement file by running:
uv export --frozen --no-emit-project --no-default-groups \
--no-header --extra=ecosystem \
--output-file=requirements-ecosystem.txt
Step 3: Create a Nexus package for your algorithm¶
A Nexus package is a directory with some files that contains metadata about your
algorithm package. Under packages/ in the root of the Algorithm Nexus
repository you checked out, create a folder with your package name
Then, create the Nexus package configuration file in
packages/<package-name>/nexus.yaml with the following content:
Finally, validate the package structure with
In case of validation errors, the nexus validate tool will list all the errors. Fix them before moving to the next step.
Step 4: Commit Changes and Open a Pull Request¶
Add the files to be committed
Commit your changes and push to your remote fork
git commit -s -m "feat(package): Add <package-name> Nexus Package"
git push origin add-<package-name>-package
Finally, navigate to your fork on GitHub and open a Pull request for the newly
pushed branch to be merged with the Algorithm Nexus main branch. Use the
New Nexus Package pull request template and fill all the required fields. In
case of failures in Step 2, the PR template contains a dedicated section
(I Need Help) where you can log the errors recorded while adding your python
package to the Algorithm Nexus dependencies.
Optional Steps¶
After completing above you can flesh out your contribution with more information:
- Describe the models your algorithm package contains
- This is required to access testing and benchmarking of your model in future
- Add documentation on how to use your models for inference and fine-tuning
- Add agent skills for your package
Describe the Models in Your Algorithm Package¶
If your algorithm package contains one or more models, you can add their description to the Nexus package metadata by following the steps below.
For each model (<model-name>) that your package supports:
- Create a directory under
packages/<package-name>/models/<model-name>/ -
Create a
model.yamlfile with the model configuration:
Full details on the model configuration file are available in the Nexus Package Structure Guide.
Model Usage Documentation¶
Optionally, each model in a Nexus package can provide usage documentation in a
usage.md file in the model subfolder. This should be populated with usage
examples, description of useful parameters, and any other relevant information.
Agent Skills for Nexus Packages¶
Optionally, each Nexus package can provide agent skills for helping the user with using the package and its models. Example agent skills would aid the users with models deployment on different target infrastructure (e.g., bare metal, Kubernetes, etc.) and with building scripts for evaluating the models.
Identify The Algorithm Nexus Variant for your Package¶
If your Python package:
- does not declare
vllmas a default dependency - does not declare
vllmas an optional dependency
It belongs to the ecosystem variant only.
If your Python package:
- declares
vllmas a default (mandatory) dependency
It belongs to the candidate variant only.
If your Python package:
- declares
vllmas an optional dependency
It belongs both to the ecosystem and candidate variant only. In this case,
when adding to the candidate variant, users must ensure their package is added
with the optional vllm dependency (package-name[vllm-dependency]).
Getting Help¶
If you encounter issues:
- Check the Nexus Package Structure Guide
- Review the Dependency Resolution Design Document
- Search existing issues on GitHub
- Open a new issue with details about your problem