manage.py deploy_llm_client

This module is used to deploy a customer API.

class smarter.apps.llm_client.management.commands.deploy_llm_client.Command(*args, **kwargs)[source]

Bases: SmarterCommand

Deploy a customer API.

Provide either an account number or a company name. Deploys to a URL of the form [user-defined-subdomain].####-####-####.api.example.com/llm-client/

add_arguments(parser)[source]

Add arguments to the command.

handle(*args, **options)[source]

Deploy a customer-facing llm_client API for a Smarter account.

This management command enables administrators to deploy an llm_client for a specific account, identified either by its account number or company name. The llm_client is deployed to a URL structured as [subdomain].[account-number].api.example.com/llm-client/.

The deployment process checks for the existence of the specified account and llm_client, verifies DNS status, and initiates deployment either synchronously (foreground) or asynchronously (background Celery task).

Usage: - Specify the account using either --account_number or --company_name. - Provide the llm_client’s name (subdomain) via --name. - Optionally use --foreground to run the deployment synchronously.

Deployment Steps: - Retrieve the account by account number or company name. - Locate the llm_client by name within the account. - If the llm_client is already deployed and DNS is verified, report success. - Otherwise, deploy the llm_client using the appropriate method. - Output progress and completion messages.

This command streamlines the process of making llm_clients available to end users, ensuring proper DNS verification and deployment status.