Skip to main content

AI Models

AI Models are the model catalog. Use this resource to register third-party or self-hosted models, link a provider key (via apiKeyId), deploy/start/stop self-hosted models, and read status, logs, and permissions.

Access it as client.ai.models on a Strongly client, or the same path on AsyncStrongly with await. All methods exist on both with identical signatures.

Quick start​

from strongly import Strongly

client = Strongly()

# List (auto-paginates as you iterate) # filters: search, type, status, provider, model_type
for ai in client.ai.models.list():
print(ai.id)

Methods​

Core​

list​

list(*, search: str | None = None, type: str | None = None, status: str | None = None, provider: str | None = None, model_type: str | None = None, limit: int | None = None) -> SyncPaginator[AIModel]

List AI models with pagination, filtering, and search.

create​

create(*, name: str, type: str, provider: str, vendor_model_id: str, model_type: str | None = None, description: str | None = None, capabilities: Sequence[str] | None = None, max_tokens: int | None = None, context_window: int | None = None, config: Mapping[str, Any] | None = None, **extra) -> AIModel

Create a new AI model.

Parameters

  • name (str): Model display name.
  • type (str): Model kind (e.g. third-party or self-hosted).
  • provider (str): Provider name.
  • vendor_model_id (str): The vendor's model identifier.
  • model_type (str | None, optional): Capability class (e.g. chat, embedding, tts).
  • description (str | None, optional): Optional description.
  • capabilities (Sequence[str] | None, optional): Optional capability tags.
  • max_tokens (int | None, optional): Optional max output tokens.
  • context_window (int | None, optional): Optional context window size.
  • config (Mapping[str, Any] | None, optional): Optional model configuration.
  • **extra (Any): Additional fields accepted by the route. Pass them snake_case (e.g. api_key_id, api_endpoint); they are converted to the camelCase the API expects. Already-camelCase keys also work.

retrieve​

retrieve(model_id: str) -> AIModel

Get a single AI model by ID.

update​

update(model_id: str, *, name: str | None = None, type: str | None = None, provider: str | None = None, vendor_model_id: str | None = None, model_type: str | None = None, description: str | None = None, capabilities: Sequence[str] | None = None, max_tokens: int | None = None, context_window: int | None = None, config: Mapping[str, Any] | None = None, replicas: int | None = None, scheduling_mode: SchedulingMode | None = None, auto_shutdown_minutes: int | None = None, schedule_rules: Sequence[Mapping[str, Any]] | None = None, scaling_mode: ScalingMode | None = None, min_replicas: int | None = None, max_replicas: int | None = None, target_concurrency: int | None = None, **extra) -> AIModel

Update an AI model: the fields the model Settings tab saves.

For a deployed self-hosted model, replicas, the scheduling fields and the scaling fields change the running model without a redeploy. The resulting combination must be coherent or the call fails with a validation error and nothing changes:

  • scheduling_mode="on_demand" needs auto_shutdown_minutes (integer >= 1, the idle minutes before it scales to zero).
  • scheduling_mode="scheduled" needs schedule_rules.
  • scaling_mode is exactly "fixed" or "auto"; "auto" needs an on-demand model and min_replicas, max_replicas and target_concurrency.

CPU, memory, disk and GPU are changed with resize. **extra forwards additional fields accepted by the update route.

delete​

delete(model_id: str) -> None

Delete an AI model.

Lifecycle & actions​

start​

start(model_id: str) -> AIModel

Start an AI model.

stop​

stop(model_id: str) -> AIModel

Stop an AI model.

deploy​

deploy(model_id: str, *, instance_type: str | None = None, replicas: int | None = None, auto_shutdown_minutes: int | None = None, schedule_rules: Sequence[Mapping[str, Any]] | None = None, scaling_mode: ScalingMode | None = None, min_replicas: int | None = None, max_replicas: int | None = None, target_concurrency: int | None = None, env_vars: Mapping[str, str] | None = None, use_spot: bool | None = None, spot_fallback: bool | None = None, **extra) -> AIModel

