manage.py deploy_builtin_llmclients

This module is used to deploy a customer API.

class smarter.apps.llmclient.management.commands.deploy_builtin_llmclients.Command(stdout=None, stderr=None, no_color=False, force_color=False)[source]

Bases: SmarterCommand

Deploy built-in llmclients and plugins for a Smarter account.

This management command automates the deployment of default llmclients and plugins for a given account. The account can be specified by its account number. The deployment process reads YAML manifest files from predefined directories, applies each manifest to create plugins and llmclients, and then deploys each llmclient as a Celery task.

The deployed llmclients are accessible at URLs of the form: [llmclient-name].[account-number].api.example.com/llm-client/

Deployment Steps:
  • Retrieve the account and its admin user using the provided account number.

  • Iterate through all plugin manifest files and create each plugin.

  • Iterate through all llmclient manifest files, create each llmclient, and deploy it asynchronously.

  • Output progress and status messages for each operation.

This command is intended for administrators to quickly provision standard llmclients and plugins for new or existing accounts, ensuring consistent setup and deployment across environments.

__init__(stdout=None, stderr=None, no_color=False, force_color=False)[source]
account: Account | None = None
add_arguments(parser)[source]

Add arguments to the command.

create_and_deploy_llmclient(filespec)[source]

Create and deploy an llmclient by name.

Apply the Smarter yaml manifest: - Read and Parse the YAML file - load in the body of the POST request - get a response - check the response - get the llmclient by name - deploy the llmclient as a Celery task

Return type:

bool

create_plugin(filespec)[source]

Create a plugin by name.

Apply the Smarter yaml manifest: - Read and Parse the YAML file - load in the body of the POST request - get a response - check the response

Return type:

bool

delete_llmclient(name)[source]

Delete an llmclient by name.

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

Deploy built-in llmclients for an account.

property url: str
user: User
user_profile: UserProfile | None = None