export WEB3_PRIVATE_KEY=<YOUR_PRIVATE_KEY>lilypad run github.com/noryev/module-llama2:6d4fd8c07b5f64907bd22624603c2dd54165c215 -i prompt="your prompt here"lilypad run github.com/noryev/module-llama2:6d4fd8c07b5f64907bd22624603c2dd54165c215 -i prompt="what is a giant sand trout on arrakis?"open /tmp/lilypad/data/downloaded-files/<fileID>export WEB3_PRIVATE_KEY=<YOUR_PRIVATE_KEY>lilypad run cowsay:v0.0.4 -i Message="hello, lilypad" ⠀⠀⠀⠀⠀⠀⣀⣤⣤⢠⣤⣀⠀⠀⠀⠀⠀
⠀⠀⠀⠀⢴⣿⣿⣿⣿⢸⣿⡟⠀⠀⠀⠀⠀ ██╗ ██╗██╗ ██╗ ██╗██████╗ █████╗ ██████╗
⠀⠀⣰⣿⣦⡙⢿⣿⣿⢸⡿⠀⠀⠀⠀⢀⠀ ██║ ██║██║ ╚██╗ ██╔╝██╔══██╗██╔══██╗██╔══██╗
⠀⢰⣿⣿⣿⣿⣦⡙⣿⢸⠁⢀⣠⣴⣾⣿⡆ ██║ ██║██║ ╚████╔╝ ██████╔╝███████║██║ ██║
⠀⣛⣛⣛⣛⣛⣛⣛⠈⠀⣚⣛⣛⣛⣛⣛⣛ ██║ ██║██║ ╚██╔╝ ██╔═══╝ ██╔══██║██║ ██║
⠀⢹⣿⣿⣿⣿⠟⣡⣿⢸⣮⡻⣿⣿⣿⣿⡏ ███████╗██║███████╗██║ ██║ ██║ ██║██████╔╝
⠀⠀⢻⣿⡟⣩⣾⣿⣿⢸⣿⣿⣌⠻⣿⡟⠀ ╚══════╝╚═╝╚══════╝╚═╝ ╚═╝ ╚═╝ ╚═╝╚═════╝ v2.13.0
⠀⠀⠀⠉⢾⣿⣿⣿⣿⢸⣿⣿⣿⡷⠈⠀⠀
⠀⠀⠀⠀⠀⠈⠙⠛⠛⠘⠛⠋⠁⠀ ⠀⠀⠀ Decentralized Compute Network https://lilypad.tech
🌟 Lilypad submitting job
2025-03-05T12:56:38-06:00 WRN ../runner/work/lilypad/lilypad/cmd/lilypad/utils.go:63 > failed to get GPU info: gpuFillInfo not implemented on darwin
2025-03-05T12:56:38-06:00 INF ../runner/work/lilypad/lilypad/pkg/web3/sdk.go:209 > Connected to arbitrum-sepolia-rpc.publicnode.com
2025-03-05T12:56:38-06:00 INF ../runner/work/lilypad/lilypad/pkg/jobcreator/run.go:27 > Public Address: 0xB86bCAe21AC95BCe7a49C057dC8d911033f8CB7c
Enumerating objects: 42, done.
Counting objects: 100% (22/22), done.
Compressing objects: 100% (4/4), done.
Total 42 (delta 18), reused 19 (delta 18), pack-reused 20 (from 1)
💌 Deal agreed. Running job...
🤔 Results submitted. Awaiting verification...
🤔 Results submitted. Awaiting verification...
✅ Results accepted. Downloading result...
🆔 Data ID: QmP2SQttNC3Hrh2xpY7bNHzV2jHq7MbfLahRC46DVzn5rG
🍂 Lilypad job completed, try 👇
open /tmp/lilypad/data/downloaded-files/QmQHrsiAuzTLn5VU6jg5LoXBRrAkEVRKiYeJE29w54gg9Q
cat /tmp/lilypad/data/downloaded-files/QmQHrsiAuzTLn5VU6jg5LoXBRrAkEVRKiYeJE29w54gg9Q/stdout
cat /tmp/lilypad/data/downloaded-files/QmQHrsiAuzTLn5VU6jg5LoXBRrAkEVRKiYeJE29w54gg9Q/stderropen /tmp/lilypad/data/downloaded-files/QmQHrsiAuzTLn5VU6jg5LoXBRrAkEVRKiYeJE29w54gg9Q~ % cat /tmp/lilypad/data/downloaded-files/QmQHrsiAuzTLn5VU6jg5LoXBRrAkEVRKiYeJE29w54gg9Q/stdout
________________
< hello, lilypad >
----------------
\ ^__^
\ (oo)\_______
(__)\ )\/\
||----w |
|| ||How to build your own compute job for Lilypad
/outputs directoryyour-module/
├── model-directory # Stores locally downloaded model files
├── download_model.[py/js/etc] # Script to download model files locally
├── requirements.txt # Module dependencies
├── Dockerfile # Container definition
├── run_script.[py/js/etc] # Main execution script
├── lilypad_module.json.tmpl # Lilypad configuration
└── README.md # Documentationfrom transformers import AutoTokenizer, AutoModelForSeq2SeqLM
def download_model():
model_name = "<namespace>/<model_identifier>"
# Ensure you have a directory named 'model' in your current working directory or specify a path
tokenizer = AutoTokenizer.from_pretrained(model_name)
model = AutoModelForSeq2SeqLM.from_pretrained(model_name)
# Save the tokenizer and model
tokenizer.save_pretrained('./model')
model.save_pretrained('./model')
if __name__ == "__main__":
download_model()import os
import json
from transformers import AutoModel, AutoTokenizer
def main():
# Load model and tokenizer from local directory
model_path = '/model' # Path to the local model directory
tokenizer = AutoTokenizer.from_pretrained(model_path)
model = AutoModel.from_pretrained(model_path)
# Get inputs from environment variables
input_var = os.environ.get('INPUT_VAR', 'default')
# Your model code here
result = your_model_function(input_var, model, tokenizer)
# Save outputs
output_path = '/outputs/result.json'
with open(output_path, 'w') as f:
json.dump({'result': result}, f)
if __name__ == "__main__":
main()
# Use specific base image
FROM base-image:version
# Set working directory
WORKDIR /workspace
# Install dependencies
RUN apt-get update && apt-get install -y \
your-dependencies && \
rm -rf /var/lib/apt/lists/*
# Install model requirements
RUN pip install your-requirements
# Environment variables for running offline and using the local model
# HF_HOME points to the directory where the model code is
ENV HF_HOME=/model
ENV TRANSFORMERS_OFFLINE=1
# Create necessary directories
RUN mkdir -p /outputs
# Copy execution script
COPY run_script.* /workspace/
# Set entrypoint
ENTRYPOINT ["command", "/workspace/run_script"]docker buildx build \
--platform linux/amd64 \
-t <USERNAME>/<MODULE_NAME>:<MODULE_TAG> \
--push \
.{
"machine": {
"gpu": 1, # Set to 0 if GPU not needed
"cpu": 1000, # CPU allocation
"ram": 8000 # Minimum RAM needed to run the module
},
"gpus": [ { "vram": 24576 }, { "vram": 40960 } ] # VRAM in MBs. Solver will default to largest one
"job": {
"APIVersion": "V1beta1",
"Spec": {
"Deal": {
"Concurrency": 1
},
"Docker": {
"Entrypoint": ["command", "/workspace/run_script"],
"WorkingDirectory": "/workspace",
"EnvironmentVariables": [
# Environment variables with defaults
{{ if .var_name }}"VAR_NAME={{ js .var_name }}"{{ else }}"VAR_NAME=default_value"{{ end }}
],
# Specify the Docker image to use for this module
"Image": "repo-owner/repo-name:tag"
},
"Engine": "Docker",
"Network": {
"Type": "None"
},
"Outputs": [
{
"Name": "outputs",
"Path": "/outputs"
}
],
"PublisherSpec": {
"Type": "ipfs"
},
"Resources": {
"GPU": "1" # Must match machine.gpu
},
"Timeout": 1800
}
}
}{{ if .variable }}"VARNAME={{ js .variable }}"{{ else }}"VARNAME=default"{{ end }}lilypad run repo:tag -i variable=valuelilypad run github.com/Lilypad-Tech/module-sdxl:6cf06f4038f1cff01a06c4eabc8135fd9835a78a --web3-private-key <your-private-key> -i prompt="a lilypad floating on a pond"lilypad run github.com/noryev/module-sdxl-ipfs:ae17e969cadab1c53d7cabab1927bb403f02fd2a -i prompt="your prompt here"export WEB3_PRIVATE_KEY=<YOUR_PRIVATE_KEY>lilypad run github.com/Lilypad-Tech/module-sdxl:d6a89ed92f4e798459b2990340669da00c56c80c -i prompt="your prompt here"lilypad run github.com/Lilypad-Tech/module-sdxl:d6a89ed92f4e798459b2990340669da00c56c80c -i prompt="a spaceship parked on a mountain"open /tmp/lilypad/data/downloaded-files/<fileID>