[Advanced] DIY Module
Contribute your own module to Lilypad
Last updated
Contribute your own module to Lilypad
Last updated
Contributing your own module is currently a non-trivial process. The Lilypad team is aiming to make this DX easier as well as to add tutorials, walkthroughs and approaches to making modules over the next month. In the meantime if you try this and do get stuck - please reach out to us in the Lilypad Discord for help!
Contributing your own module to use on Lilypad is possible and welcome! Essentially modules on Lilypad currently operate like Bacalhau Job Specifications do - take a look at this page on Creating your own Jobs to see more about how this works.
Modules should be either Docker or WASM Images that align to the Bacalhau job specifications (which then have some added metadata that defines the runtime options of the module).
Here is an example of the SDXL module in python:
It's a function that given a "string" will return a bacalhau docker job spec. That string can be whatever you want, JSON, csv, raw LLM prompt etc. In terms of output directories - you can see the SDXL example linked above names the "/outputs" folder and then will use that path in the command inside the Docker container. Any named folders like this that the Docker image can write files into - will be included as part of the results Lilypad gets back out of the job (and will change the result hash)
It's currently advisable to develop your module with bacalhau first (because it's FAR easier to get setup as a development environment than Lilypad is currently). If you can get a function like the one shown above that will, given a string, write a bacalhau job spec that you can test with the bacalhau CLI - then you have already done 98% of the Lilypad module
To add this to Lilypad, submit a PR which also includes this file here.
See more in this guide on contributing to the Lilypad project: CONTRIBUTING.md
From Lilypad incentivised testnet [Q4 2023] onwards (and perhaps even earlier), its probable modules contributed by community members will be eligible for a % fee of jobs that run these modules in order to encourage the growth of the module ecosystem on the Lilypad Network.