Detail View

This module contains views to implement the LLMHost card-style detail view in the Smarter Dashboard.

class smarter.apps.llmhost.views.detailview.LLMHostComputeDetailView(**kwargs)[source]

Bases: LLMHostDetailView

Renders the manifest of an LLMHostCompute, with its node group’s status, in YAML.

Example usage:

GET /llmhost/compute/<hashed_id>/
manifest_kind: SAMKinds = 'LLMHostCompute'
model

alias of LLMHostCompute

class smarter.apps.llmhost.views.detailview.LLMHostDetailView(**kwargs)[source]

Bases: DocsBaseView

Renders the detail view for a Smarter dashboard llmhost.

This view renders a detailed manifest for a specific llmhost, including its configuration and metadata, in YAML format. It is intended for authenticated users and provides error handling for missing or unsupported llmhost kinds and names.

Parameters:
  • request (ASGIRequest) – Django HTTP request object.

  • args (tuple) – Additional positional arguments.

  • kwargs (dict) – Keyword arguments, must include ‘name’ (llmhost name) and ‘kind’ (llmhost type).

Returns:

Rendered HTML page with llmhost manifest details, or a 404 error page if the llmhost is not found or parameters are invalid.

Return type:

HttpResponse

Note

The llmhost name and kind must be provided and valid. Otherwise, a “not found” response is returned.

See also

LLMHost for llmhost metadata retrieval. ApiV1CliDescribeApiView for API details.

Example usage:

GET /llmhost/detail/?name=my_llmhost&kind=custom
get(request, *args, **kwargs)[source]

Handle GET requests to render the llmhost manifest detail view.

This method processes the incoming request to retrieve the specified llmhost’s manifest details and renders them in a user-friendly format. It performs validation on the provided llmhost name and kind, retrieves the llmhost metadata, and handles any errors that may arise during this process.

Process: 1. Extract and validate ‘name’ and ‘kind’ from kwargs. 2. Retrieve the llmhost metadata using the provided name and user context. 3. If the llmhost is found, call the API view to get the llmhost details 4. Convert the JSON response to YAML format for better readability. 5. Render the llmhost manifest detail template with the retrieved data. 6. Handle any errors that occur during the process and return appropriate error responses.

Parameters:
  • request (ASGIRequest) – Django HTTP request object.

  • args (tuple) – Additional positional arguments.

  • kwargs (dict) – Keyword arguments, must include ‘name’ (llmhost name) and ‘kind’ (llmhost type).

Returns:

Rendered HTML page with llmhost manifest details, or an error response if the llmhost is not found or parameters are invalid.

Return type:

HttpResponse

llmhost: LLMHost | LLMHostCompute | None = None

The resource whose manifest is rendered.

manifest_kind: SAMKinds = 'LLMHost'
model

The resource’s model.

The view finds it by hashed id, among the user’s, their account admin’s and the Smarter admin’s.

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)

alias of LLMHost

template_path: str | None = 'common/manifest_detail.html'