Deploy an AI model (or activate a third-party one).

Self-hosted scheduling: auto_shutdown_minutes >= 1 makes the model on-demand (scales to zero after that many idle minutes, wakes on the next request); 0 or omitted is always-on; schedule_rules runs it in start/stop windows. replicas (integer >= 1, default 1) is the pod count while it runs.

scaling_mode is exactly "fixed" (wake to replicas) or "auto" (replicas follow live load between min_replicas and max_replicas, adding one per target_concurrency in-flight requests). "auto" needs an on-demand model and all three bounds; any invalid combination is refused with a validation error and nothing is deployed.

On an already deployed model this updates those settings and starts it. **extra forwards other deploy fields (port, cpu, memory, gpu, volume_size, autoscaling).

Other​

add_member​

add_member(resource_id: str, *, user_id: str, role: str) -> Permissions

Share the resource with a user.

Parameters

  • resource_id (str): The resource's id.
  • user_id (str): The user to share it with.
  • role (str): "editor" (use and change it) or "user" (use it only; types without a use-only tier, such as knowledge bases, take "editor" only).

clear_cache​

clear_cache(model_id: str) -> None

Clear cached metadata for a model.

list_certified​

list_certified(*, provider: str | None = None, model_type: str | None = None, capability: str | None = None) -> list[CertifiedModel]

List the third-party models the platform has certified, to add as models.

Parameters

  • provider (str | None, optional): Only this provider's (openai, anthropic, ...).
  • model_type (str | None, optional): Only this type (chat, embedding, image, ...).
  • capability (str | None, optional): Only the models with this capability (vision, audio, ...).

list_prebuilt​

list_prebuilt(*, category: str | None = None, provider: str | None = None) -> list[PrebuiltTemplate]

List the self-hosted model templates you can deploy.

Parameters

  • category (str | None, optional): Only this category (llm, embedding, image, ...).
  • provider (str | None, optional): Only this provider's (meta, google, ...).

list_providers​

list_providers() -> list[ModelProvider]

List the third-party providers of the certified models, with how many each has.

logs​

logs(model_id: str, *, lines: int | None = None, since: str | None = None, container: str | None = None) -> dict[str, Any]

Get model logs.

Parameters

  • model_id (str): The model ID.
  • lines (int | None, optional): Number of log lines to return.
  • since (str | None, optional): ISO date string; return logs since this time.
  • container (str | None, optional): Container name to get logs from.

metrics​

metrics(model_id: str) -> dict[str, Any]

Get model metrics.

options​

options(model_id: str) -> dict[str, Any]

Get available deploy/runtime options for a model.

overview​

overview() -> AIModelOverview

Get overview stats for AI models.

permissions​

permissions(resource_id: str) -> Permissions

Return who can reach the resource: its owner, members and their roles, and visibility.

Parameters

  • resource_id (str): The resource's id.

remove_member​

remove_member(resource_id: str, user_id: str) -> None

Stop sharing the resource with a user.

Parameters

  • resource_id (str): The resource's id.
  • user_id (str): The user to stop sharing it with.

resize​

resize(model_id: str, *, cpu: str | None = None, memory: str | None = None, disk: str | None = None, gpu: int | None = None, use_spot: bool | None = None, spot_fallback: bool | None = None) -> AIModel

Resize a deployed self-hosted model in place.

The running model restarts at exactly the new size (cpu e.g. "2", memory e.g. "8Gi", disk e.g. "100Gi", gpu a count). use_spot moves it on (True) or off (False) spot capacity the same way; with use_spot, spot_fallback True (the API's default) falls back to on-demand when spot is unavailable and False waits for spot. It is not deleted or redeployed. The model's budget is checked first: a refused resize raises APIError with status_code 402 and nothing changes.

set_visibility​

set_visibility(resource_id: str, visibility: str) -> Permissions

Make the resource public (every user can find and use it) or private.

Parameters

  • resource_id (str): The resource's id.
  • visibility (str): "public" or "private".

status​

status(model_id: str) -> AIModelStatus

Get model deployment status.