Django ORM

All models for the LLMHost app.

class smarter.apps.llmhost.models.LLMHost(*args, **kwargs)[source]

Bases: MetaDataWithOwnershipModel

Implements the LLMHost API model.

Models a self-hosted LLM: its provenance (e.g. a Hugging Face repo), its serving stack (inference engine + endpoint), and the hardware it’s deployed on. Distinct from a hosted/third-party provider config — this assumes the org owns the deployment lifecycle.

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.

  • huggingface_repo_id (Unknown) – Huggingface repo id. e.g. ‘meta-llama/Meta-Llama-3-8B-Instruct’

  • huggingface_revision (Unknown) – Huggingface revision. Commit SHA or tag pinned for reproducible deploys.

  • license (Unknown) – License

  • model_architecture (Unknown) – Model architecture. e.g. ‘llama’, ‘mistral’, ‘mixtral’, ‘qwen2’

  • 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

  • inference_engine (Unknown) – Inference engine

  • api_format (Unknown) – Api format

  • endpoint_url (Unknown) – Endpoint url. Base URL of the inference server.

  • api_key (Unknown) – Api key

  • deployment_type (Unknown) – Deployment type

  • cloud_provider (Unknown) – Cloud provider

  • region (Unknown) – Region

  • instance_type (Unknown) – Instance type. e.g. ‘g5.2xlarge’

  • gpu_type (Unknown) – Gpu type. e.g. ‘A100-80GB’

  • gpu_count (Unknown) – Gpu count

  • vram_required_gb (Unknown) – Vram required gb

  • status (Unknown) – Status

  • is_active (Unknown) – Is active

  • health_check_url (Unknown) – Health check url

  • last_health_check_at (Unknown) – Last health check at

  • last_health_ok (Unknown) – Last health ok

  • cost_per_hour (Unknown) – Cost per hour

  • engine_config (Unknown) – Engine config. Engine-specific launch args, sampling defaults, etc.

Relationship fields:

Parameters:
  • user_profile (Unknown) – User profile (related name: llmhost)

  • tags (Unknown) – Tags. Tags for categorizing and organizing this resource. (related name: llmhost)

  • tagged_items (Unknown) – Tagged items (related name: +)

class ApiFormat(*values)[source]

Bases: TextChoices

CUSTOM = 'custom'
HUGGINGFACE = 'huggingface'
OLLAMA_NATIVE = 'ollama_native'
OPENAI_COMPATIBLE = 'openai_compatible'
class CloudProvider(*values)[source]

Bases: TextChoices

AWS = 'aws'
AZURE = 'azure'
GCP = 'gcp'
ON_PREM = 'on_prem'
OTHER = 'other'
class DeploymentType(*values)[source]

Bases: TextChoices

BARE_METAL = 'bare_metal'
CLOUD_INSTANCE = 'cloud_instance'
DOCKER = 'docker'
KUBERNETES = 'kubernetes'
exception DoesNotExist

Bases: ObjectDoesNotExist

class InferenceEngine(*values)[source]

Bases: TextChoices

CUSTOM = 'custom'
LLAMA_CPP = 'llama_cpp'
OLLAMA = 'ollama'
SGLANG = 'sglang'
TGI = 'tgi'
TRANSFORMERS = 'transformers'
TRITON = 'triton'
VLLM = 'vllm'
exception MultipleObjectsReturned

Bases: MultipleObjectsReturned

exception NotUpdated

Bases: ObjectNotUpdated, DatabaseError

class Quantization(*values)[source]

Bases: TextChoices

AWQ = 'awq'
BF16 = 'bf16'
FP16 = 'fp16'
GGUF = 'gguf'
GPTQ = 'gptq'
INT4 = 'int4'
INT8 = 'int8'
NONE = 'none'
class Status(*values)[source]

Bases: TextChoices

ACTIVE = 'active'
DEGRADED = 'degraded'
DEPLOYING = 'deploying'
DEPRECATED = 'deprecated'
DOWNLOADING = 'downloading'
ERROR = 'error'
INACTIVE = 'inactive'
PENDING = 'pending'
annotations

JSONField

Annotations. Key-value pairs for annotating this resource.

Type:

Type

api_format

CharField

Api format

Choices:

  • openai_compatible

  • huggingface

  • ollama_native

  • custom

Type:

Type

api_key

