Django ORM
All models for the LLMHost app.
- class smarter.apps.llmhost.models.LLMHost(*args, **kwargs)[source]
Bases:
MetaDataWithOwnershipModelA large language model that Smarter hosts on Kubernetes.
Distinct from an LLM Provider, which is a third-party API: the account owns the LLMHost’s deployment lifecycle, i.e. launch, observe and destroy, through
smarter.apps.llmhost.services.LLMHostService.- Parameters:
id (Unknown) – Primary key: ID
created_at (Unknown) – Created at
updated_at (Unknown) – Updated at
name (Unknown) – Name. Name in camelCase, e.g., ‘apiKey’, no special characters.
description (Unknown) – Description. A brief description of this resource. Be verbose, but not too verbose.
version (Unknown) – Version. Semantic version in the format MAJOR.MINOR.PATCH, e.g., ‘1.0.0’.
annotations (Unknown) – Annotations. Key-value pairs for annotating this resource.
spec (Unknown) – Spec. The manifest’s spec, in camelCase. The source of truth for launching the LLMHost.
model_source (Unknown) – Model source
model_repository (Unknown) – Model repository. e.g. ‘meta-llama/Llama-3.1-8B-Instruct’, ‘llama3.1:8b’ or ‘s3://bucket/prefix’
model_revision (Unknown) – Model revision. Commit SHA, branch or tag pinned for reproducible deploys.
model_task (Unknown) – Model task
served_model_name (Unknown) – Served model name. The model name that clients send in their requests.
license (Unknown) – License
model_architecture (Unknown) – Model architecture. e.g. ‘llama’, ‘mistral’, ‘qwen3’
parameter_count (Unknown) – Parameter count
context_window (Unknown) – Context window
quantization (Unknown) – Quantization
embedding_dimensions (Unknown) – Embedding dimensions. Set only for embedding models.
supports_streaming (Unknown) – Supports streaming
supports_function_calling (Unknown) – Supports function calling
supports_vision (Unknown) – Supports vision
supports_reasoning (Unknown) – Supports reasoning
inference_engine (Unknown) – Inference engine
api_format (Unknown) – Api format
gpu_type (Unknown) – Gpu type. e.g. ‘A10G’
gpu_count (Unknown) – Gpu count. GPUs per replica.
vram_required_gb (Unknown) – Vram required gb
replicas (Unknown) – Replicas
cost_per_hour (Unknown) – Cost per hour. The cost per hour of one replica: its share of its compute’s node.
status (Unknown) – Status
status_message (Unknown) – Status message
is_active (Unknown) – Is active
ready_replicas (Unknown) – Ready replicas
endpoint_url (Unknown) – Endpoint url. The base URL inside the cluster.
public_url (Unknown) – Public url. The base URL of the Ingress, if any.
health_check_url (Unknown) – Health check url
last_health_check_at (Unknown) – Last health check at
last_health_ok (Unknown) – Last health ok
deployed_at (Unknown) – Deployed at. When the LLMHost was last launched.
Relationship fields:
- Parameters:
user_profile (Unknown) – User profile (related name:
llmhost)api_key_secret (Unknown) – Api key secret. The Smarter Secret with the API key that clients send as a Bearer token. (related name:
llmhosts)compute (Unknown) – Compute. The kind of node, and node group, that the LLMHost runs on: spec.compute. (related name:
llmhosts)tags (Unknown) – Tags. Tags for categorizing and organizing this resource. (related name:
llmhost)tagged_items (Unknown) – Tagged items (related name:
+)
Reverse relationships:
- Parameters:
events (Unknown) – All events of this llm host (related name of
llmhost)
- exception DoesNotExist
Bases:
ObjectDoesNotExist
- exception MultipleObjectsReturned
Bases:
MultipleObjectsReturned
- exception NotUpdated
Bases:
ObjectNotUpdated,DatabaseError
- api_format
-
Api format
Choices:
openai_compatiblehuggingfaceollama_nativecustom
- Type:
Type
- api_key_secret
ForeignKeytoSecretApi key secret. The Smarter Secret with the API key that clients send as a Bearer token. (related name:
llmhosts)- Type:
Type
- api_key_secret_id
Internal field, use
api_key_secretinstead.
- compute
-
Compute. The kind of node, and node group, that the LLMHost runs on: spec.compute. (related name:
llmhosts)- Type:
Type
- context_window
-
Context window
- Type:
Type
- cost_per_hour
-
Cost per hour. The cost per hour of one replica: its share of its compute’s node.
- Type:
Type
- created_at
-
Created at
Timestamp indicating when the model instance was created.
This field is automatically set to the current date and time when the instance is first created. It is indexed in the database for efficient querying.
- Type:
Type
- deployed_at
-
Deployed at. When the LLMHost was last launched.
- Type:
Type
- description
-
Description. A brief description of this resource. Be verbose, but not too verbose.
- Type:
Type
- embedding_dimensions
-
Embedding dimensions. Set only for embedding models.
- Type:
Type
- property estimated_cost: Decimal | None
uptime times replicas times cost_per_hour.
- Type:
The cost since the LLMHost was launched
- events
Reverse
ForeignKeyfromLLMHostEventAll events of this llm host (related name of
llmhost)- Type:
Type
- get_api_format_display(*, field=<django.db.models.CharField: api_format>)
Shows the label of the
api_format. Seeget_FOO_display()for more information.
- get_inference_engine_display(*, field=<django.db.models.CharField: inference_engine>)
Shows the label of the
inference_engine. Seeget_FOO_display()for more information.
- get_model_source_display(*, field=<django.db.models.CharField: model_source>)
Shows the label of the
model_source. Seeget_FOO_display()for more information.
- get_model_task_display(*, field=<django.db.models.CharField: model_task>)
Shows the label of the
model_task. Seeget_FOO_display()for more information.
- get_quantization_display(*, field=<django.db.models.CharField: quantization>)
Shows the label of the
quantization. Seeget_FOO_display()for more information.
- get_status_display(*, field=<django.db.models.CharField: status>)
Shows the label of the
status. Seeget_FOO_display()for more information.
- gpu_count
-
Gpu count. GPUs per replica.
- Type:
Type
- id
-
Primary key: ID
- Type:
Type
- inference_engine
-
Inference engine
Choices:
vllmtgisglangllama_cppollamateicustom
- Type:
Type
- is_active
-
Is active
- Type:
Type
- property is_deployed: bool
Whether the LLMHost’s Kubernetes resources exist, as of the last status check.
- last_health_check_at
-
Last health check at
- Type:
Type
- last_health_ok
-
Last health ok
- Type:
Type
- model_repository
-
Model repository. e.g. ‘meta-llama/Llama-3.1-8B-Instruct’, ‘llama3.1:8b’ or ‘s3://bucket/prefix’
- Type:
Type
- model_revision
-
Model revision. Commit SHA, branch or tag pinned for reproducible deploys.
- Type:
Type
- parameter_count
-
Parameter count
- Type:
Type
- quantization
-
Quantization
Choices:
nonefp32fp16bf16fp8mxfp4int8int4ggufawqgptq
- Type:
Type
- ready_replicas
-
Ready replicas
- Type:
Type
- record_event(event_type, message='', details=None)[source]
Record a lifecycle event, with the LLMHost’s current status.
- Return type:
- replicas
-
Replicas
- Type:
Type
- served_model_name
-
Served model name. The model name that clients send in their requests.
- Type:
Type
- spec
-
Spec. The manifest’s spec, in camelCase. The source of truth for launching the LLMHost.
- Type:
Type
- status
-
Status
Choices:
provisioningpendingdownloadingdeployingactivedegradedinactiveerror
- Type:
Type
- supports_function_calling
-
Supports function calling
- Type:
Type
- supports_reasoning
-
Supports reasoning
- Type:
Type
- supports_streaming
-
Supports streaming
- Type:
Type
- supports_vision
-
Supports vision
- Type:
Type
- tagged_items
Reverse
GenericRelationfromLLMHostAll + of this tagged item (related name of
tagged_items)- Type:
Type
- tags = <taggit.managers._TaggableManager object>
- updated_at
-
Updated at
Timestamp indicating when the model instance was last updated.
This field is automatically updated to the current date and time whenever the instance is saved. It is indexed in the database for efficient querying.
- Type:
Type
- user_profile
-
User profile (related name:
llmhost)- Type:
Type
- user_profile_id
Internal field, use
user_profileinstead.
- version
-
Version. Semantic version in the format MAJOR.MINOR.PATCH, e.g., ‘1.0.0’.
- Type:
Type
- vram_required_gb
-
Vram required gb
- Type:
Type
- class smarter.apps.llmhost.models.LLMHostCompute(*args, **kwargs)[source]
Bases:
MetaDataWithOwnershipModelA kind of node, e.g. g6.2xlarge with one NVIDIA L4, and its node group.
The node’s capacity is what the instance type provides. What pods can request, its allocatable capacity, is less: the kubelet, the operating system and the cluster’s DaemonSets reserve some of it. See
allocatable_cpu_millicoresandallocatable_memory_mib.- Parameters:
id (Unknown) – Primary key: ID
created_at (Unknown) – Created at
updated_at (Unknown) – Updated at
name (Unknown) – Name. Name in camelCase, e.g., ‘apiKey’, no special characters.
description (Unknown) – Description. A brief description of this resource. Be verbose, but not too verbose.
version (Unknown) – Version. Semantic version in the format MAJOR.MINOR.PATCH, e.g., ‘1.0.0’.
annotations (Unknown) – Annotations. Key-value pairs for annotating this resource.
spec (Unknown) – Spec. The manifest’s spec, in camelCase. The source of truth for the node group.
instance_type (Unknown) – Instance type. e.g. ‘g6.2xlarge’.
cpu (Unknown) – Cpu. vCPUs.
memory_gb (Unknown) – Memory gb. GiB.
gpu_type (Unknown) – Gpu type. e.g. ‘L4’.
gpu_count (Unknown) – Gpu count
gpu_memory_gb (Unknown) – Gpu memory gb. Per GPU.
max_nodes (Unknown) – Max nodes. The most nodes that Smarter adds.
price_per_hour (Unknown) – Price per hour. Of one node, e.g. its on-demand price.
nodegroup_status (Unknown) – Nodegroup status
desired_nodes (Unknown) – Desired nodes
ready_nodes (Unknown) – Ready nodes
status_message (Unknown) – Status message
last_reconciled_at (Unknown) – Last reconciled at
Relationship fields:
- Parameters:
user_profile (Unknown) – User profile (related name:
llmhostcompute)tags (Unknown) – Tags. Tags for categorizing and organizing this resource. (related name:
llmhostcompute)tagged_items (Unknown) – Tagged items (related name:
+)
Reverse relationships:
- Parameters:
llmhosts (Unknown) – All llmhosts of this LLMHost Compute (related name of
compute)
- exception DoesNotExist
Bases:
ObjectDoesNotExist
- exception MultipleObjectsReturned
Bases:
MultipleObjectsReturned
- exception NotUpdated
Bases:
ObjectNotUpdated,DatabaseError
- property allocatable_cpu_millicores: int
An estimate of the CPU that pods can request on one node.
The kubelet’s reservation, and the cluster’s DaemonSets, e.g. the CNI, kube-proxy and the NVIDIA device plugin: half a core plus 2%.
- property allocatable_memory_mib: int
less 1.5 GiB plus 3%.
- Type:
An estimate of the memory that pods can request on one node
- clone(new_name=None, new_version=None, user_profile=None)[source]
Clone the LLMHostCompute’s spec, but not its node group: the clone is a new kind of node, whose node group Smarter creates when an LLMHost first needs one of its nodes.
- Return type:
- cpu
-
Cpu. vCPUs.
- Type:
Type
- created_at
-
Created at
Timestamp indicating when the model instance was created.
This field is automatically set to the current date and time when the instance is first created. It is indexed in the database for efficient querying.
- Type:
Type
- description
-
Description. A brief description of this resource. Be verbose, but not too verbose.
- Type:
Type
- desired_nodes
-
Desired nodes
- Type:
Type
- gpu_count
-
Gpu count
- Type:
Type
- gpu_memory_gb
-
Gpu memory gb. Per GPU.
- Type:
Type
- id
-
Primary key: ID
- Type:
Type
- last_reconciled_at
-
Last reconciled at
- Type:
Type
- llmhosts
Reverse
ForeignKeyfromLLMHostAll llmhosts of this LLMHost Compute (related name of
compute)- Type:
Type
- max_nodes
-
Max nodes. The most nodes that Smarter adds.
- Type:
Type
- memory_gb
-
Memory gb. GiB.
- Type:
Type
- property nodegroup_name: str
The node group’s name, unique to the environment, e.g. smarter-alpha-12-gpu-l4-1x.
- price_per_hour
-
Price per hour. Of one node, e.g. its on-demand price.
- Type:
Type
- ready_nodes
-
Ready nodes
- Type:
Type
- rename(new_name)[source]
Rename the LLMHostCompute.
Refused while its node group exists, whose name includes the LLMHostCompute’s, or while LLMHosts use it, whose spec.compute names it.
- Raises:
ValueError – if it cannot be renamed.
- Return type:
- spec
-
Spec. The manifest’s spec, in camelCase. The source of truth for the node group.
- Type:
Type
- tagged_items
Reverse
GenericRelationfromLLMHostComputeAll + of this tagged item (related name of
tagged_items)- Type:
Type
- tags = <taggit.managers._TaggableManager object>
- updated_at
-
Updated at
Timestamp indicating when the model instance was last updated.
This field is automatically updated to the current date and time whenever the instance is saved. It is indexed in the database for efficient querying.
- Type:
Type
- user_profile
-
User profile (related name:
llmhostcompute)- Type:
Type
- user_profile_id
Internal field, use
user_profileinstead.
- class smarter.apps.llmhost.models.LLMHostEvent(*args, **kwargs)[source]
Bases:
TimestampedModelA lifecycle event of an LLMHost: launched, status changed, destroyed, or an error.
Events are the LLMHost’s audit trail, and the basis of uptime and cost reporting.
- Parameters:
id (Unknown) – Primary key: ID
created_at (Unknown) – Created at
updated_at (Unknown) – Updated at
llmhost_name (Unknown) – Llmhost name. The LLMHost’s name, in case it is deleted.
event_type (Unknown) – Event type
status (Unknown) – Status
message (Unknown) – Message
details (Unknown) – Details
Relationship fields:
- Parameters:
llmhost (Unknown) – Llmhost (related name:
events)
- exception DoesNotExist
Bases:
ObjectDoesNotExist
- exception MultipleObjectsReturned
Bases:
MultipleObjectsReturned
- exception NotUpdated
Bases:
ObjectNotUpdated,DatabaseError
- created_at
-
Created at
Timestamp indicating when the model instance was created.
This field is automatically set to the current date and time when the instance is first created. It is indexed in the database for efficient querying.
- Type:
Type
- event_type
-
Event type
Choices:
launchedstatus_changeddestroyednodes_scalederror
- Type:
Type
- get_event_type_display(*, field=<django.db.models.CharField: event_type>)
Shows the label of the
event_type. Seeget_FOO_display()for more information.
- get_status_display(*, field=<django.db.models.CharField: status>)
Shows the label of the
status. Seeget_FOO_display()for more information.
- id
-
Primary key: ID
- Type:
Type
- llmhost
-
Llmhost (related name:
events)- Type:
Type
- objects = <django.db.models.Manager object>
- status
-
Status
Choices:
provisioningpendingdownloadingdeployingactivedegradedinactiveerror
- Type:
Type
- updated_at
-
Updated at
Timestamp indicating when the model instance was last updated.
This field is automatically updated to the current date and time whenever the instance is saved. It is indexed in the database for efficient querying.
- Type:
Type