LLMClient Task Utils

Celery tasks for llmclient app.

These tasks are long-running and/or i/o intensive operations that are managed by Celery. They are intended to be called asynchronously from the main application.

smarter.apps.llmclient.tasks.utils.API_SERVICE_NAME = 'smarter-api'

The Kubernetes Service of the platform’s api, which an LLMClient’s ingress sends its requests to.

The Helm chart names it <global.appName>-api (see smarter.apiNames in helm/charts/smarter/templates/_helpers.tpl).

smarter.apps.llmclient.tasks.utils.LEGACY_API_SERVICE_NAME = 'smarter'

The api’s Service’s name before it was renamed to API_SERVICE_NAME.

The Helm chart keeps a Service of this name, an alias, until every LLMClient’s ingress has been retargeted by smarter.apps.llmclient.tasks.retarget_ingresses.retarget_llmclient_ingresses().

smarter.apps.llmclient.tasks.utils.apply_ingress_manifest(domain)[source]

Create, or update, the Kubernetes ingress of an llmclient’s hostname.

cert-manager issues the hostname’s TLS certificate for the ingress, into the secret <domain>-tls.

Parameters:

domain (str) – The hostname, e.g. an llmclient’s default host or custom host.

Raises:

SmarterException – If the manifest cannot be applied.

Return type:

None

smarter.apps.llmclient.tasks.utils.is_taskable()[source]

Whether the cloud’s DNS and certificate services are ready for task processing.

Return type:

bool