CharField

Api key

Type:

Type

cloud_provider

CharField

Cloud provider

Choices:

  • aws

  • gcp

  • azure

  • on_prem

  • other

Type:

Type

context_window

PositiveIntegerField

Context window

Type:

Type

cost_per_hour

DecimalField

Cost per hour

Type:

Type

created_at

DateTimeField

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

deployment_type

CharField

Deployment type

Choices:

  • docker

  • kubernetes

  • bare_metal

  • cloud_instance

Type:

Type

description

TextField

Description. A brief description of this resource. Be verbose, but not too verbose.

Type:

Type

embedding_dimensions

PositiveIntegerField

Embedding dimensions. Set only for embedding models.

Type:

Type

endpoint_url

URLField

Endpoint url. Base URL of the inference server.

Type:

Type

engine_config

JSONField

Engine config. Engine-specific launch args, sampling defaults, etc.

Type:

Type

get_api_format_display(*, field=<django.db.models.CharField: api_format>)

Shows the label of the api_format. See get_FOO_display() for more information.

get_cloud_provider_display(*, field=<django.db.models.CharField: cloud_provider>)

Shows the label of the cloud_provider. See get_FOO_display() for more information.

get_deployment_type_display(*, field=<django.db.models.CharField: deployment_type>)

Shows the label of the deployment_type. See get_FOO_display() for more information.

get_inference_engine_display(*, field=<django.db.models.CharField: inference_engine>)

Shows the label of the inference_engine. See get_FOO_display() for more information.

get_quantization_display(*, field=<django.db.models.CharField: quantization>)

Shows the label of the quantization. See get_FOO_display() for more information.

get_status_display(*, field=<django.db.models.CharField: status>)

Shows the label of the status. See get_FOO_display() for more information.

gpu_count

PositiveSmallIntegerField

Gpu count

Type:

Type

gpu_type

CharField

Gpu type. e.g. ‘A100-80GB’

Type:

Type

health_check_url

URLField

Health check url

Type:

Type

huggingface_repo_id

CharField

Huggingface repo id. e.g. ‘meta-llama/Meta-Llama-3-8B-Instruct’

Type:

Type

huggingface_revision

CharField

Huggingface revision. Commit SHA or tag pinned for reproducible deploys.

Type:

Type

id

BigAutoField

Primary key: ID

Type:

Type

inference_engine

CharField

Inference engine

Choices:

  • vllm

  • tgi

  • ollama

  • llama_cpp

  • sglang

  • transformers

  • triton

  • custom

Type:

Type

instance_type

CharField

Instance type. e.g. ‘g5.2xlarge’

Type:

Type

is_active

BooleanField

Is active

Type:

Type

last_health_check_at

DateTimeField

Last health check at

Type:

Type

last_health_ok

BooleanField

Last health ok

Type:

Type

license

CharField

License

Type:

Type

model_architecture

CharField

Model architecture. e.g. ‘llama’, ‘mistral’, ‘mixtral’, ‘qwen2’

Type:

Type

name

CharField

Name. Name in camelCase, e.g., ‘apiKey’, no special characters.

Type:

Type

parameter_count

BigIntegerField

Parameter count

Type:

Type

quantization

CharField

Quantization

Choices:

  • none

  • fp16

  • bf16

  • int8

  • int4

  • gguf

  • awq

  • gptq

Type:

Type

region

CharField

Region

Type:

Type

status

CharField

Status

Choices:

  • pending

  • downloading

  • deploying

  • active

  • degraded

  • inactive

  • error

  • deprecated

Type:

Type

supports_function_calling

BooleanField

Supports function calling

Type:

Type

supports_streaming

BooleanField

Supports streaming

Type:

Type

supports_vision

BooleanField

Supports vision

Type:

Type

tagged_items

Reverse GenericRelation from LLMHost

All + of this tagged item (related name of tagged_items)

Type:

Type

tags = <taggit.managers._TaggableManager object>
updated_at

DateTimeField

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

ForeignKey to UserProfile

User profile (related name: llmhost)

Type:

Type

user_profile_id

Internal field, use user_profile instead.

version

CharField

Version. Semantic version in the format MAJOR.MINOR.PATCH, e.g., ‘1.0.0’.

Type:

Type

vram_required_gb

PositiveIntegerField

Vram required gb

Type:

Type