Skip to content

client.foundation

Bases: SyncResource

Sync foundation-models namespace (client.foundation).

list

list() -> list[FoundationModel]

List the platform's foundation models (a complete bounded set — the server's envelope is always single-page, so this returns a plain list).

get

get(key: str) -> FoundationModelStatus

Fetch one catalog entry plus its live status (a complete snapshot, not a page).

Raises:

Type Description
NotFoundError

no foundation model with that key (UNCATEGORIZED).

predict

predict(key: str, *, image: ImageRefParam, text_prompts: list[str] | None = None, box_prompts: list[BoxPromptParam] | None = None, confidence: float | None = None) -> FoundationPredictResult

Run zero-shot detection on one image (boxes normalized to [x,y,w,h]).

Parameters:

Name Type Description Default
image ImageRefParam

image source dict — exactly one of image_b64 / image_url.

required
text_prompts list[str] | None

open-vocab class names to detect.

None
box_prompts list[BoxPromptParam] | None

few-shot visual example prompts, each {"box": [x1,y1,x2,y2], "prompt": str, "ref_image": {...}?} (ref_image defaults to the search image).

None
confidence float | None

one slider [0,1] mapped to ZERO's thresholds; null uses the catalog default.

None

Provide at least one text or box prompt.

Raises:

Type Description
NotFoundError

no foundation model with that key (UNCATEGORIZED).

UnprocessableError

no prompt supplied (VALIDATION_ERROR).

UnavailableError

endpoint warming (MODEL_LOADING), off-hours/down (MODEL_STARTING), or inference failed (DEPENDENCY_UNAVAILABLE).

Response models

Models returned by client.foundation methods (fields, types, and what each means).

Platform foundation-model domain models (ZERO zero-shot VFM, ADR-0069).

The foundation resource wraps ZERO, a platform-managed shared zero-shot detector: list the catalog, read live availability, and prompt it with text and/or box prompts. These are the read shapes those calls return — the catalog entry (+ live status) and the normalized predictions (bbox [x,y,w,h]).

FoundationModel

Bases: BaseModel

One foundation-model catalog entry (the playground's model picker).

FoundationModelStatus

Bases: FoundationModel

Catalog entry + live availability. status is one of ready (predict works), warming (endpoint coming up), or unavailable (off-hours/down).

FoundationPrediction

Bases: BaseModel

One normalized detection: class name + typed bbox geometry + confidence.

FoundationPredictResult

Bases: BaseModel

Response of a single-image predict: predictions + decoded image size.