Asynchronous Tasks
Celery tasks for the llmhost app.
launch_llmhost(): launch an LLMHost, and create the DNS record of its Ingress.destroy_llmhost(): destroy an LLMHost’s Kubernetes resources, and its DNS record.refresh_llmhost_status(): check the status of one, or every deployed, LLMHost. Celery Beat runs it every few minutes, so that status, events and cost stay current.reconcile_llmhost_compute(): give a compute’s node group the nodes that its LLMHosts need. It runs again every 30 seconds until the node group is settled, i.e. while a node starts or is removed, and checks the status of the compute’s LLMHosts each time.charge_llmhost_computes(): charge an hour of each compute’s running nodes, so that budgets attached to a compute, its owner, or their account see the cost of the infrastructure.reconcile_llmhost_computes(): reconcile every compute. Celery Beat runs it every few minutes, so that a node that is no longer needed is removed even if a reconcile failed.
The tasks are thin: LLMHostService does the work.
Every task except charge_llmhost_computes() manages Kubernetes resources, which can take
minutes, so they run in the infrastructure queue, and never block operational tasks. The charge
is operational: it runs in the queue of the other operational tasks, such as charges and budgets.