DRF Serializers

LLMHost serializers.

class smarter.apps.llmhost.serializers.LLMHostComputeSerializer(*args, **kwargs)[source]

Bases: MetaDataWithOwnershipModelSerializer

Serializer for the smarter.apps.llmhost.models.LLMHostCompute model.

get_fields()[source]

Return the dict of field names -> field instances that should be used for self.fields when instantiating the serializer.

get_llmhost_count(obj)[source]

The LLMHosts that run on the compute.

Return type:

int

get_manifest_url(obj)[source]

The URL of the LLMHostCompute’s detail view, which renders its manifest.

Return type:

str

get_nodegroup_name(obj)[source]

The cloud’s name of the compute’s node group.

Return type:

str

class smarter.apps.llmhost.serializers.LLMHostSerializer(*args, **kwargs)[source]

Bases: MetaDataWithOwnershipModelSerializer

Serializer for the smarter.apps.llmhost.models.LLMHost model.

get_fields()[source]

Return the dict of field names -> field instances that should be used for self.fields when instantiating the serializer.

get_manifest_url(obj)[source]

The URL of the LLMHost’s detail view, which renders its manifest.

Return type:

str