LLMHost Tasks
The Celery tasks of LLMHosts: launch, destroy, delete, and status checks.
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.delete_llmhost(): destroy them, including the model volume, then delete the LLMHost.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.
They manage Kubernetes resources, which can take minutes, so they run in the infrastructure queue, and never
block operational tasks. The tasks are thin: LLMHostService does the
work. A failure is recorded on the LLMHost (record_task_failure()), since whoever queued the change has
already been answered.
- smarter.apps.llmhost.tasks.llmhost.record_task_failure(llmhost, action, error)[source]
Record that a queued change to an LLMHost failed, as its status message and an error event.
The task’s caller has already returned, so this is where the owner sees why: describe, and the console. The service records the cluster’s and the cloud’s errors itself, with the LLMHost’s status; this records the others, e.g. a Secret deleted after the change was queued, without changing the status.