Create a secret
klio secret create HF_TOKEN hf_your_token
klio secret listNAME VALUE stores one value. KEY=VALUE pairs make a group, as Modal does, and --from-dotenv .env reads them from a file; --force replaces a group that exists. klio secret delete removes one.
Use it in a function
import os
from klio_compute import function
@function(secrets=["HF_TOKEN"])
def download():
token = os.environ["HF_TOKEN"]
...Each secret named in secrets= is set as an environment variable in the container. With the Modal-compatible API, modal.Secret.from_name("group") gives a function every key of a group.